diff mercurial/cmdutil.py @ 16630:f30226b1a46a stable

amend: preserve extra dict (issue3430)
author Idan Kamara <idankk86@gmail.com>
date Fri, 11 May 2012 18:33:45 +0300
parents 9224cc2e99cc
children 5cf18921bb7b 48b1674ac1e7
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri May 11 02:32:26 2012 -0700
+++ b/mercurial/cmdutil.py	Fri May 11 18:33:45 2012 +0300
@@ -1311,6 +1311,12 @@
         #          |
         # base     o - parent of amending changeset
 
+        # Update extra dict from amended commit (e.g. to preserve graft source)
+        extra.update(old.extra())
+
+        # Also update it from the intermediate commit or from the wctx
+        extra.update(ctx.extra())
+
         files = set(old.files())
 
         # Second, we use either the commit we just did, or if there were no
@@ -1322,7 +1328,6 @@
             user = ctx.user()
             date = ctx.date()
             message = ctx.description()
-            extra = ctx.extra()
             # Recompute copies (avoid recording a -> b -> a)
             copied = copies.pathcopies(base, ctx)