Mercurial > hg
annotate tests/test-issue1175.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 | f2618cacb485 |
children |
rev | line source |
---|---|
6875 | 1 adding a |
2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
3 warning: detected divergent renames of a to: | |
4 a2 | |
5 a1 | |
6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
7 adding a | |
8 b | |
9 b: searching for copy revision for a | |
10 b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db | |
10490
f2618cacb485
filelog: sort meta entries, ensure deterministic order
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
6935
diff
changeset
|
11 committed changeset 5:89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b |
6875 | 12 checking changesets |
13 checking manifests | |
14 crosschecking files in changesets and manifests | |
15 checking files | |
16 4 files, 6 changesets, 4 total revisions | |
17 # HG changeset patch | |
18 # User test | |
19 # Date 0 0 | |
10490
f2618cacb485
filelog: sort meta entries, ensure deterministic order
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
6935
diff
changeset
|
20 # Node ID 89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b |
f2618cacb485
filelog: sort meta entries, ensure deterministic order
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
6935
diff
changeset
|
21 # Parent 7fc86ba705e717a721dbc361bf8c9bc05a18ca2f |
6875 | 22 5 |
23 | |
24 diff --git a/b b/b | |
25 new file mode 100644 |