##// 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
2 $ cat >> $HGRCPATH <<EOF
21 hg copy --after --force foo bar
3 > [extensions]
22 hg copy foo baz
4 > convert=
23 hg ci -m 'make bar and baz copies of foo' -d '2 0'
5 > [convert]
24
6 > hg.saverev=False
25 hg merge
7 > EOF
26 hg ci -m 'merge local copy' -d '3 0'
8 $ hg init orig
27
9 $ cd orig
28 hg up -C 1
10 $ echo foo > foo
29 hg merge 2
11 $ echo bar > bar
30 hg ci -m 'merge remote copy' -d '4 0'
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
61 check shamap LF and CRLF handling
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 ..
44
62
45 echo '% check shamap LF and CRLF handling'
63 $ cat > rewrite.py <<EOF
46 cat > rewrite.py <<EOF
64 > import sys
47 import sys
65 > # Interlace LF and CRLF
48 # Interlace LF and CRLF
66 > lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
49 lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
67 > for i, l in enumerate(file(sys.argv[1]))]
50 for i, l in enumerate(file(sys.argv[1]))]
68 > file(sys.argv[1], 'wb').write(''.join(lines))
51 file(sys.argv[1], 'wb').write(''.join(lines))
69 > EOF
52 EOF
70 $ python rewrite.py new/.hg/shamap
53 python rewrite.py new/.hg/shamap
71 $ cd orig
54 cd orig
72 $ hg up -qC 1
55 hg up -qC 1
73 $ echo foo >> foo
56 echo foo >> foo
74 $ hg ci -qm 'change foo again'
57 hg ci -qm 'change foo again'
75 $ hg up -qC 2
58 hg up -qC 2
76 $ echo foo >> foo
59 echo foo >> foo
77 $ hg ci -qm 'change foo again again'
60 hg ci -qm 'change foo again again'
78 $ cd ..
61 cd ..
79 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
62 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
88 $ hg init broken
65 hg init broken
89 $ cd broken
66 cd broken
90 $ echo a >> a
67 echo a >> a
91 $ echo b >> b
68 echo b >> b
92 $ hg ci -qAm init
69 hg ci -qAm init
93 $ echo a >> a
70 echo a >> a
94 $ echo b >> b
71 echo b >> b
95 $ hg copy b c
72 hg copy b c
96 $ hg ci -qAm changeall
73 hg ci -qAm changeall
97 $ hg up -qC 0
74 hg up -qC 0
98 $ echo bc >> b
75 echo bc >> b
99 $ hg ci -m changebagain
76 hg ci -m changebagain
100 created new head
77 HGMERGE=internal:local hg -q merge
101 $ HGMERGE=internal:local hg -q merge
78 hg ci -m merge
102 $ hg ci -m merge
79 hg mv b d
103 $ hg mv b d
80 hg ci -m moveb
104 $ hg ci -m moveb
81 echo % break it
105
82 rm .hg/store/data/b.*
106 break it
83 cd ..
84
107
85 hg --config convert.hg.ignoreerrors=True convert broken fixed
108 $ rm .hg/store/data/b.*
86 hg -R fixed verify
109 $ cd ..
87 echo '% manifest -r 0'
110 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
88 hg -R fixed manifest -r 0
111 initializing destination fixed repository
89 echo '% manifest -r tip'
112 scanning source...
90 hg -R fixed manifest -r tip
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
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now