Checkout rules to avoid Starteam sub folders

Hello,

I would like to write a checkout rule that has to retrieve only files in a given folder.
In Starteam, I have a folder "SharedModules" that contains 2 files. Then I have more than  ten sub folders that I don't want retrieved.

My question is how could I write checkout rules in order to checkout only theses two files?

If I write: "+:SharedModules" all folder and sub folders content are retrieved (more than 200 files).
Is there a simple solution without having to write all the exclusion rules like "-:SharedModules\subfolder1", "-:Sharedmodules\subfolder2", etc...

Thanks.
Adriano

4 comments
Comment actions Permalink

Currently checkout rules work for folders only, there is no way to use them for excluding files. Please submit a feature request if you need this feature.

--
Pavel Sher

0
Comment actions Permalink

Hello Pavel,

In fact I don't want to include or exclude files, but include only a folder without its subfolders.
I know I can use "-:subfolderToExclude" but when you have more than 20 subfolders or a variable amount of subfolders it is not easy to write and maintain a list of subfolder exclusion rules.
If it's not possible, I will follow your suggestion and submit a feature request.
Thanks

0
Comment actions Permalink

Sorry I did not get it. I suppose you need to specify wildcards in checkout rules, however this will not work too, there is separate feature request for this: http://jetbrains.net/tracker/issue/TW-3460

--
Pavel Sher

0
Comment actions Permalink

I've been able to work around this issue (with perforce) by carefully crafting my client spec.  It's a massive hack around a little missing feature, but it's working well.

- For files/folders which need filtering, I use the perforce client spec to remap them to subfolders by file type or by use context.  For example, I have an 'sln' mapping:

//depot/branch/... //team-city-agent/...
+//depot/branch/*.sln //team-city-agent/sln/*.sln
+//depot/branch/*.vcxproj //team-city-agent/branch/sln/*.vcxproj

- When these files need to be checked out to the correct folder, I use the VCS Checkout Rules to remap those folders back to their correct paths while excluding everything else from the folder they came from.

This works pretty well but there are some pitfalls.

- When remapping the paths to a parent folder back with VCS Checkout Rules you *must* put those rules as early as possible, otherwise when perforce parses the resulting client spec the root folder will be considered completely remapped to the virtual path, and you won't get anything else synced.

An example of this failing:

-:.
+:src
+:data
+:sln => .

Maps to

+//depot/branch/*.sln //team-city-agent/sln/*.sln
+//depot/branch/*.vcxproj //team-city-agent/branch/sln/*.vcxproj
+//depot/branch/src/... //team-city-agent/src/...
+//depot/branch/data/... //team-city-agent/data/...
+//depot/branch/sln/... //team-city-agent/...

Perforce parses client specs from the bottom up, so it starts looking for everything in the entire branch in the sln folder, and we only get the contents of that folder - when it tries to find src, it looks in //depot/branch/sln/src/... , which doesn't exist.

Done correctly:

-:.
+:sln => .
+:src
+:data

Maps to:
+//depot/branch/*.sln //team-city-agent/sln/*.sln
+//depot/branch/*.vcxproj //team-city-agent/branch/sln/*.vcxproj
+//depot/branch/sln/... //team-city-agent/...
+//depot/branch/src/... //team-city-agent/src/...
+//depot/branch/data/... //team-city-agent/data/...

And perforce is able to find the folders it needs before it traverses up to the remapped level.

Another caveat - if you try and use this to remap multiple folders containing wildcards that match each other into the same location and then run operations on them (like submit), you're going to run into problems, as perforce is *always* going to consider the further-down remap and ignore the higher-up one.  If you only need to sync the files you don't get this problem, since perforce isn't trying to retroactively figure out where in the depot the file exists, it's only figuring out where the file from the depot should go.

0

Please sign in to leave a comment.