amend: include "operation" metadata in obsmarkers
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 12 Mar 2018 15:50:25 -0700
changeset 3561 4701e8888c4f
parent 3560 f61a23a84dac
child 3562 fe16284cd95a
amend: include "operation" metadata in obsmarkers This is for the legacy handling support for "hg commit --amend" case. I picked "amend" because it feels more natural than "commit". Besides, and more importantly, that's consistent what core uses.
hgext3rd/evolve/__init__.py
tests/test-evolve.t
--- a/hgext3rd/evolve/__init__.py	Fri Mar 16 10:22:27 2018 -0700
+++ b/hgext3rd/evolve/__init__.py	Mon Mar 12 15:50:25 2018 -0700
@@ -1225,7 +1225,7 @@
                 oldbookmarks.extend(repo.nodebookmarks(old.node()))
                 markers.append((old, (new,)))
             if markers:
-                compat.createmarkers(repo, markers)
+                compat.createmarkers(repo, markers, operation="amend")
             bmchanges = []
             for book in oldbookmarks:
                 bmchanges.append((book, new.node()))
--- a/tests/test-evolve.t	Fri Mar 16 10:22:27 2018 -0700
+++ b/tests/test-evolve.t	Mon Mar 12 15:50:25 2018 -0700
@@ -616,8 +616,8 @@
   o  0:8685c6d34325@default(draft) add 0
   
   $ hg debugobsolete
-  0e84df4912da4c7cad22a3b4fcfd58ddfb7c8ae9 0b9e50c35132ff548ec0065caea6a87e1ebcef32 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'user': 'test'}
-  db038628b9e56f51a454c0da0c508df247b41748 acb28cd497b7f8767e01ef70f68697a959573c2d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'user': 'test'}
+  0e84df4912da4c7cad22a3b4fcfd58ddfb7c8ae9 0b9e50c35132ff548ec0065caea6a87e1ebcef32 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'amend', 'user': 'test'}
+  db038628b9e56f51a454c0da0c508df247b41748 acb28cd497b7f8767e01ef70f68697a959573c2d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'amend', 'user': 'test'}
 
 Test graft --continue
 
@@ -661,9 +661,9 @@
   o  0:8685c6d34325@default(draft) add 0
   
   $ hg debugobsolete
-  0e84df4912da4c7cad22a3b4fcfd58ddfb7c8ae9 0b9e50c35132ff548ec0065caea6a87e1ebcef32 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'user': 'test'}
-  db038628b9e56f51a454c0da0c508df247b41748 acb28cd497b7f8767e01ef70f68697a959573c2d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'user': 'test'}
-  a5bfd90a2f29c7ccb8f917ff4e5013a9053d0a04 920e58bb443b73eea9d6d65570b4241051ea3229 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'user': 'test'}
+  0e84df4912da4c7cad22a3b4fcfd58ddfb7c8ae9 0b9e50c35132ff548ec0065caea6a87e1ebcef32 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'amend', 'user': 'test'}
+  db038628b9e56f51a454c0da0c508df247b41748 acb28cd497b7f8767e01ef70f68697a959573c2d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'amend', 'user': 'test'}
+  a5bfd90a2f29c7ccb8f917ff4e5013a9053d0a04 920e58bb443b73eea9d6d65570b4241051ea3229 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'amend', 'user': 'test'}
 
 Test touch
 
@@ -786,13 +786,14 @@
       more than 2 successors:         0
       available  keys:
                   ef1:               10
+            operation:                3
                  user:               10
   marker size:
       format v1:
           smallest length:           75
-          longer length:             76
+          longer length:             92
           median length:             76
-          mean length:               75
+          mean length:               80
       format v0:
           smallest length:           * (glob)
           longer length:             * (glob)