VCS Checkout Rules

Hi,

Does anyone know the exact behavior of the vcs checkout rules for perforce?  The reason I ask is I am trying to make use to build templates and have other branches just override the branch property set in the checkout rules and I'm having issues.

This is my example:

VCS Client mapping
//depot/branches/... //team-city-agent/branches/...

VCS Checkout Rules
+:branches/branchA/...

Under the branches path in perforce there are several branches there and I only want to sync the branchA which I would like to override with a property.  My concern is that even though I state the checkout rule to only sync BranchA to the agent does it sync all of //depot/branches/... to the server before filtering out what to sync to the agent?  If this is the case, having the server sync all of those branches everytime is pretty costly and this approach won't suit my needs which is why I need clarification.  If this is not the case what am I doing wrong and how can I get only branchA to sync to the server and the agent by setting the checkout rules and to further my example other builds will be using this template and will be syncing branchB, etc.

Also why can't I use +://depot/branches/branchA in the checkout rules?  Does it have to match what is after //team-city-agent/ in the vcs client mapping?

Thanks,
Jay

7 comments
Comment actions Permalink

Jason,

If you want to checkout source under //depot/branches/branchA/

and have a VCS root with the mapping: //depot/branches/... //team-city-agent/branches/...

You will need checkout rules:
+:branchA

Or, to make it more strick and not rely to defaults:
-:.
+:branchA

If you have issues with the setup please describe in detail what you expect and what you observe in TeamCity behavior.


> Also why can't I use +://depot/branches/branchA in the checkout rules?   Does it have to match what is after //team-city-agent/ in the vcs client  mapping?

Checkout rules are general VCS-repository-agnostic tool which functions over the file paths (thus, having no data on Perforce-specific depot names, etc.

0
Comment actions Permalink

Hi Yegor,

Thanks for the help but I'd like to know will //depot/branches/... all be synced on the teamcity server before checkout rules are applied?  The reason I ask is if in my example below the branches location has a lot of information and would not like to encrue the cost of syncing all of it.  Also what do you mean "rely to defaults"?  What would that be?

Also to add to this example say I would like to exclude some directories under branchA in addition, would I do this in the checkout rules or set this in the client mapping section?

Say for example I wanted to exclude these directories under branchA would I do this?

+:branchA
-:branchA/directoryA
-:branchA/directoryB
+:branchA/directoryB/keepthisdir <- To add back a directory

Thanks in advance for the help.

Jay

0
Comment actions Permalink

Hello Jason,

  The effectiveness of checkout rules currently depends on whether you're using checkout on server or checkout on agent.

  For checkout on agent (which is available since TeamCity 6.0) - we perform modification of P4 mapping, so checkout is as effective as it is effective in native P4 client.
  For checkout on server - checkout rules processing is ineffective - we checkout everything covered by perforce mapping, and discard files not included by checkout rules.

  If this is really critical for your case, you should consider creating VCS root per branch. Or use checkout on agent.

  Hope this explains things a bit,
  KIR

0
Comment actions Permalink

So just so I know what your talking about are you saying that when you do "Server side checkout" and use checkout rules that it checks out everything then discards files/directories based on how your checkout rules are set?

When using agent side checkout is this same rule applied as I read somewhere in your docs that it doesn't make sense to use the checkout rules when using agent sidecheckout as it syncs everything then throws out stuff based on your checkout rules.  

http://confluence.jetbrains.net/display/TCD6/VCS+Checkout+Mode

Reading the checkout modes it seems that when you do server side checkout that the the checkout rules are effective and that based on the checkout rules only those files are synced to the server then pushed to the agent.

Can you please confirm or clarify my statements above?

Thanks,
Jay

0
Comment actions Permalink

Hello Jason,

  The documentation is wrong about Perforce agent-side checkout. It is effective. For subversion and CVS, it is ineffective.
  Perforce agent-side checkout was added later, and we forgot to update this part of docs. Thanks for pointing out!

  Regards,
  KIR

0
Comment actions Permalink

No problem, so to conclude if I use agent side checkout and checkout rules everything won't be pulled down then discarded based on the rules I set correct?

0

Please sign in to leave a comment.