absorb: print '{rev}:' as a prefix to the hash
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 11 Oct 2018 22:39:11 -0400
changeset 40150 1be1689d9ce9
parent 40149 9b0cdfb3c11e
child 40151 38ac525b44c9
absorb: print '{rev}:' as a prefix to the hash I don't see a sane way to print the summary to identify the changed commit, but this at least makes it a bit easier to identify a commit when a group of them changes.
hgext/absorb.py
tests/test-absorb.t
--- a/hgext/absorb.py	Thu Oct 11 19:02:42 2018 +0200
+++ b/hgext/absorb.py	Thu Oct 11 22:39:11 2018 -0400
@@ -727,9 +727,9 @@
 
     def _ctx2str(self, ctx):
         if self.ui.debugflag:
-            return ctx.hex()
+            return '%d:%s' % (ctx.rev(), ctx.hex())
         else:
-            return node.short(ctx.node())
+            return '%d:%s' % (ctx.rev(), node.short(ctx.node()))
 
     def _getnewfilecontents(self, ctx):
         """(ctx) -> {path: str}
--- a/tests/test-absorb.t	Thu Oct 11 19:02:42 2018 +0200
+++ b/tests/test-absorb.t	Thu Oct 11 22:39:11 2018 -0400
@@ -394,10 +394,10 @@
   30970db -3
   a393a58 -4
   $ hg absorb -v | grep became
-  bfafb49242db: 1 file(s) changed, became 1a2de97fc652
-  115485984805: 2 file(s) changed, became 0c930dfab74c
-  30970dbf7b40: became empty and was dropped
-  a393a58b9a85: became empty and was dropped
+  0:bfafb49242db: 1 file(s) changed, became 4:1a2de97fc652
+  1:115485984805: 2 file(s) changed, became 5:0c930dfab74c
+  2:30970dbf7b40: became empty and was dropped
+  3:a393a58b9a85: became empty and was dropped
   $ hg log -T '{rev} {desc}\n' -Gp
   @  5 b12
   |  diff --git a/b b/b
@@ -444,8 +444,8 @@
   f1c23dd -3
   82dbe7f -4
   $ hg absorb --verbose
-  f1c23dd5d08d: became empty and was dropped
-  82dbe7fd19f0: became empty and was dropped
+  1:f1c23dd5d08d: became empty and was dropped
+  2:82dbe7fd19f0: became empty and was dropped
   a: 1 of 1 chunk(s) applied
   $ hg id
   bfafb49242db tip