Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fix git-p4 rebase to detect the correct upstream branch instead of unconditionally
author
Simon Hausmann
<shausman@trolltech.com>
Tue, 12 Jun 2007 12:34:46 +0000
(14:34 +0200)
committer
Simon Hausmann
<shausman@trolltech.com>
Tue, 12 Jun 2007 12:34:46 +0000
(14:34 +0200)
always rebasing on top of remotes/p4/master
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
contrib/fast-import/git-p4
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
27d2d81
)
diff --git
a/contrib/fast-import/git-p4
b/contrib/fast-import/git-p4
index 1c7db11529037091b324c65f24dcbf3dd7e05b5d..1168704be44a8bc5a7184dba6a5d8242056bdefc 100755
(executable)
--- 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([])
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()
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
system("git diff-tree --stat --summary -M %s HEAD" % oldHead)
return True