annotate tests/test-convert-hg-source @ 11852:b2f91119bf8c

tests: unify test-annotate
author Martin Geisler <mg@lazybytes.net>
date Sat, 14 Aug 2010 02:18:17 +0200
parents a2f11188e2d2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
1 #!/bin/sh
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
2
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5282
diff changeset
3 cat >> $HGRCPATH <<EOF
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5282
diff changeset
4 [extensions]
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5282
diff changeset
5 convert=
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5282
diff changeset
6 [convert]
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5282
diff changeset
7 hg.saverev=False
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5282
diff changeset
8 EOF
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
9
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
10 hg init orig
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
11 cd orig
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
12
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
13 echo foo > foo
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
14 echo bar > bar
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
15 hg ci -qAm 'add foo bar' -d '0 0'
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
16
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
17 echo >> foo
5282
22ddde515fda test-convert-hg-source: enforce conversion order with --date
Patrick Mezard <pmezard@gmail.com>
parents: 5280
diff changeset
18 hg ci -m 'change foo' -d '1 0'
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
19
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
20 hg up -qC 0
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
21 hg copy --after --force foo bar
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
22 hg copy foo baz
5282
22ddde515fda test-convert-hg-source: enforce conversion order with --date
Patrick Mezard <pmezard@gmail.com>
parents: 5280
diff changeset
23 hg ci -m 'make bar and baz copies of foo' -d '2 0'
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
24
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
25 hg merge
5282
22ddde515fda test-convert-hg-source: enforce conversion order with --date
Patrick Mezard <pmezard@gmail.com>
parents: 5280
diff changeset
26 hg ci -m 'merge local copy' -d '3 0'
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
27
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
28 hg up -C 1
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
29 hg merge 2
5282
22ddde515fda test-convert-hg-source: enforce conversion order with --date
Patrick Mezard <pmezard@gmail.com>
parents: 5280
diff changeset
30 hg ci -m 'merge remote copy' -d '4 0'
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
31
5811
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 5556
diff changeset
32 chmod +x baz
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 5556
diff changeset
33 hg ci -m 'mark baz executable' -d '5 0'
180a3eee4b75 Fix copies reporting in log and convert.
Maxim Dounin <mdounin@mdounin.ru>
parents: 5556
diff changeset
34
11673
a2f11188e2d2 convert: handle closed branch heads in hg-hg conversion (issue2185)
Matt Mackall <mpm@selenic.com>
parents: 9528
diff changeset
35 hg branch foo
a2f11188e2d2 convert: handle closed branch heads in hg-hg conversion (issue2185)
Matt Mackall <mpm@selenic.com>
parents: 9528
diff changeset
36 hg ci -m 'branch foo' -d '6 0'
a2f11188e2d2 convert: handle closed branch heads in hg-hg conversion (issue2185)
Matt Mackall <mpm@selenic.com>
parents: 9528
diff changeset
37 hg ci --close-branch -m 'close' -d '7 0'
a2f11188e2d2 convert: handle closed branch heads in hg-hg conversion (issue2185)
Matt Mackall <mpm@selenic.com>
parents: 9528
diff changeset
38
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
39 cd ..
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
40 hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
41 cd new
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
42 hg out ../orig
7231
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
43 cd ..
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
44
9528
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
45 echo '% check shamap LF and CRLF handling'
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
46 cat > rewrite.py <<EOF
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
47 import sys
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
48 # Interlace LF and CRLF
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
49 lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
50 for i, l in enumerate(file(sys.argv[1]))]
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
51 file(sys.argv[1], 'wb').write(''.join(lines))
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
52 EOF
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
53 python rewrite.py new/.hg/shamap
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
54 cd orig
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
55 hg up -qC 1
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
56 echo foo >> foo
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
57 hg ci -qm 'change foo again'
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
58 hg up -qC 2
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
59 echo foo >> foo
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
60 hg ci -qm 'change foo again again'
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
61 cd ..
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
62 hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
314fc589b313 convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard <pmezard@gmail.com>
parents: 7231
diff changeset
63
7231
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
64 echo % init broken repository
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
65 hg init broken
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
66 cd broken
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
67 echo a >> a
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
68 echo b >> b
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
69 hg ci -qAm init
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
70 echo a >> a
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
71 echo b >> b
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
72 hg copy b c
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
73 hg ci -qAm changeall
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
74 hg up -qC 0
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
75 echo bc >> b
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
76 hg ci -m changebagain
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
77 HGMERGE=internal:local hg -q merge
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
78 hg ci -m merge
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
79 hg mv b d
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
80 hg ci -m moveb
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
81 echo % break it
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
82 rm .hg/store/data/b.*
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
83 cd ..
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
84
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
85 hg --config convert.hg.ignoreerrors=True convert broken fixed
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
86 hg -R fixed verify
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
87 echo '% manifest -r 0'
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
88 hg -R fixed manifest -r 0
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
89 echo '% manifest -r tip'
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 5811
diff changeset
90 hg -R fixed manifest -r tip
5280
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
91
11e1e574da02 convert: mercurial_source: also search for copies in modified files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
92 true