Mercurial > hg
annotate tests/test-convert-darcs.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 | 4481f8a93c7a |
rev | line source |
---|---|
5413 | 1 % initialize darcs repo |
2 Finished recording patch 'p0' | |
3 % branch and update | |
4 Finished recording patch 'p1.1' | |
5 % update source | |
6 Finished recording patch 'p1.2' | |
7 % merge branch | |
9326
b236f34ec1e9
Fix failing darcs test
Bryan O'Sullivan <bos@serpentine.com>
parents:
5667
diff
changeset
|
8 Backing up ./a(-darcs-backup0) |
5413 | 9 We have conflicts in the following files: |
10 ./a | |
11 Finished pulling and applying. | |
12 Finished recording patch 'p2' | |
9526
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
13 % test file and directory move |
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
14 Finished recording patch 'p3' |
5413 | 15 initializing destination darcs-repo-hg repository |
16 scanning source... | |
17 sorting... | |
18 converting... | |
9526
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
19 4 p0 |
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
20 3 p1.2 |
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
21 2 p1.1 |
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
22 1 p2 |
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
23 0 p3 |
9527
b3c13e721593
convert/darcs: handle directory renaming
Patrick Mezard <pmezard@gmail.com>
parents:
9526
diff
changeset
|
24 o 4 "p3" files: dir/d dir/d2 dir2/d f ff |
9526
457a30ed8ffb
convert/darcs: fix file renaming (issue1853)
Patrick Mezard <pmezard@gmail.com>
parents:
9326
diff
changeset
|
25 | |
9527
b3c13e721593
convert/darcs: handle directory renaming
Patrick Mezard <pmezard@gmail.com>
parents:
9526
diff
changeset
|
26 o 3 "p2" files: a dir/d dir/d2 f |
5413 | 27 | |
28 o 2 "p1.1" files: | |
29 | | |
30 o 1 "p1.2" files: a b | |
31 | | |
32 o 0 "p0" files: a | |
33 | |
34 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a | |
35 1e88685f5ddec574a34c70af492f95b6debc8741 644 b | |
10490
f2618cacb485
filelog: sort meta entries, ensure deterministic order
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
9527
diff
changeset
|
36 37406831adc447ec2385014019599dfec953c806 644 dir2/d |
f2618cacb485
filelog: sort meta entries, ensure deterministic order
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
9527
diff
changeset
|
37 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff |