annotate tests/filtertmp.py @ 11524:24965bb270b7

dispatch: add shell aliases This patch adds git-style "shell aliases" to Mercurial. Any alias with a definition beginning with a '!' will be treated as a shell alias. For example: [alias] echo = !echo qempty = !hg qrefresh -X "`hg root`" ; echo Emptied patch "`hg qtop`" $ hg echo foo foo $ hg qempty Emptied patch foo $
author Steve Losh <steve@stevelosh.com>
date Wed, 07 Jul 2010 18:49:43 -0400
parents b26c4a89a143
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10468
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2 #
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 # This used to be a simple sed call like:
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4 #
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5 # $ sed "s:$HGTMP:*HGTMP*:"
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 #
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 # But $HGTMP has ':' under Windows which breaks the sed call.
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 #
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 import sys, os
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 input = sys.stdin.read()
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 input = input.replace(os.sep, '/')
10469
b26c4a89a143 Fix test-push-validation under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 10468
diff changeset
13 hgtmp = os.environ['HGTMP'].replace(os.sep, '/')
b26c4a89a143 Fix test-push-validation under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 10468
diff changeset
14 input = input.replace(hgtmp, '$HGTMP')
10468
2250fc372d34 Fix test-share and test-subrepo under Windows
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 sys.stdout.write(input)