Mercurial > hg
annotate tests/test-pull-permission.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 |
---|---|
1244
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
1 requesting all changes |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
2 adding changesets |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
3 adding manifests |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
4 adding file changes |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
5 added 1 changesets with 1 changes to 1 files |
9611
a3d73b3e1f8a
hg.clone: report branch name on update
Adrian Buehlmann <adrian@cadifra.com>
parents:
6338
diff
changeset
|
6 updating to branch default |
2175
b2ae81a7df29
Make hg update more verbose by default (issue12)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2152
diff
changeset
|
7 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
1244
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
8 checking changesets |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
9 checking manifests |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
10 crosschecking files in changesets and manifests |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
11 checking files |
937ee88da3ef
clone: fall back to pull if we can't lock the source repo
mpm@selenic.com
parents:
diff
changeset
|
12 1 files, 1 changesets, 1 total revisions |