annotate tests/test-convert-baz @ 15152:94b200a11cf7 stable

http: handle push of bundles > 2 GB again (issue3017) It was very elegant that httpsendfile implemented __len__ like a string. It was however also dangerous because that protocol can't handle sizes bigger than 2 GB. Mercurial tried to work around that, but it turned out to be too easy to introduce new errors in this area. With this change __len__ is no longer implemented at all and the code will work the same way for short and long posts.
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 21 Sep 2011 22:52:00 +0200
parents 7fc79055a62b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
1 #!/bin/sh
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
3 "$TESTDIR/hghave" baz || exit 80
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
4
6102
4e351c03a31a test-convert-baz: set username with baz, not tla
Patrick Mezard <pmezard@gmail.com>
parents: 6101
diff changeset
5 baz my-id "mercurial <mercurial@selenic.com>"
6084
a672df805855 Document and fix tla/baz conversion tests
Patrick Mezard <pmezard@gmail.com>
parents: 6078
diff changeset
6
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
7 echo "[extensions]" >> $HGRCPATH
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
8 echo "convert=" >> $HGRCPATH
10119
bb5ea66789e3 tests: load with "ext =" instead of "hgext.ext ="
Martin Geisler <mg@lazybytes.net>
parents: 8523
diff changeset
9 echo 'graphlog =' >> $HGRCPATH
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
10
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
11 echo % create baz archive
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
12 baz make-archive baz@mercurial--convert hg-test-convert-baz
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
13
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
14 echo % initialize baz repo
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
15 mkdir baz-repo
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
16 cd baz-repo/
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
17 baz init-tree baz@mercurial--convert/baz--test--0
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
18 baz import
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
19
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
20 echo % create initial files
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
21 echo 'this is a file' > a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
22 baz add a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
23 mkdir src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
24 baz add src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
25 cd src
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
26 dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
27 baz add b
8267
faa318261ee8 test-convert-baz: hide GNU tar deprecation warning
Mads Kiilerich <mads@kiilerich.com>
parents: 7567
diff changeset
28 # HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead"
10802
6e4cf8319f54 check-code.py: Check for bare ^
Mads Kiilerich <mads@kiilerich.com>
parents: 10119
diff changeset
29 baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar'
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
30
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
31 echo % create link file and modify a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
32 ln -s ../a a-link
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
33 baz add a-link
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
34 echo 'this a modification to a' >> ../a
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
35 baz commit -s "added link to a and modify a"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
36
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
37 echo % create second link and modify b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
38 ln -s ../a a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
39 baz add a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
40 dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
41 baz commit -s "added second link and modify b"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
42
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
43 echo % b file to link and a-link-2 to regular file
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
44 rm -f a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
45 echo 'this is now a regular file' > a-link-2
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
46 ln -sf ../a b
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
47 baz commit -s "file to link and link to file test"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
48
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
49 echo % move a-link-2 file and src directory
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
50 cd ..
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
51 baz mv src/a-link-2 c
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
52 baz mv src test
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
53 baz commit -s "move and rename a-link-2 file and src directory"
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
54
7567
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
55 echo % move and add the moved file again
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
56 echo e > e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
57 baz add e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
58 baz commit -s "add e"
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
59 baz mv e f
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
60 echo ee > e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
61 baz add e
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
62 baz commit -s "move e and recreate it again"
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
63 cd ..
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
64
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
65 echo % converting baz repo to Mercurial
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
66 hg convert baz-repo baz-repo-hg
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
67
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
68 baz register-archive -d baz@mercurial--convert
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
69
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
70 glog()
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
71 {
8523
5b7da468531b tests: replace #...# syntax with {...}
Martin Geisler <mg@lazybytes.net>
parents: 8267
diff changeset
72 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
73 }
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
74
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
75 echo % show graph log
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
76 glog -R baz-repo-hg
6799
12d1e1e79faf Fix tests failures introduced by 7239e06e58e9
Patrick Mezard <pmezard@gmail.com>
parents: 6102
diff changeset
77 hg up -q -R baz-repo-hg
6078
ebc23d34102f convert: added gnu arch (baz) tests
Aleix Conchillo Flaque <aleix@member.fsf.org>
parents:
diff changeset
78 hg -R baz-repo-hg manifest --debug
7567
0946294d1f32 convert/gnuarch: fix switched copy source and destination
Patrick Mezard <pmezard@gmail.com>
parents: 6799
diff changeset
79 hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies