summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2012-08-11 16:55:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-08-12 04:42:14 (GMT)
commit0d1696ef47a61bba1088b0e5cd58a8bc45d936fb (patch)
tree83b59b879eef2d57f1dbb645d2506129fd6695de /git-p4.py
parente63231e566e2ac063e9f2aca18f5e3dca29dbc8f (diff)
downloadgit-0d1696ef47a61bba1088b0e5cd58a8bc45d936fb.zip
git-0d1696ef47a61bba1088b0e5cd58a8bc45d936fb.tar.gz
git-0d1696ef47a61bba1088b0e5cd58a8bc45d936fb.tar.bz2
git p4: do wildcard decoding in stripRepoPath
Instead of having to remember to do it after each call to stripRepoPath, make it part of that function. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/git-p4.py b/git-p4.py
index 6d07115..e20ff5d 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1819,15 +1819,17 @@ class P4Sync(Command, P4UserMap):
def stripRepoPath(self, path, prefixes):
if self.useClientSpec:
- return self.clientSpecDirs.map_in_client(path)
+ path = self.clientSpecDirs.map_in_client(path)
- if self.keepRepoPath:
- prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]
+ else:
+ if self.keepRepoPath:
+ prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]
- for p in prefixes:
- if p4PathStartsWith(path, p):
- path = path[len(p):]
+ for p in prefixes:
+ if p4PathStartsWith(path, p):
+ path = path[len(p):]
+ path = wildcard_decode(path)
return path
def splitFilesIntoBranches(self, commit):
@@ -1849,7 +1851,6 @@ class P4Sync(Command, P4UserMap):
fnum = fnum + 1
relPath = self.stripRepoPath(path, self.depotPaths)
- relPath = wildcard_decode(relPath)
for branch in self.knownBranches.keys():
@@ -1867,7 +1868,6 @@ class P4Sync(Command, P4UserMap):
def streamOneP4File(self, file, contents):
relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
- relPath = wildcard_decode(relPath)
if verbose:
sys.stderr.write("%s\n" % relPath)
@@ -1936,7 +1936,6 @@ class P4Sync(Command, P4UserMap):
def streamOneP4Deletion(self, file):
relPath = self.stripRepoPath(file['path'], self.branchPrefixes)
- relPath = wildcard_decode(relPath)
if verbose:
sys.stderr.write("delete %s\n" % relPath)
self.gitStream.write("D %s\n" % relPath)