From: "Patrick C. McGinty" <>

This removes the branch names from being included in the file system
path when using the both --use-client-spec and --detect-branches

Used alone, the --detect-branches option did the right thing, removing
the branch names from the relative git path. By adding the
--use-client-spec option, the old logic would incorrectly bypass this

Signed-off-by: Patrick C. McGinty <>
--- |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ b/
index e67d37d..9489845 100755
--- a/
+++ b/
@@ -1819,7 +1819,15 @@ class P4Sync(Command, P4UserMap):
     def stripRepoPath(self, path, prefixes):
         if self.useClientSpec:
-            return self.clientSpecDirs.map_in_client(path)
+            # map path to user defined client location
+            path = self.clientSpecDirs.map_in_client(path)
+            # Remove prefixes (e.g. branch names) from path. Apply the
+            # clientSpecDirs map to the prefix paths to match the
+            # modified path value.
+            for p in map(self.clientSpecDirs.map_in_client, prefixes):
+               if p and p4PathStartsWith( path, p):
+                  path = path[len(p):]
+            return path
         if self.keepRepoPath:
             prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to