提交 d7e3868c 编写于 作者: S Simon Hausmann

Fix git-p4 rebase to detect the correct upstream branch instead of unconditionally

always rebasing on top of remotes/p4/master
Signed-off-by: NSimon Hausmann <shausman@trolltech.com>
上级 27d2d811
......@@ -1361,9 +1361,17 @@ class P4Rebase(Command):
def run(self, args):
sync = P4Sync()
sync.run([])
print "Rebasing the current branch"
[upstream, settings] = findUpstreamBranchPoint()
if len(upstream) == 0:
die("Cannot find upstream branchpoint for rebase")
# the branchpoint may be p4/foo~3, so strip off the parent
upstream = re.sub("~[0-9]+$", "", upstream)
print "Rebasing the current branch onto %s" % upstream
oldHead = read_pipe("git rev-parse HEAD").strip()
system("git rebase p4")
system("git rebase %s" % upstream)
system("git diff-tree --stat --summary -M %s HEAD" % oldHead)
return True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册