changeset 24870:4ec40a4db64a stable

rebase: don't forward "source" argument to rebase (issue4633) `hg pull` takes an optional "source" argument to define the path/url to pull from. Under some circumstances, this option could get proxied to rebase and interpretted as the --source argument to rebase, leading to unexpected behavior. In my local environment, "source" always appears in "opts" in pullrebase. However, when attempting to write a test, I couldn't reproduce this. Instead, the source is being captured as a positional argument in "args." I suspect an interaction between **kwargs and an extension is to blame for the differences in behavior. This is why no test has been written. I have tested behavior locally and the patch has the intended side-effect of making `hg pull --rebase` work again.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 28 Apr 2015 10:19:46 -0700
parents 95a67d687903
children 117b9a101f71
files hgext/rebase.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Tue Apr 28 23:27:18 2015 +0900
+++ b/hgext/rebase.py	Tue Apr 28 10:19:46 2015 -0700
@@ -1040,6 +1040,10 @@
             # dropping it
             if 'rev' in opts:
                 del opts['rev']
+            # positional argument from pull conflicts with rebase's own
+            # --source.
+            if 'source' in opts:
+                del opts['source']
             rebase(ui, repo, **opts)
             branch = repo[None].branch()
             dest = repo[branch].rev()