Patchwork [2,of,3,RFC] graft: copy extra (except branch) when copying changesets

login
register
mail settings
Submitter adgar@google.com
Date Nov. 28, 2015, 9:14 a.m.
Message ID <61b51342ac74bc0239a8.1448702065@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/11678/
State Accepted
Headers show

Comments

adgar@google.com - Nov. 28, 2015, 9:14 a.m.
# HG changeset patch
# User Mike Edgar <adgar@google.com>
# Date 1448701898 18000
#      Sat Nov 28 04:11:38 2015 -0500
# Node ID 61b51342ac74bc0239a8aa4592ee8df1f70f91c0
# Parent  d9abc7e0d227e12dd68044a7ee9985e2081d8cf3
graft: copy extra (except branch) when copying changesets

Patch

diff -r d9abc7e0d227 -r 61b51342ac74 mercurial/commands.py
--- a/mercurial/commands.py	Sat Nov 28 04:11:14 2015 -0500
+++ b/mercurial/commands.py	Sat Nov 28 04:11:38 2015 -0500
@@ -3753,10 +3753,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()
diff -r d9abc7e0d227 -r 61b51342ac74 tests/test-rebase-obsolete.t
--- 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