Mercurial > evolve
comparison hgext/evolve.py @ 1104:cb36a4eb0157 stable
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.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 12 Aug 2014 19:09:53 -0400 |
parents | 8cac667a0d7d |
children | 6b0cf1b73693 |
comparison
equal
deleted
inserted
replaced
1103:d1ca81f9e458 | 1104:cb36a4eb0157 |
---|---|
20 ''' | 20 ''' |
21 | 21 |
22 testedwith = '3.0.1 3.1' | 22 testedwith = '3.0.1 3.1' |
23 buglink = 'http://bz.selenic.com/' | 23 buglink = 'http://bz.selenic.com/' |
24 | 24 |
25 import sys | 25 import sys, os |
26 import random | 26 import random |
27 from StringIO import StringIO | 27 from StringIO import StringIO |
28 import struct | 28 import struct |
29 import urllib | 29 import urllib |
30 | 30 |
67 from mercurial.node import nullid | 67 from mercurial.node import nullid |
68 from mercurial import wireproto | 68 from mercurial import wireproto |
69 from mercurial import localrepo | 69 from mercurial import localrepo |
70 from mercurial.hgweb import hgweb_mod | 70 from mercurial.hgweb import hgweb_mod |
71 from mercurial import bundle2 | 71 from mercurial import bundle2 |
72 from mercurial import util | |
72 | 73 |
73 cmdtable = {} | 74 cmdtable = {} |
74 command = cmdutil.command(cmdtable) | 75 command = cmdutil.command(cmdtable) |
75 | 76 |
76 _pack = struct.pack | 77 _pack = struct.pack |
501 ui.setconfig('alias', 'olog', "log -r 'precursors(.)' --hidden") | 502 ui.setconfig('alias', 'olog', "log -r 'precursors(.)' --hidden") |
502 if ui.config('alias', 'odiff', None) is None: | 503 if ui.config('alias', 'odiff', None) is None: |
503 ui.setconfig('alias', 'odiff', | 504 ui.setconfig('alias', 'odiff', |
504 "diff --hidden --rev 'limit(precursors(.),1)' --rev .") | 505 "diff --hidden --rev 'limit(precursors(.),1)' --rev .") |
505 if ui.config('alias', 'grab', None) is None: | 506 if ui.config('alias', 'grab', None) is None: |
506 ui.setconfig('alias', 'grab', | 507 if os.name == 'nt': |
507 "! $HG rebase --dest . --rev $@ && $HG up tip") | 508 ui.setconfig('alias', 'grab', |
509 "! " + util.hgexecutable() + " rebase --dest . --rev && " | |
510 + util.hgexecutable() + " up tip") | |
511 else: | |
512 ui.setconfig('alias', 'grab', | |
513 "! $HG rebase --dest . --rev $@ && $HG up tip") | |
508 | 514 |
509 | 515 |
510 ### Troubled revset symbol | 516 ### Troubled revset symbol |
511 | 517 |
512 @eh.revset('troubled') | 518 @eh.revset('troubled') |