changeset 27147:804abe8999f3

graft: copy extra (except branch) when copying changesets
author Mike Edgar <adgar@google.com>
date Sat, 28 Nov 2015 04:11:38 -0500
parents 88fde8db5307
children 39163708825c
files mercurial/commands.py tests/test-rebase-obsolete.t
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Nov 28 04:11:14 2015 -0500
+++ b/mercurial/commands.py	Sat Nov 28 04:11:38 2015 -0500
@@ -3831,10 +3831,10 @@
             if opts.get('dry_run'):
                 continue
 
-            source = ctx.extra().get('source')
-            extra = {}
+            extra = ctx.extra().copy()
+            del extra['branch']
+            source = extra.get('source')
             if source:
-                extra['source'] = source
                 extra['intermediate-source'] = ctx.hex()
             else:
                 extra['source'] = ctx.hex()
--- a/tests/test-rebase-obsolete.t	Sat Nov 28 04:11:14 2015 -0500
+++ b/tests/test-rebase-obsolete.t	Sat Nov 28 04:11:38 2015 -0500
@@ -253,9 +253,9 @@
   grafting 11:4596109a6a43 "D"
   $ hg up -qr 'desc(E)'
   $ hg rebase -s tip -d .
-  rebasing 14:9e36056a46e3 "D" (tip)
+  rebasing 14:0f4c66d0b70f "D" (tip)
   $ hg log --style default --debug -r tip
-  changeset:   15:627d4614809036ba22b9e7cb31638ddc06ab99ab
+  changeset:   15:884f358981b4d32069bb539e0e95d49a35eb81d0
   tag:         tip
   phase:       draft
   parent:      4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba
@@ -266,7 +266,7 @@
   files+:      D
   extra:       branch=default
   extra:       intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003
-  extra:       rebase_source=9e36056a46e37c9776168c7375734eebc70e294f
+  extra:       rebase_source=0f4c66d0b70f8e1ce4aec01f8e95cf24ee923afa
   extra:       source=32af7686d403cf45b5d95f2d70cebea587ac806a
   description:
   D