##// END OF EJS Templates
tests: unify test-convert-hg-source
Matt Mackall -
r12526:9892949b default
parent child Browse files
Show More
@@ -1,92 +1,138 b''
1 #!/bin/sh
2
3 cat >> $HGRCPATH <<EOF
4 [extensions]
5 convert=
6 [convert]
7 hg.saverev=False
8 EOF
9
10 hg init orig
11 cd orig
12
13 echo foo > foo
14 echo bar > bar
15 hg ci -qAm 'add foo bar' -d '0 0'
16
17 echo >> foo
18 hg ci -m 'change foo' -d '1 0'
19 1
20 hg up -qC 0
21 hg copy --after --force foo bar
22 hg copy foo baz
23 hg ci -m 'make bar and baz copies of foo' -d '2 0'
24
25 hg merge
26 hg ci -m 'merge local copy' -d '3 0'
27
28 hg up -C 1
29 hg merge 2
30 hg ci -m 'merge remote copy' -d '4 0'
2 $ cat >> $HGRCPATH <<EOF
3 > [extensions]
4 > convert=
5 > [convert]
6 > hg.saverev=False
7 > EOF
8 $ hg init orig
9 $ cd orig
10 $ echo foo > foo
11 $ echo bar > bar
12 $ hg ci -qAm 'add foo bar' -d '0 0'
13 $ echo >> foo
14 $ hg ci -m 'change foo' -d '1 0'
15 $ hg up -qC 0
16 $ hg copy --after --force foo bar
17 $ hg copy foo baz
18 $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
19 created new head
20 $ hg merge
21 merging baz and foo to baz
22 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
23 (branch merge, don't forget to commit)
24 $ hg ci -m 'merge local copy' -d '3 0'
25 $ hg up -C 1
26 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 $ hg merge 2
28 merging foo and baz to baz
29 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
30 (branch merge, don't forget to commit)
31 $ hg ci -m 'merge remote copy' -d '4 0'
32 created new head
33 $ chmod +x baz
34 $ hg ci -m 'mark baz executable' -d '5 0'
35 $ hg branch foo
36 marked working directory as branch foo
37 $ hg ci -m 'branch foo' -d '6 0'
38 $ hg ci --close-branch -m 'close' -d '7 0'
39 $ cd ..
40 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
41 initializing destination new repository
42 scanning source...
43 sorting...
44 converting...
45 7 add foo bar
46 6 change foo
47 5 make bar and baz copies of foo
48 4 merge local copy
49 3 merge remote copy
50 2 mark baz executable
51 1 branch foo
52 0 close
53 $ cd new
54 $ hg out ../orig
55 comparing with ../orig
56 searching for changes
57 no changes found
58 [1]
59 $ cd ..
31 60
32 chmod +x baz
33 hg ci -m 'mark baz executable' -d '5 0'
34
35 hg branch foo
36 hg ci -m 'branch foo' -d '6 0'
37 hg ci --close-branch -m 'close' -d '7 0'
38
39 cd ..
40 hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
41 cd new
42 hg out ../orig
43 cd ..
61 check shamap LF and CRLF handling
44 62
45 echo '% check shamap LF and CRLF handling'
46 cat > rewrite.py <<EOF
47 import sys
48 # Interlace LF and CRLF
49 lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
50 for i, l in enumerate(file(sys.argv[1]))]
51 file(sys.argv[1], 'wb').write(''.join(lines))
52 EOF
53 python rewrite.py new/.hg/shamap
54 cd orig
55 hg up -qC 1
56 echo foo >> foo
57 hg ci -qm 'change foo again'
58 hg up -qC 2
59 echo foo >> foo
60 hg ci -qm 'change foo again again'
61 cd ..
62 hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
63 $ cat > rewrite.py <<EOF
64 > import sys
65 > # Interlace LF and CRLF
66 > lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
67 > for i, l in enumerate(file(sys.argv[1]))]
68 > file(sys.argv[1], 'wb').write(''.join(lines))
69 > EOF
70 $ python rewrite.py new/.hg/shamap
71 $ cd orig
72 $ hg up -qC 1
73 $ echo foo >> foo
74 $ hg ci -qm 'change foo again'
75 $ hg up -qC 2
76 $ echo foo >> foo
77 $ hg ci -qm 'change foo again again'
78 $ cd ..
79 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
80 scanning source...
81 sorting...
82 converting...
83 1 change foo again again
84 0 change foo again
85
86 init broken repository
63 87
64 echo % init broken repository
65 hg init broken
66 cd broken
67 echo a >> a
68 echo b >> b
69 hg ci -qAm init
70 echo a >> a
71 echo b >> b
72 hg copy b c
73 hg ci -qAm changeall
74 hg up -qC 0
75 echo bc >> b
76 hg ci -m changebagain
77 HGMERGE=internal:local hg -q merge
78 hg ci -m merge
79 hg mv b d
80 hg ci -m moveb
81 echo % break it
82 rm .hg/store/data/b.*
83 cd ..
88 $ hg init broken
89 $ cd broken
90 $ echo a >> a
91 $ echo b >> b
92 $ hg ci -qAm init
93 $ echo a >> a
94 $ echo b >> b
95 $ hg copy b c
96 $ hg ci -qAm changeall
97 $ hg up -qC 0
98 $ echo bc >> b
99 $ hg ci -m changebagain
100 created new head
101 $ HGMERGE=internal:local hg -q merge
102 $ hg ci -m merge
103 $ hg mv b d
104 $ hg ci -m moveb
105
106 break it
84 107
85 hg --config convert.hg.ignoreerrors=True convert broken fixed
86 hg -R fixed verify
87 echo '% manifest -r 0'
88 hg -R fixed manifest -r 0
89 echo '% manifest -r tip'
90 hg -R fixed manifest -r tip
108 $ rm .hg/store/data/b.*
109 $ cd ..
110 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
111 initializing destination fixed repository
112 scanning source...
113 sorting...
114 converting...
115 4 init
116 ignoring: data/b.i@1e88685f5dde: no match found
117 3 changeall
118 2 changebagain
119 1 merge
120 0 moveb
121 $ hg -R fixed verify
122 checking changesets
123 checking manifests
124 crosschecking files in changesets and manifests
125 checking files
126 3 files, 5 changesets, 5 total revisions
91 127
92 true
128 manifest -r 0
129
130 $ hg -R fixed manifest -r 0
131 a
132
133 manifest -r tip
134
135 $ hg -R fixed manifest -r tip
136 a
137 c
138 d
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now