Example of perforce checkout rules

Hi,

I am using server side checkout that looks like this

Perforce root
//depot/... //team-city-agent/depot/...

In perforce I have
//depot/main
//depot/software
//depot/release/X/main
//depot/release/X/software

My checkout rules for head are:

-:.
+:main=>main
+:software=>software

I want to get only main and software and avoid getting everything else under //depot/...

checkout rules for release are:

-:.
+:release/X/main=>main
+:release/X/software=>software

With this setup I got the entire contents of P4 depot on my TC server. Could you please provide and example for P4?

I am thinking to try this, to follow P4 syntax:
-:.
+://depot/main/..=>main
+://depot/software/..=>software

-:.
+://depot/release/X/main/..=>main
+://depot/release/X/software/..=>software

With the size of my depot and TC server running out of disk space it is kind of hard to learn by trying. Thank you.

Vadim.

2 comments

Hello Vadim,

   Try using the following Perforce rules:

//depot/main/...    //team-city-agent/main/...
//depot/software/...    //team-city-agent/software/...

  and don't use checkout rules for this case at all.

  Hope this helps,
  KIR

0

Hi Kirill,

Thanks for prompt response. This is exactly how I have it setup right now, but now we upgraded to enterprise :-) and I wanted add more build configurations and manage them with templates. I will create template per VCS root for now. Thanks.

Vadim.

P.S.

This is the docs that describe what I was trying to do:

http://confluence.jetbrains.net/display/TCD5/Build+Configuration+Template

Example of Configuration Parameters Usage


The following example shows how the configuration parameters work.

Assume that you have two similar build configurations that differs  only in checkout rules. For instance, let's say for the first  configuration checkout rules should contain ':release_1_0 =>  .', and for the second configuration — ':trunk  => .'. It would be useful to have one build template to  associate with both configurations. In this case you will need means to  change checkout rules in each build configuration itself.

To solve the task, you need to perform the following procedure:

  1. Extract template from either of those configurations
  2. In template settings navigate to 2.Version Control Settings, open  Checkout rules dialog and enter there: %checkout.rules%
  3. For inherited build configuration, open configuration settings page  and in the 6.Properties and  environment variables page specify the appropriate actual value for  the checkout.rules configuration parameter.
  4. For the second build configuration click on the "Associate with  template" button and choose template. Specify appropriate value for checkout.rules parameter right in the "Associate with Template" dialog. Click  "Associate" button.


The task is solved: we have two build configurations associated with  one template and individual checkout rules.

In such manner you can create a configuration parameter and then  reference it from any build configuration, which has a text field.

0

Please sign in to leave a comment.