Mercurial > hg
annotate tests/test-simple-update.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 | a3d73b3e1f8a |
children |
rev | line source |
---|---|
767
61ed30e82b27
Update tests to match new addremove chattiness.
Bryan O'Sullivan <bos@serpentine.com>
parents:
749
diff
changeset
|
1 adding foo |
331 | 2 checking changesets |
3 checking manifests | |
4 crosschecking files in changesets and manifests | |
5 checking files | |
6 1 files, 1 changesets, 1 total revisions | |
9611
a3d73b3e1f8a
hg.clone: report branch name on update
Adrian Buehlmann <adrian@cadifra.com>
parents:
6338
diff
changeset
|
7 updating to branch default |
2175
b2ae81a7df29
Make hg update more verbose by default (issue12)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2152
diff
changeset
|
8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
b2ae81a7df29
Make hg update more verbose by default (issue12)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2152
diff
changeset
|
9 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
404 | 10 pulling from ../branch |
331 | 11 searching for changes |
12 adding changesets | |
13 adding manifests | |
775 | 14 adding file changes |
15 added 1 changesets with 1 changes to 1 files | |
404 | 16 (run 'hg update' to get a working copy) |
331 | 17 checking changesets |
18 checking manifests | |
19 crosschecking files in changesets and manifests | |
20 checking files | |
21 1 files, 2 changesets, 2 total revisions | |
2175
b2ae81a7df29
Make hg update more verbose by default (issue12)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2152
diff
changeset
|
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
331 | 23 foo |
24 bar | |
5405
8feb33c2d153
Display symlink or executable bit with manifest -v
Patrick Mezard <pmezard@gmail.com>
parents:
2955
diff
changeset
|
25 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo |