aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSimon Hausmann <shausman@trolltech.com>2007-06-12 14:34:46 +0200
committerSimon Hausmann <shausman@trolltech.com>2007-06-12 14:34:46 +0200
commitd7e3868cdfdc73c3de15296ecf32138a8308c07e (patch)
treefdb28b5425e517138e3ab16c3cda85109a1d582e /contrib
parent27d2d8119bf985a0b59152737316f04f871e03f7 (diff)
downloadgit-d7e3868cdfdc73c3de15296ecf32138a8308c07e.tar.gz
git-d7e3868cdfdc73c3de15296ecf32138a8308c07e.tar.xz
Fix git-p4 rebase to detect the correct upstream branch instead of unconditionally
always rebasing on top of remotes/p4/master Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p412
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 1c7db1152..1168704be 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -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