summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorSimon Hausmann <simon@lst.de>2007-07-18 15:27:50 (GMT)
committerSimon Hausmann <simon@lst.de>2007-07-18 15:29:38 (GMT)
commit144ff46b196e49fd52b2ecf0aaa1db4c190393b9 (patch)
treeff22286d8e60e2bb4609cb8a62bbd03034cb53b6 /contrib/fast-import
parent86506fe54c8e9e5f75a73956840497e3e5744f86 (diff)
downloadgit-144ff46b196e49fd52b2ecf0aaa1db4c190393b9.zip
git-144ff46b196e49fd52b2ecf0aaa1db4c190393b9.tar.gz
git-144ff46b196e49fd52b2ecf0aaa1db4c190393b9.tar.bz2
git-p4: Cleanup, used common function for listing imported p4 branches
Signed-off-by: Simon Hausmann <simon@lst.de>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p426
1 files changed, 5 insertions, 21 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index a65f53a..e3404ca 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1006,27 +1006,11 @@ class P4Sync(Command):
self.knownBranches[branch] = branch
def listExistingP4GitBranches(self):
- self.p4BranchesInGit = []
-
- cmdline = "git rev-parse --symbolic "
- if self.importIntoRemotes:
- cmdline += " --remotes"
- else:
- cmdline += " --branches"
-
- for line in read_pipe_lines(cmdline):
- line = line.strip()
-
- ## only import to p4/
- if not line.startswith('p4/') or line == "p4/HEAD":
- continue
- branch = line
-
- # strip off p4
- branch = re.sub ("^p4/", "", line)
-
- self.p4BranchesInGit.append(branch)
- self.initialParents[self.refPrefix + branch] = parseRevision(line)
+ # branches holds mapping from name to commit
+ branches = p4BranchesInGit(self.importIntoRemotes)
+ self.p4BranchesInGit = branches.keys()
+ for branch in branches.keys():
+ self.initialParents[self.refPrefix + branch] = branches[branch]
def createOrUpdateBranchesFromOrigin(self):
if not self.silent: