From aa0bf36dcc7abb04d7829f0c9cfff67a73c8a405 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 14 Aug 2012 17:49:55 +0800 Subject: [PATCH] Rebase does the right thing --- lib/git.py | 6 ++---- moodle-rebase.py | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/git.py b/lib/git.py index 403be9e..19e0f23 100644 --- a/lib/git.py +++ b/lib/git.py @@ -132,10 +132,8 @@ class Git(object): cmd = 'push %s%s %s' % (force, remote, branch) return self.execute(cmd) - def rebase(self, branch, onto = ''): - if onto != '': - onto = '--onto %s ' % (onto) - cmd = 'rebase %s%s' % (onto, branch) + def rebase(self, base, branch): + cmd = 'rebase %s %s' % (base, branch) return self.execute(cmd) def remoteBranches(self, remote): diff --git a/moodle-rebase.py b/moodle-rebase.py index 897856b..68fe3d0 100755 --- a/moodle-rebase.py +++ b/moodle-rebase.py @@ -83,10 +83,10 @@ for M in Mlist: # Rebase debug('> Rebasing %s...' % (branch)) - onto = 'origin/%s' % M.get('stablebranch') - result = M.git().rebase(branch, onto=onto) + base = 'origin/%s' % M.get('stablebranch') + result = M.git().rebase(branch=branch, base=base) if result[0] != 0: - debug('Error while rebasing branch %s onto %s' % (branch, onto)) + debug('Error while rebasing branch %s on top of %s' % (branch, base)) debug(result[2]) continue -- 2.11.0