changeset 1195:bac4e0bc9f6a stable

evolve: write a status message when the working directory changes Evolve changes the working directory during atop, etc which can confuse people as they are not aware that this happend. The ideal solution is to not have evolve change it, however mercurial limitations don't allow us to do that at the moment. So instead we are printing a status message that the working directory changed.
author David Soria Parra <davidsp@fb.com>
date Fri, 29 Aug 2014 14:26:17 +0200
parents 1527ec81337e
children 79ee85bd899b
files README hgext/evolve.py tests/test-evolve.t tests/test-sharing.t tests/test-stabilize-conflict.t tests/test-stabilize-order.t tests/test-stabilize-result.t tests/test-tutorial.t tests/test-userguide.t
diffstat 9 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/README
+++ b/README
@@ -60,6 +60,7 @@
 4.2.0 --
 
 - uncommit: add a --rev argument
+- evolve: add a `working directory now at xxxxxxxxxx` message
 
 4.1.1 --
 
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1239,6 +1239,8 @@
     confirmopt = opts['confirm']
     ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'evolve')
 
+    startnode = repo['.']
+
     if contopt:
         if anyopt:
             raise util.Abort('cannot specify both "--any" and "--continue"')
@@ -1282,7 +1284,10 @@
                     print 'hg update %s' % ctx.rev()
                     return 0
                 else:
-                    return hg.update(repo, ctx.rev())
+                    res = hg.update(repo, ctx.rev())
+                    if ctx != startnode:
+                        ui.status(_('working directory is now at %s\n') % ctx)
+                    return res
 
         troubled = repo.revs('troubled()')
         if troubled:
@@ -1315,6 +1320,8 @@
         progresscb()
         seen += 1
         if not allopt:
+            if repo['.'] != startnode:
+                ui.status(_('working directory is now at %s\n') % repo['.'])
             return result
         progresscb()
         tro = _picknexttroubled(ui, repo, anyopt or allopt)
@@ -1322,6 +1329,9 @@
     if allopt:
         ui.progress('evolve', None)
 
+    if repo['.'] != startnode:
+        ui.status(_('working directory is now at %s\n') % repo['.'])
+
 
 def _evolveany(ui, repo, tro, dryrunopt, confirmopt, progresscb):
     repo = repo.unfiltered()
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -270,6 +270,7 @@
   move:[4] another feature
   atop:[6] a nifty feature
   merging main-file-1
+  working directory is now at abe98aeaaa35
   $ hg log
   7	feature-B: another feature - test
   6	feature-A: a nifty feature - test
@@ -311,6 +312,7 @@
   atop:[7] another feature
   computing new diff
   committed as ca3b75e3e59b
+  working directory is now at ca3b75e3e59b
   $ hg glog
   @  9	feature-B: bumped update to abe98aeaaa35: - test
   |
@@ -369,6 +371,7 @@
   move:[11] dansk 3!
   atop:[14] dansk 2!
   merging main-file-1
+  working directory is now at b0e2cfb8dd21
   $ hg glog
   @  15	: dansk 3! - test
   |
@@ -731,6 +734,7 @@
   $ hg stab --any
   move:[15] c
   atop:[13] a
+  working directory is now at 3742bde73477
   $ hg st -C --change=tip
   A c
     a
--- a/tests/test-sharing.t
+++ b/tests/test-sharing.t
@@ -203,6 +203,7 @@
   atop:[2] fix bug 15
   computing new diff
   committed as 227d860d9ad0
+  working directory is now at 227d860d9ad0
 
 Figure SG08
   $ hg --hidden shortlog -G
--- a/tests/test-stabilize-conflict.t
+++ b/tests/test-stabilize-conflict.t
@@ -81,6 +81,7 @@
   move:[2] babar count up to fifteen
   atop:[4] babar count up to ten
   merging babar
+  working directory is now at 71c18f70c34f
   $ hg resolve -l
   $ hg log -G
   @  changeset:   5:71c18f70c34f
--- a/tests/test-stabilize-order.t
+++ b/tests/test-stabilize-order.t
@@ -71,6 +71,7 @@
   resolving manifests
   getting b
   b
+  working directory is now at bede829dd2d3
   $ glog
   @  8:bede829dd2d3@default(draft) addb
   |
@@ -99,6 +100,7 @@
   resolving manifests
   getting c
   c
+  working directory is now at 65095d7d0dd5
   $ hg debugobsolete > successors.new
   $ diff -u successors.old successors.new
   --- successors.old* (glob)
@@ -159,6 +161,7 @@
   resolving manifests
   getting c
   c
+  working directory is now at e99ecf51c867
   $ glog
   @  12:e99ecf51c867@default(draft) addc
   |
--- a/tests/test-stabilize-result.t
+++ b/tests/test-stabilize-result.t
@@ -165,6 +165,7 @@
   rebasing to destination parent: 66719795a494
   computing new diff
   committed as (a7cabd7bd9c2|671b9d7eeaec) (re)
+  working directory is now at (a7cabd7bd9c2|671b9d7eeaec) (re)
   $ glog
   @  14:(a7cabd7bd9c2|671b9d7eeaec)@default\(draft\) bk:\[\] bumped update to 1cf0aacfd363: (re)
   |
@@ -258,6 +259,7 @@
   copying changeset 283ccd10e2b8 to 7bc2f5967f5e
   a
   committed changeset 21:f344982e63c4
+  working directory is now at f344982e63c4
   $ hg st
   $ glog
   @  21:f344982e63c4@default(draft) bk:[] More addition
--- a/tests/test-tutorial.t
+++ b/tests/test-tutorial.t
@@ -702,6 +702,7 @@
   move:[15] animals
   atop:[14] bathroom stuff
   merging shopping
+  working directory is now at ee942144f952
 
 The old version of bathroom is hidden again.
 
@@ -752,6 +753,7 @@
   $ hg evolve
   update:[8] animals
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory is now at ee942144f952
 
 Relocating unstable change after prune
 ----------------------------------------------
@@ -829,6 +831,7 @@
   move:[17] SPAM SPAM SPAM
   atop:[14] bathroom stuff
   merging shopping
+  working directory is now at 40aa40daeefb
 
   $ hg log -G
   @  40aa40daeefb (draft): SPAM SPAM SPAM
--- a/tests/test-userguide.t
+++ b/tests/test-userguide.t
@@ -253,6 +253,7 @@
   $ hg evolve --all
   move:[23] fix bug 67
   atop:[24] fix bug 53
+  working directory is now at 0d972d6888e6
   $ hg --hidden shortlog -G -r 21::
   @  25:0d972d6888e6  draft  fix bug 67
   |
@@ -301,6 +302,7 @@
   $ hg evolve --all
   move:[27] new feature
   atop:[28] fix a bug
+  working directory is now at 166c1c368ab6
   $ hg --hidden shortlog -G -r 25::
   @  30:166c1c368ab6  draft  new feature
   |