annotate tests/test-rebase-newancestor @ 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 2313dc4d9817
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9815
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
1 #!/bin/sh
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
2
11208
2313dc4d9817 tests: fix bashism to load helpers.sh
Yuya Nishihara <yuya@tcha.org>
parents: 11198
diff changeset
3 . $TESTDIR/helpers.sh
11198
b345b1cc124f rebase: use helpers.sh in tests
Matt Mackall <mpm@selenic.com>
parents: 9815
diff changeset
4
9815
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
5 echo "[extensions]" >> $HGRCPATH
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
6 echo "graphlog=" >> $HGRCPATH
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
7 echo "rebase=" >> $HGRCPATH
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
8
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
9 rm -rf repo
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
10 hg init repo
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
11 cd repo
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
12
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
13 echo A > a
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
14 echo >> a
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
15 hg commit -AmA -u test -d '0 0'
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
16
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
17 echo B > a
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
18 echo >> a
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
19 hg commit -mB -u test -d '1 0'
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
20
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
21 echo C > a
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
22 echo >> a
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
23 hg commit -mC -u test -d '2 0'
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
24
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
25 hg up -C 0
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
26 echo D >> a
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
27 hg commit -AmAD -u test -d '3 0'
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
28
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
29 hg glog --template '{rev}:{desc} {node|short}\n'
11198
b345b1cc124f rebase: use helpers.sh in tests
Matt Mackall <mpm@selenic.com>
parents: 9815
diff changeset
30 hg rebase -q -s 1 -d 3 | hidebackup
9815
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
31 hg glog --template '{rev}:{desc} {node|short}\n'
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
32
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents:
diff changeset
33 exit 0