SVN Checkout rules to switch subdirectories

Hi,

I have the following structure in SVN

Code
|- DEV-BusinessLayer/
|- DEV-DataModel/
|- DEV-Engine/
|- Dev-Main/
    |- src/
        |-BusinessLayer/
        |-DataModel/
        |-Engine/
        |-Engine.sln
    |- lib/



I need to SVN switch my Engine, BusinessLayer and Datamodel subdirectories in DEV-Main to DEV-Engine, DEV-BusinessLayer and DEV-DataModel, before building the solution file. The idea is, if I switch, I'm working on the dev branch, and if I don't, I'm on the main branch. Note that there is only one solution file. Also note that the structure of DEV-BusinessLayer is similar to that of DEV-Main/src/BusinessLayer, the former will be the latest code, the latter will be older stabilized code. The DEV-BusinessLayer will be merged to DEV-Main/src/BusinessLayer after testing.

I'm trying to add the following checkout rules in TeamCity, but the files that are checked out are not from the correct branch (I logged into the teamcity server, took the file and compared with my manual checkout). These are my checkout rules, what should I change to ensure correct checkout?


+:Code/DEV-BusinessLayer=>./src/BusinessLayer
+:Code/DEV-DataModel=>./src/DataModel
+:Code/DEV-Engine=>./src/Engine
+:Code/DEV-Main/src=>./src
+:Code/DEV-Main/lib=>./lib


This is what I see in the build log, I'm suspicious of the src\ folder appearing multiple times. Are the DEV-* folders getting overwritten somehow?


[18:20:00][Updating sources] Removing C:\BuildAgent\work\6148493fca83a584
[18:20:00][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src\BusinessLayer
[18:20:00][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src\DataModel
[18:20:00][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src\Engine
[18:20:01][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\lib
[18:20:04][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src
[18:20:04][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src\Engine
[18:20:04][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src
[18:20:04][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src\BusinessLayer
[18:20:05][Updating sources] Updating C:\BuildAgent\work\6148493fca83a584\src

 

The documentation says "For each file the most specific rule will apply if the file is included, regardless of what order the rules are listed in." So if I say DEV-Main/src as a whole, and then also specify src/Engine, the second one should be picked right?

1 comment
Comment actions Permalink

I got it working finally. The trick is to simply exclude those directories (explicitly) that you are going to replace from another svn location. So my checkout rules became:

+:Code/DEV-Main/src=>./src
+:Code/DEV-Main/lib=>./lib

-:Code/DEV-Main/src/BusinessLayer
-:Code/DEV-Main/src/DataModel
-:Code/DEV-Main/src/Engine

+:Code/DEV-BusinessLayer=>./src/BusinessLayer
+:Code/DEV-DataModel=>./src/DataModel
+:Code/DEV-Engine=>./src/Engine

I believe only when you explicitly specify the exclusion rule, does the "For each file the most specific rule will apply if the file is included, regardless of what order the rules are listed in." kick in. Note that once you add an exclude rule, you cannot use the checkout on agent property. Use "Automatically on server"

0

Please sign in to leave a comment.