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):
fnum = fnum + 1
relPath = self.stripRepoPath(path, self.depotPaths)
- relPath = wildcard_decode(relPath)
for branch in self.knownBranches.keys():
def streamOneP4File(self, file, contents):
relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
- relPath = wildcard_decode(relPath)
if verbose:
sys.stderr.write("%s\n" % relPath)
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)