diff hgext/rebase.py @ 7786:92455c1d6f83

rebase: pull --rebase updates if there is nothing to rebase
author Stefano Tortarolo <stefano.tortarolo@gmail.com>
date Sun, 18 Jan 2009 19:59:51 +0100
parents e3f8c6d6b72e
children 553aa0cbeab6 aee8455ee8ec
line wrap: on
line diff
--- a/hgext/rebase.py	Tue Feb 10 22:47:38 2009 +0100
+++ b/hgext/rebase.py	Sun Jan 18 19:59:51 2009 +0100
@@ -400,7 +400,9 @@
     'Call rebase after pull if the latter has been invoked with --rebase'
     if opts.get('rebase'):
         if opts.get('update'):
-            raise util.Abort(_('--update and --rebase are not compatible'))
+            del opts.get['update']
+            ui.debug(_('--update and --rebase are not compatible, ignoring '
+                                        'the update flag\n'))
 
         cmdutil.bail_if_changed(repo)
         revsprepull = len(repo)
@@ -408,6 +410,11 @@
         revspostpull = len(repo)
         if revspostpull > revsprepull:
             rebase(ui, repo, **opts)
+            branch = repo[None].branch()
+            dest = repo[branch].rev()
+            if dest != repo['.'].rev():
+                # there was nothing to rebase we force an update
+                merge.update(repo, dest, False, False, False)
     else:
         orig(ui, repo, *args, **opts)