diff mercurial/commands.py @ 24644:51930a7180bd

graft: record intermediate grafts in extras Previously the extra field for a graft only contained the original commit hash. This made it impossible to use graft to copy a commit more than once, because the extras fields did not change after the second graft. The fix is to add an extra.intermediate-source field that records the immediate predecessor to graft. This changes hashes for commits that have been grafted twice, which is why the test was affected.
author Durham Goode <durham@fb.com>
date Sun, 05 Apr 2015 12:12:02 -0700
parents 944749de6f3a
children bf13b44bbb0a
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Apr 05 11:55:38 2015 -0700
+++ b/mercurial/commands.py	Sun Apr 05 12:12:02 2015 -0700
@@ -3547,9 +3547,12 @@
                 continue
 
             source = ctx.extra().get('source')
-            if not source:
-                source = ctx.hex()
-            extra = {'source': source}
+            extra = {}
+            if source:
+                extra['source'] = source
+                extra['intermediate-source'] = ctx.hex()
+            else:
+                extra['source'] = ctx.hex()
             user = ctx.user()
             if opts.get('user'):
                 user = opts['user']