aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSimon Hausmann <simon@lst.de>2007-07-18 10:56:31 +0200
committerSimon Hausmann <simon@lst.de>2007-07-18 17:29:05 +0200
commit062410bb9d6553e6bc4f8fa7f0cab1ed63b75628 (patch)
tree1dbaaf1dd66d9e0ae87ececb9c834b9581116a04 /contrib
parent788001908c8960daa162c32baf3dc0f9ad1c16f8 (diff)
downloadgit-062410bb9d6553e6bc4f8fa7f0cab1ed63b75628.tar.gz
git-062410bb9d6553e6bc4f8fa7f0cab1ed63b75628.tar.xz
git-p4: Cleanup, make listExistingP4Branches a global function for later use.
Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p423
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 54053e3f3..d4a2f1431 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -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 = ""