summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorSimon Hausmann <simon@lst.de>2007-06-20 21:10:28 (GMT)
committerSimon Hausmann <simon@lst.de>2007-06-20 21:13:20 (GMT)
commit09d89de2e31ed4d62b6ff344e9ad9ef29550121b (patch)
tree5579870a3480c4181f5f197c3659bffb5f797ccd /contrib/fast-import
parent1a2edf4e8dff05fea66daf82c675cfab673c1242 (diff)
downloadgit-09d89de2e31ed4d62b6ff344e9ad9ef29550121b.zip
git-09d89de2e31ed4d62b6ff344e9ad9ef29550121b.tar.gz
git-09d89de2e31ed4d62b6ff344e9ad9ef29550121b.tar.bz2
Added git-p4 branches command that shows the mapping of perforce depot paths to imported git branches.
Signed-off-by: Simon Hausmann <simon@lst.de>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p428
1 files changed, 27 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 2040591..16de15c 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1465,6 +1465,31 @@ class P4Clone(P4Sync):
return True
+class P4Branches(Command):
+ def __init__(self):
+ Command.__init__(self)
+ self.options = [ ]
+ self.description = ("Shows the git branches that hold imports and their "
+ + "corresponding perforce depot paths")
+ self.verbose = False
+
+ def run(self, args):
+ cmdline = "git rev-parse --symbolic "
+ cmdline += " --remotes"
+
+ for line in read_pipe_lines(cmdline):
+ line = line.strip()
+
+ if not line.startswith('p4/') or line == "p4/HEAD":
+ continue
+ branch = line
+
+ log = extractLogMessageFromGitCommit("refs/remotes/%s" % branch)
+ settings = extractSettingsGitLog(log)
+
+ print "%s <= %s (%s)" % (branch, ",".join(settings["depot-paths"]), settings["change"])
+ return True
+
class HelpFormatter(optparse.IndentedHelpFormatter):
def __init__(self):
optparse.IndentedHelpFormatter.__init__(self)
@@ -1489,7 +1514,8 @@ commands = {
"sync" : P4Sync,
"rebase" : P4Rebase,
"clone" : P4Clone,
- "rollback" : P4RollBack
+ "rollback" : P4RollBack,
+ "branches" : P4Branches
}