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>maint
parent
e63231e566
commit
0d1696ef47
|
@ -1819,8 +1819,9 @@ class P4Sync(Command, P4UserMap):
|
||||||
|
|
||||||
def stripRepoPath(self, path, prefixes):
|
def stripRepoPath(self, path, prefixes):
|
||||||
if self.useClientSpec:
|
if self.useClientSpec:
|
||||||
return self.clientSpecDirs.map_in_client(path)
|
path = self.clientSpecDirs.map_in_client(path)
|
||||||
|
|
||||||
|
else:
|
||||||
if self.keepRepoPath:
|
if self.keepRepoPath:
|
||||||
prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]
|
prefixes = [re.sub("^(//[^/]+/).*", r'\1', prefixes[0])]
|
||||||
|
|
||||||
|
@ -1828,6 +1829,7 @@ class P4Sync(Command, P4UserMap):
|
||||||
if p4PathStartsWith(path, p):
|
if p4PathStartsWith(path, p):
|
||||||
path = path[len(p):]
|
path = path[len(p):]
|
||||||
|
|
||||||
|
path = wildcard_decode(path)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def splitFilesIntoBranches(self, commit):
|
def splitFilesIntoBranches(self, commit):
|
||||||
|
@ -1849,7 +1851,6 @@ class P4Sync(Command, P4UserMap):
|
||||||
fnum = fnum + 1
|
fnum = fnum + 1
|
||||||
|
|
||||||
relPath = self.stripRepoPath(path, self.depotPaths)
|
relPath = self.stripRepoPath(path, self.depotPaths)
|
||||||
relPath = wildcard_decode(relPath)
|
|
||||||
|
|
||||||
for branch in self.knownBranches.keys():
|
for branch in self.knownBranches.keys():
|
||||||
|
|
||||||
|
@ -1867,7 +1868,6 @@ class P4Sync(Command, P4UserMap):
|
||||||
|
|
||||||
def streamOneP4File(self, file, contents):
|
def streamOneP4File(self, file, contents):
|
||||||
relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
|
relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
|
||||||
relPath = wildcard_decode(relPath)
|
|
||||||
if verbose:
|
if verbose:
|
||||||
sys.stderr.write("%s\n" % relPath)
|
sys.stderr.write("%s\n" % relPath)
|
||||||
|
|
||||||
|
@ -1936,7 +1936,6 @@ class P4Sync(Command, P4UserMap):
|
||||||
|
|
||||||
def streamOneP4Deletion(self, file):
|
def streamOneP4Deletion(self, file):
|
||||||
relPath = self.stripRepoPath(file['path'], self.branchPrefixes)
|
relPath = self.stripRepoPath(file['path'], self.branchPrefixes)
|
||||||
relPath = wildcard_decode(relPath)
|
|
||||||
if verbose:
|
if verbose:
|
||||||
sys.stderr.write("delete %s\n" % relPath)
|
sys.stderr.write("delete %s\n" % relPath)
|
||||||
self.gitStream.write("D %s\n" % relPath)
|
self.gitStream.write("D %s\n" % relPath)
|
||||||
|
|
Loading…
Reference in New Issue