prev: show changeset hash in --dry-run instead of rev numbers
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 16 Mar 2018 13:24:57 +0530
changeset 3552 7e8b2c9edf36
parent 3551 ce346c6165c6
child 3553 6d03ec17c025
prev: show changeset hash in --dry-run instead of rev numbers rev numbers can change, so it's better to show changeset hash.
hgext3rd/evolve/__init__.py
tests/test-prev-next.t
--- a/hgext3rd/evolve/__init__.py	Fri Mar 16 13:13:21 2018 +0530
+++ b/hgext3rd/evolve/__init__.py	Fri Mar 16 13:24:57 2018 +0530
@@ -960,10 +960,10 @@
 
 def _prevupdate(repo, displayer, target, bookmark, dryrun):
     if dryrun:
-        repo.ui.write(('hg update %s;\n' % target.rev()))
+        repo.ui.write(('hg update %s;\n' % target))
         if bookmark is not None:
             repo.ui.write(('hg bookmark %s -r %s;\n'
-                           % (bookmark, target.rev())))
+                           % (bookmark, target)))
     else:
         ret = hg.update(repo, target.rev())
         if not ret:
--- a/tests/test-prev-next.t	Fri Mar 16 13:13:21 2018 +0530
+++ b/tests/test-prev-next.t	Fri Mar 16 13:24:57 2018 +0530
@@ -48,7 +48,7 @@
 
 hg prev should unset active bookmark
   $ hg prev --dry-run
-  hg update 0;
+  hg update a154386e50d1;
   [0] added a
   $ hg prev
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -174,7 +174,7 @@
   no children
   [1]
   $ hg prev --dry-run --color=debug
-  hg update 1;
+  hg update 6e742c9127b3;
   [[evolve.rev|1]] added b
   $ hg prev
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved