next: show changeset hash in `--dry-run` instead of rev numbers
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 16 Mar 2018 11:31:13 +0530
changeset 3546 d197e6f0d0e3
parent 3545 6aff754c2457
child 3547 78abffad8626
next: show changeset hash in `--dry-run` instead of rev numbers Rev numbers can change, hence we should show rev hash instead of rev numbers in dry-run.
hgext3rd/evolve/__init__.py
tests/test-prev-next.t
--- a/hgext3rd/evolve/__init__.py	Sun Mar 18 01:27:02 2018 +0530
+++ b/hgext3rd/evolve/__init__.py	Fri Mar 16 11:31:13 2018 +0530
@@ -1160,11 +1160,11 @@
     bm = repo._activebookmark
     shouldmove = opts.get('move_bookmark') and bm is not None
     if opts.get('dry_run'):
-        ui.write(('hg update %s;\n' % children.rev()))
+        ui.write(('hg update %s;\n' % children))
         if shouldmove:
-            ui.write(('hg bookmark %s -r %s;\n' % (bm, children.rev())))
+            ui.write(('hg bookmark %s -r %s;\n' % (bm, children)))
     else:
-        ret = hg.update(repo, children.rev())
+        ret = hg.update(repo, children)
         if not ret:
             lock = tr = None
             try:
--- a/tests/test-prev-next.t	Sun Mar 18 01:27:02 2018 +0530
+++ b/tests/test-prev-next.t	Fri Mar 16 11:31:13 2018 +0530
@@ -35,8 +35,8 @@
 
 hg next -B should move active bookmark
   $ hg next -B --dry-run
-  hg update 1;
-  hg bookmark mark -r 1;
+  hg update 6e742c9127b3;
+  hg bookmark mark -r 6e742c9127b3;
   [1] added b
   $ hg next -B
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -60,7 +60,7 @@
      mark                      1:6e742c9127b3
    * mark2                     0:a154386e50d1
   $ hg next --dry-run --color=debug
-  hg update 1;
+  hg update 6e742c9127b3;
   [[evolve.rev|1]] added b
   $ hg next
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved