Perforce API for the .Net CLR P4.Net

Sample Applications

Job Labeler

Job labeler is a Windows service that polls the Peforce server for new job fixes, and creates a label representing the files fixed by a job.

Motivation: Many shops use jobs to organize a collection of changes. For example, if you have Perforce integrated with a defect tracking system, you will have a job representing a defect, and there may be several changes fixed by that job. A frequent question that comes up is, "What files were modified to fix this defect?" Since the JobLabeler sample application creates a label representing the files fixed by a job, this question is readilly answered with "p4 files @={joblabel}".

Techniques: Even if you don't use jobs in this manner (or jobs at all), there are a number of techniques that may be used in your applications.

  • Using P4.Net from a Windows service
  • Polling the Perforce server for change.
  • Reading/Writing counters to maintain state.
  • Using parsed and unparsed output of several commands.
  • Fetching/Setting p4 settings from an app.config file.