Mercurial > hg
annotate tests/test-clone-update-order.t @ 23167:a3c2d9211294 stable
templater: don't overwrite the keyword mapping in runsymbol() (issue4362)
This keyword remapping was introduced in e06e9fd2d99f as part of converting
generator based iterators into list based iterators, mentioning "undesired
behavior in template" when a generator is exhausted, but doesn't say what and
introduces no tests.
The problem with the remapping was that it corrupted the output for keywords
like 'extras', 'file_copies' and 'file_copies_switch' in templates such as:
$ hg log -r 142b5d5ec9cc --template "{file_copies % ' File: {file_copy}\n'}"
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
File: mercurial/changelog.py (mercurial/hg.py)
What was happening was that in the first call to runtemplate() inside runmap(),
'lm' mapped the keyword (e.g. file_copies) to the appropriate showxxx() method.
On each subsequent call to runtemplate() in that loop however, the keyword was
mapped to a list of the first item's pieces, e.g.:
'file_copy': ['mercurial/changelog.py', ' (', 'mercurial/hg.py', ')']
Therefore, the dict for the second and any subsequent items were not processed
through the corresponding showxxx() method, and the first item's data was
reused.
The 'extras' keyword regressed in de7e6c489412, and 'file_copies' regressed in
0b241d7a8c62 for other reasons. The common thread of things fixed by this seems
to be when a list of dicts are passed to the templatekw._hybrid class.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 03 Nov 2014 12:08:03 -0500 |
parents | 41885892796e |
children | 701df761aa94 |
rev | line source |
---|---|
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
1 $ hg init |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
2 $ echo foo > bar |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
3 $ hg commit -Am default |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
4 adding bar |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
5 $ hg up -r null |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
6 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
7 $ hg branch mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
8 marked working directory as branch mine |
15615 | 9 (branches are permanent and global, did you want a bookmark?) |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
10 $ echo hello > world |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
11 $ hg commit -Am hello |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
12 adding world |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
13 $ hg up -r null |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
14 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
15 $ hg branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
16 marked working directory as branch other |
15615 | 17 (branches are permanent and global, did you want a bookmark?) |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
18 $ echo good > bye |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
19 $ hg commit -Am other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
20 adding bye |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
21 $ hg up -r mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
22 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
23 |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
24 $ hg clone -U -u . .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
25 abort: cannot specify both --noupdate and --updaterev |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12286
diff
changeset
|
26 [255] |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
27 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
28 $ hg clone -U .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
29 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
30 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
31 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
32 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
33 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
34 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
35 $ hg clone -u . .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
36 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
37 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
38 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
39 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
40 updating to branch mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
42 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
43 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
44 $ hg clone -u 0 .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
45 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
46 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
47 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
48 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
49 updating to branch default |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
51 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
52 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
53 $ hg clone -u 1 .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
54 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
55 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
56 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
57 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
58 updating to branch mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
60 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
61 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
62 $ hg clone -u 2 .#other ../b -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
63 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
64 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
65 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
66 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
67 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
69 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
70 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
71 Test -r mine ... mine is ignored: |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
72 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
73 $ hg clone -u 2 .#other ../b -r mine -r 0 -r 1 -r 2 -b other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
74 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
75 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
76 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
77 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
78 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
80 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
81 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
82 $ hg clone .#other ../b -b default -b mine |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
83 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
84 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
85 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
86 added 3 changesets with 3 changes to 3 files (+2 heads) |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
87 updating to branch default |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
89 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
90 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
91 $ hg clone .#other ../b |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
92 adding changesets |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
93 adding manifests |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
94 adding file changes |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
95 added 1 changesets with 1 changes to 1 files |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
96 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
98 $ rm -rf ../b |
10637
7ce62865d72a
commands: document and test hg clone update priority
timeless <timeless@gmail.com>
parents:
diff
changeset
|
99 |
12286
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
100 $ hg clone -U . ../c -r 1 -r 2 > /dev/null |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
101 $ hg clone ../c ../b |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
102 updating to branch other |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
104 $ rm -rf ../b ../c |
63352a7a8c1c
tests: unify test-clone-update-order
Adrian Buehlmann <adrian@cadifra.com>
parents:
10637
diff
changeset
|
105 |