diff options
author | Simon Hausmann <hausmann@kde.org> | 2007-03-29 19:15:24 +0200 |
---|---|---|
committer | Simon Hausmann <hausmann@kde.org> | 2007-03-29 19:15:24 +0200 |
commit | c9b50e6307aa9931e18b6cd4d00de817b8e4a4c2 (patch) | |
tree | d657d0f74126d3df44fe1c612f0c2dbebdc69fe0 /contrib/fast-import/git-p4 | |
parent | Fix variable usage in tag import (diff) | |
download | tgif-c9b50e6307aa9931e18b6cd4d00de817b8e4a4c2.tar.xz |
Fix the docs for git-p4 submit and turn git-p4 submit --master=foo into
simply git-p4 submit mytopicbranch.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Diffstat (limited to 'contrib/fast-import/git-p4')
-rwxr-xr-x | contrib/fast-import/git-p4 | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 60c4b3dc6c..59c3edae19 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -167,13 +167,13 @@ class P4Sync(Command): optparse.make_option("--continue", action="store_false", dest="firstTime"), optparse.make_option("--origin", dest="origin"), optparse.make_option("--reset", action="store_true", dest="reset"), - optparse.make_option("--master", dest="master"), optparse.make_option("--log-substitutions", dest="substFile"), optparse.make_option("--noninteractive", action="store_false"), optparse.make_option("--dry-run", action="store_true"), optparse.make_option("--apply-as-patch", action="store_true", dest="applyAsPatch") ] self.description = "Submit changes from git to the perforce depot." + self.usage += " [name of git branch to submit into perforce depot]" self.firstTime = True self.reset = False self.interactive = True @@ -181,7 +181,6 @@ class P4Sync(Command): self.substFile = "" self.firstTime = True self.origin = "" - self.master = "" self.applyAsPatch = True self.logSubstitutions = {} @@ -326,6 +325,16 @@ class P4Sync(Command): # make gitdir absolute so we can cd out into the perforce checkout gitdir = os.path.abspath(gitdir) os.environ["GIT_DIR"] = gitdir + + if len(args) == 0: + self.master = currentGitBranch() + if len(self.master) == 0 or not os.path.exists("%s/refs/heads/%s" % (gitdir, self.master)): + die("Detecting current git branch failed!") + elif len(args) == 1: + self.master = args[0] + else: + return False + depotPath = "" if gitBranchExists("p4"): [depotPath, dummy] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit("p4")) @@ -362,11 +371,6 @@ class P4Sync(Command): tokens = line[:-1].split("=") self.logSubstitutions[tokens[0]] = tokens[1] - if len(self.master) == 0: - self.master = currentGitBranch() - if len(self.master) == 0 or not os.path.exists("%s/refs/heads/%s" % (gitdir, self.master)): - die("Detecting current git branch failed!") - self.check() self.configFile = gitdir + "/p4-git-sync.cfg" self.config = shelve.open(self.configFile, writeback=True) |