Mercurial > hg
annotate tests/test-manifest.out @ 11988:8380ed691df8
util: add an interpolate() function to for replacing multiple values
util.interpolate can be used to replace multiple items in a string all at once
(and optionally apply a function to the replacement), without worrying about
recursing:
>>> import util
>>> s = '$foo, $spam'
>>> util.interpolate(r'\$', { 'foo': 'bar', 'spam': 'eggs' }, s)
'bar, eggs'
>>> util.interpolate(r'\$', { 'foo': 'spam', 'spam': 'foo' }, s)
'spam, foo'
>>> util.interpolate(r'\$', { 'foo': 'spam', 'spam': 'foo' }, s, lambda s: s.upper())
'SPAM, FOO'
The patch also changes filemerge.py to use this new function.
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Wed, 18 Aug 2010 18:18:26 -0400 |
parents | 7239e06e58e9 |
children |
rev | line source |
---|---|
6737
7239e06e58e9
context: consistently return p1 context for None
Matt Mackall <mpm@selenic.com>
parents:
5406
diff
changeset
|
1 % should be empty |
7239e06e58e9
context: consistently return p1 context for None
Matt Mackall <mpm@selenic.com>
parents:
5406
diff
changeset
|
2 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
5155
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
3 a |
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
4 b/a |
5406
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
5 l |
5405
8feb33c2d153
Display symlink or executable bit with manifest -v
Patrick Mezard <pmezard@gmail.com>
parents:
5155
diff
changeset
|
6 644 a |
5406
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
7 755 * b/a |
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
8 644 @ l |
5405
8feb33c2d153
Display symlink or executable bit with manifest -v
Patrick Mezard <pmezard@gmail.com>
parents:
5155
diff
changeset
|
9 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a |
5406
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
10 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a |
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
11 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l |
5155
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 a |
5406
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
13 l |
5155
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
14 a |
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
15 b/a |
5406
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
16 l |
5155
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 a |
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 b/a |
5406
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
19 l |
5155
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
20 % should fail |
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
21 abort: unknown revision '2'! |
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
22 abort: please specify just one revision |
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
23 a |
13d23d66a6cd
manifest: accept -r for rev specification
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
24 b/a |
5406
f11554a097c8
test-manifest: test symlink and exec bit display
Patrick Mezard <pmezard@gmail.com>
parents:
5405
diff
changeset
|
25 l |