evolve: fix the 'grab' alias to work on Windows stable
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 12 Aug 2014 19:09:53 -0400
branchstable
changeset 1104 cb36a4eb0157
parent 1103 d1ca81f9e458
child 1105 836c4128c027
evolve: fix the 'grab' alias to work on Windows For some reason, the variable wasn't substituted on Windows in this case. From the test suite: $ hg grab 8 '' is not recognized as an internal or external command,\r (esc) operable program or batch file.\r (esc) This change seems hacky, but there isn't a readily available example of setting up a shell alias like this from a python module to know if there is a better way, and it seems like this is maybe just a convenience for tests, since there is no documentation for the aliases. The local copy of run-tests.py appears to predate the Windows support in the Mercurial repository's version, and fails each test with: The system cannot find the path specified. However, with this change and blacklisting test-simple4server.t, the tests can (mostly) be run on Windows like so: $ ../../hg/tests/run-tests.py --with-hg=../../hg/hg --blacklist windows Skipped test-simple4server.t: blacklisted Warned test-obsolete.t: no result code from test Warned test-tutorial.t: no result code from test Warned test-evolve.t: no result code from test Warned test-userguide.t: no result code from test Warned test-sharing.t: no result code from test Warned test-drop.t: no result code from test Failed test-prune.t: output changed # Ran 41 tests, 1 skipped, 6 warned, 1 failed.
README
hgext/evolve.py
tests/test-evolve.t
--- a/README	Sun Aug 24 01:02:18 2014 +0530
+++ b/README	Tue Aug 12 19:09:53 2014 -0400
@@ -63,6 +63,7 @@
 - evolve: add a `working directory now at xxxxxxxxxx` message
 - properly skip marker creating if patch apply cleanly
 - prune: work around a massive slowdown from lazy revset
+- grab: "fix" the grab alias on window
 
 4.1.0 -- 2014-08-08
 
--- a/hgext/evolve.py	Sun Aug 24 01:02:18 2014 +0530
+++ b/hgext/evolve.py	Tue Aug 12 19:09:53 2014 -0400
@@ -22,7 +22,7 @@
 testedwith = '3.0.1 3.1'
 buglink = 'http://bz.selenic.com/'
 
-import sys
+import sys, os
 import random
 from StringIO import StringIO
 import struct
@@ -69,6 +69,7 @@
 from mercurial import localrepo
 from mercurial.hgweb import hgweb_mod
 from mercurial import bundle2
+from mercurial import util
 
 cmdtable = {}
 command = cmdutil.command(cmdtable)
@@ -503,8 +504,13 @@
         ui.setconfig('alias', 'odiff',
             "diff --hidden --rev 'limit(precursors(.),1)' --rev .")
     if ui.config('alias', 'grab', None) is None:
-        ui.setconfig('alias', 'grab',
-            "! $HG rebase --dest . --rev $@ && $HG up tip")
+        if os.name == 'nt':
+            ui.setconfig('alias', 'grab',
+                "! " + util.hgexecutable() + " rebase --dest . --rev  && "
+                 + util.hgexecutable() + " up tip")
+        else:
+            ui.setconfig('alias', 'grab',
+                "! $HG rebase --dest . --rev $@ && $HG up tip")
 
 
 ### Troubled revset symbol
--- a/tests/test-evolve.t	Sun Aug 24 01:02:18 2014 +0530
+++ b/tests/test-evolve.t	Tue Aug 12 19:09:53 2014 -0400
@@ -251,28 +251,28 @@
   |
   | x  5:c296b79833d1@default(draft) temporary amend commit for 568a468b60fc
   | |
-  | | o  4:207cbc4ea7fe@default(draft) another feature
+  | | o  4:6992c59c6b06@default(draft) another feature (child of 568a468b60fc)
   | |/
-  | | x  3:5bb880fc0f12@default(draft) temporary amend commit for 7b36850622b2
+  | | x  3:c97947cdc7a2@default(draft) temporary amend commit for 73296a82292a
   | | |
-  | | x  2:7b36850622b2@default(draft) another feature
+  | | x  2:73296a82292a@default(draft) another feature (child of 568a468b60fc)
   | |/
   | x  1:568a468b60fc@default(draft) a nifty feature
   |/
   @  0:e55e0562ee93@default(public) base
   
   $ hg debugobsolete
-  7b36850622b2fd159fa30a4fb2a1edd2043b4a14 207cbc4ea7fee30d18b3a25f534fe5db22c6071b 0 (*) {'user': 'test'} (glob)
-  5bb880fc0f12dd61eee6de36f62b93fdbc3684b0 0 {7b36850622b2fd159fa30a4fb2a1edd2043b4a14} (*) {'user': 'test'} (glob)
+  73296a82292a76fb8a7061969d2489ec0d84cd5e 6992c59c6b06a1b4a92e24ff884829ae026d018b 0 (*) {'user': 'test'} (glob)
+  c97947cdc7a2a11cf78419f5c2c3dd3944ec79e8 0 {73296a82292a76fb8a7061969d2489ec0d84cd5e} (*) {'user': 'test'} (glob)
   568a468b60fc99a42d5d4ddbe181caff1eef308d ba0ec09b1babf3489b567853807f452edd46704f 0 (*) {'user': 'test'} (glob)
   c296b79833d1d497f33144786174bf35e04e44a3 0 {568a468b60fc99a42d5d4ddbe181caff1eef308d} (*) {'user': 'test'} (glob)
   $ hg evolve
-  move:[4] another feature
+  move:[4] another feature (child of 568a468b60fc)
   atop:[6] a nifty feature
   merging main-file-1
-  working directory is now at abe98aeaaa35
+  working directory is now at 5b410c3ae5af
   $ hg log
-  7	feature-B: another feature - test
+  7	feature-B: another feature (child of 568a468b60fc) - test
   6	feature-A: a nifty feature - test
   0	: base - test
 
@@ -309,14 +309,14 @@
   
   $ hg evolve --any --traceback
   recreate:[8] another feature that rox
-  atop:[7] another feature
+  atop:[7] another feature (child of 568a468b60fc)
   computing new diff
-  committed as ca3b75e3e59b
-  working directory is now at ca3b75e3e59b
+  committed as 8234cfce9af9
+  working directory is now at 8234cfce9af9
   $ hg glog
-  @  9	feature-B: bumped update to abe98aeaaa35: - test
+  @  9	feature-B: bumped update to 5b410c3ae5af: - test
   |
-  o  7	: another feature - test
+  o  7	: another feature (child of 568a468b60fc) - test
   |
   o  6	feature-A: a nifty feature - test
   |
@@ -371,7 +371,7 @@
   move:[11] dansk 3!
   atop:[14] dansk 2!
   merging main-file-1
-  working directory is now at b0e2cfb8dd21
+  working directory is now at e65e652e27bf
   $ hg glog
   @  15	: dansk 3! - test
   |