annotate tests/svn/svndump-empty.sh @ 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 c53a49c345e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16466
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
1 #!/bin/sh
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
2 #
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
3 # Use this script to generate empty.svndump
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
4 #
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
5
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
6 mkdir temp
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
7 cd temp
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
8
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
9 mkdir project-orig
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
10 cd project-orig
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
11 mkdir trunk
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
12 mkdir branches
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
13 mkdir tags
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
14 cd ..
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
15
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
16 svnadmin create svn-repo
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
17 svnurl=file://`pwd`/svn-repo
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
18 svn import project-orig $svnurl -m "init projA"
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
19
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
20 svn co $svnurl project
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
21 cd project
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
22 mkdir trunk/dir
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
23 echo a > trunk/dir/a
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
24 svn add trunk/dir
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
25 svn ci -m adddir
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
26
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
27 echo b > trunk/b
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
28 svn add trunk/b
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
29 svn ci -m addb
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
30
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
31 echo c > c
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
32 svn add c
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
33 svn ci -m addc
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
34 cd ..
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
35
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
36 # svnsync repo/trunk/dir only so the last two revisions are empty
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
37 svnadmin create svn-empty
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
38 cat > svn-empty/hooks/pre-revprop-change <<EOF
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
39 #!/bin/sh
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
40 exit 0
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
41 EOF
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
42 chmod +x svn-empty/hooks/pre-revprop-change
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
43 svnsync init --username svnsync file://`pwd`/svn-empty file://`pwd`/svn-repo/trunk/dir
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
44 svnsync sync file://`pwd`/svn-empty
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
45 svn log -v file://`pwd`/svn-empty
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
46
c53a49c345e1 convert/svn: do not try converting empty head revisions (issue3347)
Patrick Mezard <patrick@mezard.eu>
parents:
diff changeset
47 svnadmin dump svn-empty > ../empty.svndump