Skip to content

Commit

Permalink
git-p4: Cleanup, make listExistingP4Branches a global function for la…
Browse files Browse the repository at this point in the history
…ter use.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
  • Loading branch information
Simon Hausmann committed Jul 18, 2007
1 parent 7880019 commit 062410b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,29 @@ def gitBranchExists(branch):
def gitConfig(key):
return read_pipe("git config %s" % key, ignore_error=True).strip()

def p4BranchesInGit(branchesAreInRemotes = True):
branches = {}

cmdline = "git rev-parse --symbolic "
if branchesAreInRemotes:
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)

branches[branch] = parseRevision(line)
return branches

def findUpstreamBranchPoint(head = "HEAD"):
settings = None
branchPoint = ""
Expand Down

0 comments on commit 062410b

Please sign in to comment.