|
1 |
|
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 .. |
|
60 |
|
61 check shamap LF and CRLF handling |
|
62 |
|
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 |
|
87 |
|
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 |
|
107 |
|
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 |
|
127 |
|
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 |