From 44e8d26cf3fbc0795fb1c44f54f458847313d35e Mon Sep 17 00:00:00 2001 From: Pete Wyckoff Date: Mon, 14 Jan 2013 19:47:08 -0500 Subject: git p4: fix submit when no master branch It finds its upstream and applies the commit properly, but the sync step will fail unless it is told which branch to work on. Signed-off-by: Pete Wyckoff Signed-off-by: Junio C Hamano --- git-p4.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git-p4.py') diff --git a/git-p4.py b/git-p4.py index 9ea1905db..253ad06cc 100755 --- a/git-p4.py +++ b/git-p4.py @@ -921,7 +921,8 @@ class P4Submit(Command, P4UserMap): optparse.make_option("--dry-run", "-n", dest="dry_run", action="store_true"), optparse.make_option("--prepare-p4-only", dest="prepare_p4_only", action="store_true"), optparse.make_option("--conflict", dest="conflict_behavior", - choices=self.conflict_behavior_choices) + choices=self.conflict_behavior_choices), + optparse.make_option("--branch", dest="branch"), ] self.description = "Submit changes from git to the perforce depot." self.usage += " [name of git branch to submit into perforce depot]" @@ -934,6 +935,7 @@ class P4Submit(Command, P4UserMap): self.isWindows = (platform.system() == "Windows") self.exportLabels = False self.p4HasMoveCommand = p4_has_move_command() + self.branch = None def check(self): if len(p4CmdList("opened ...")) > 0: @@ -1670,6 +1672,8 @@ class P4Submit(Command, P4UserMap): print "All commits applied!" sync = P4Sync() + if self.branch: + sync.branch = self.branch sync.run([]) rebase = P4Rebase() -- cgit v1.2.1