use string.strip() iso. slicing.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Han-Wen Nienhuys committed
May 23, 2007 at 18:29 UTC
b76f0565bfcfedba9e8920aa5120fc97796b642f
1 file changed
+4
-4
contrib/fast-import/git-p4
+4
-4
@@ -845,15 +845,15 @@ class P4Sync(Command):
845
cmdline += " --branches"
846
847
for line in read_pipe_lines(cmdline):
848
+ lie = line.strip()
849
if self.importIntoRemotes and ((not line.startswith("p4/")) or line == "p4/HEAD\n"):
850
continue
851
if self.importIntoRemotes:
852
# strip off p4
852
- branch = line[3:-1]
853
- else:
854
- branch = line[:-1]
853
+ branch = re.sub ("^p4/", "", line)
854
+
855
self.p4BranchesInGit.append(branch)
856
- self.initialParents[self.refPrefix + branch] = parseRevision(line[:-1])
856
+ self.initialParents[self.refPrefix + branch] = parseRevision(line)
857
858
def createOrUpdateBranchesFromOrigin(self):
859
if not self.silent: