Skip to content

Commit

Permalink
git-p4: Cleanup, used common function for listing imported p4 branches
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hausmann <simon@lst.de>
  • Loading branch information
Simon Hausmann committed Jul 18, 2007
1 parent 86506fe commit 144ff46
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 144ff46

Please sign in to comment.