Show More
@@ -1,223 +1,245 | |||||
1 |
|
1 | |||
2 | $ cat >> $HGRCPATH <<EOF |
|
2 | $ cat >> $HGRCPATH <<EOF | |
3 | > [extensions] |
|
3 | > [extensions] | |
4 | > convert = |
|
4 | > convert = | |
5 | > [convert] |
|
5 | > [convert] | |
6 | > hg.saverev = yes |
|
6 | > hg.saverev = yes | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
9 | $ glog() |
|
9 | $ glog() | |
10 | > { |
|
10 | > { | |
11 | > hg -R "$1" log -G --template '{rev} "{desc}" files: {files}\n' |
|
11 | > hg -R "$1" log -G --template '{rev} "{desc}" files: {files}\n' | |
12 | > } |
|
12 | > } | |
13 |
|
13 | |||
14 | $ hg init source |
|
14 | $ hg init source | |
15 | $ cd source |
|
15 | $ cd source | |
16 |
|
16 | |||
17 | $ echo a > a |
|
17 | $ echo a > a | |
18 | $ echo b > b |
|
18 | $ echo b > b | |
19 | $ echo f > f |
|
19 | $ echo f > f | |
20 | $ hg ci -d '0 0' -qAm '0: add a b f' |
|
20 | $ hg ci -d '0 0' -qAm '0: add a b f' | |
21 | $ echo c > c |
|
21 | $ echo c > c | |
22 | $ hg move f d |
|
22 | $ hg move f d | |
23 | $ hg ci -d '1 0' -qAm '1: add c, move f to d' |
|
23 | $ hg ci -d '1 0' -qAm '1: add c, move f to d' | |
24 | $ hg copy a e |
|
24 | $ hg copy a e | |
25 | $ echo b >> b |
|
25 | $ echo b >> b | |
26 | $ hg ci -d '2 0' -qAm '2: copy e from a, change b' |
|
26 | $ hg ci -d '2 0' -qAm '2: copy e from a, change b' | |
27 | $ hg up -C 0 |
|
27 | $ hg up -C 0 | |
28 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
28 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
29 | $ echo a >> a |
|
29 | $ echo a >> a | |
30 | $ hg ci -d '3 0' -qAm '3: change a' |
|
30 | $ hg ci -d '3 0' -qAm '3: change a' | |
31 | $ hg merge |
|
31 | $ hg merge | |
32 | merging a and e to e |
|
32 | merging a and e to e | |
33 | 3 files updated, 1 files merged, 1 files removed, 0 files unresolved |
|
33 | 3 files updated, 1 files merged, 1 files removed, 0 files unresolved | |
34 | (branch merge, don't forget to commit) |
|
34 | (branch merge, don't forget to commit) | |
35 | $ hg ci -d '4 0' -qAm '4: merge 2 and 3' |
|
35 | $ hg ci -d '4 0' -qAm '4: merge 2 and 3' | |
36 | $ echo a >> a |
|
36 | $ echo a >> a | |
37 | $ hg ci -d '5 0' -qAm '5: change a' |
|
37 | $ hg ci -d '5 0' -qAm '5: change a' | |
38 | $ cd .. |
|
38 | $ cd .. | |
39 |
|
39 | |||
40 | Convert from null revision |
|
40 | Convert from null revision | |
41 |
|
41 | |||
42 | $ hg convert --config convert.hg.startrev=null source full |
|
42 | $ hg convert --config convert.hg.startrev=null source full | |
43 | initializing destination full repository |
|
43 | initializing destination full repository | |
44 | scanning source... |
|
44 | scanning source... | |
45 | sorting... |
|
45 | sorting... | |
46 | converting... |
|
46 | converting... | |
47 | 5 0: add a b f |
|
47 | 5 0: add a b f | |
48 | 4 1: add c, move f to d |
|
48 | 4 1: add c, move f to d | |
49 | 3 2: copy e from a, change b |
|
49 | 3 2: copy e from a, change b | |
50 | 2 3: change a |
|
50 | 2 3: change a | |
51 | 1 4: merge 2 and 3 |
|
51 | 1 4: merge 2 and 3 | |
52 | 0 5: change a |
|
52 | 0 5: change a | |
53 |
|
53 | |||
54 | $ glog full |
|
54 | $ glog full | |
55 | o 5 "5: change a" files: a |
|
55 | o 5 "5: change a" files: a | |
56 | | |
|
56 | | | |
57 | o 4 "4: merge 2 and 3" files: e f |
|
57 | o 4 "4: merge 2 and 3" files: e f | |
58 | |\ |
|
58 | |\ | |
59 | | o 3 "3: change a" files: a |
|
59 | | o 3 "3: change a" files: a | |
60 | | | |
|
60 | | | | |
61 | o | 2 "2: copy e from a, change b" files: b e |
|
61 | o | 2 "2: copy e from a, change b" files: b e | |
62 | | | |
|
62 | | | | |
63 | o | 1 "1: add c, move f to d" files: c d f |
|
63 | o | 1 "1: add c, move f to d" files: c d f | |
64 | |/ |
|
64 | |/ | |
65 | o 0 "0: add a b f" files: a b f |
|
65 | o 0 "0: add a b f" files: a b f | |
66 |
|
66 | |||
67 | $ rm -Rf full |
|
67 | $ rm -Rf full | |
68 |
|
68 | |||
69 | Convert from zero revision |
|
69 | Convert from zero revision | |
70 |
|
70 | |||
71 | $ hg convert --config convert.hg.startrev=0 source full |
|
71 | $ hg convert --config convert.hg.startrev=0 source full | |
72 | initializing destination full repository |
|
72 | initializing destination full repository | |
73 | scanning source... |
|
73 | scanning source... | |
74 | sorting... |
|
74 | sorting... | |
75 | converting... |
|
75 | converting... | |
76 | 5 0: add a b f |
|
76 | 5 0: add a b f | |
77 | 4 1: add c, move f to d |
|
77 | 4 1: add c, move f to d | |
78 | 3 2: copy e from a, change b |
|
78 | 3 2: copy e from a, change b | |
79 | 2 3: change a |
|
79 | 2 3: change a | |
80 | 1 4: merge 2 and 3 |
|
80 | 1 4: merge 2 and 3 | |
81 | 0 5: change a |
|
81 | 0 5: change a | |
82 |
|
82 | |||
83 | $ glog full |
|
83 | $ glog full | |
84 | o 5 "5: change a" files: a |
|
84 | o 5 "5: change a" files: a | |
85 | | |
|
85 | | | |
86 | o 4 "4: merge 2 and 3" files: e f |
|
86 | o 4 "4: merge 2 and 3" files: e f | |
87 | |\ |
|
87 | |\ | |
88 | | o 3 "3: change a" files: a |
|
88 | | o 3 "3: change a" files: a | |
89 | | | |
|
89 | | | | |
90 | o | 2 "2: copy e from a, change b" files: b e |
|
90 | o | 2 "2: copy e from a, change b" files: b e | |
91 | | | |
|
91 | | | | |
92 | o | 1 "1: add c, move f to d" files: c d f |
|
92 | o | 1 "1: add c, move f to d" files: c d f | |
93 | |/ |
|
93 | |/ | |
94 | o 0 "0: add a b f" files: a b f |
|
94 | o 0 "0: add a b f" files: a b f | |
95 |
|
95 | |||
96 | Convert from merge parent |
|
96 | Convert from merge parent | |
97 |
|
97 | |||
98 | $ hg convert --config convert.hg.startrev=1 source conv1 |
|
98 | $ hg convert --config convert.hg.startrev=1 source conv1 | |
99 | initializing destination conv1 repository |
|
99 | initializing destination conv1 repository | |
100 | scanning source... |
|
100 | scanning source... | |
101 | sorting... |
|
101 | sorting... | |
102 | converting... |
|
102 | converting... | |
103 | 3 1: add c, move f to d |
|
103 | 3 1: add c, move f to d | |
104 | 2 2: copy e from a, change b |
|
104 | 2 2: copy e from a, change b | |
105 | 1 4: merge 2 and 3 |
|
105 | 1 4: merge 2 and 3 | |
106 | 0 5: change a |
|
106 | 0 5: change a | |
107 |
|
107 | |||
108 | $ glog conv1 |
|
108 | $ glog conv1 | |
109 | o 3 "5: change a" files: a |
|
109 | o 3 "5: change a" files: a | |
110 | | |
|
110 | | | |
111 | o 2 "4: merge 2 and 3" files: a e |
|
111 | o 2 "4: merge 2 and 3" files: a e | |
112 | | |
|
112 | | | |
113 | o 1 "2: copy e from a, change b" files: b e |
|
113 | o 1 "2: copy e from a, change b" files: b e | |
114 | | |
|
114 | | | |
115 | o 0 "1: add c, move f to d" files: a b c d |
|
115 | o 0 "1: add c, move f to d" files: a b c d | |
116 |
|
116 | |||
117 | $ cd conv1 |
|
117 | $ cd conv1 | |
118 | $ hg up -q |
|
118 | $ hg up -q | |
119 |
|
119 | |||
120 | Check copy preservation |
|
120 | Check copy preservation | |
121 |
|
121 | |||
122 | $ hg st -C --change 2 e |
|
122 | $ hg st -C --change 2 e | |
123 | M e |
|
123 | M e | |
124 | $ hg st -C --change 1 e |
|
124 | $ hg st -C --change 1 e | |
125 | A e |
|
125 | A e | |
126 | a |
|
126 | a | |
127 | $ hg st -C --change 0 a |
|
127 | $ hg st -C --change 0 a | |
128 | A a |
|
128 | A a | |
129 |
|
129 | |||
130 | (It seems like a bug in log that the following doesn't show rev 1.) |
|
130 | (It seems like a bug in log that the following doesn't show rev 1.) | |
131 |
|
131 | |||
132 | $ hg log --follow --copies e |
|
132 | $ hg log --follow --copies e | |
133 | changeset: 2:82bbac3d2cf4 |
|
133 | changeset: 2:82bbac3d2cf4 | |
134 | user: test |
|
134 | user: test | |
135 | date: Thu Jan 01 00:00:04 1970 +0000 |
|
135 | date: Thu Jan 01 00:00:04 1970 +0000 | |
136 | summary: 4: merge 2 and 3 |
|
136 | summary: 4: merge 2 and 3 | |
137 |
|
137 | |||
138 | changeset: 0:23c3be426dce |
|
138 | changeset: 0:23c3be426dce | |
139 | user: test |
|
139 | user: test | |
140 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
140 | date: Thu Jan 01 00:00:01 1970 +0000 | |
141 | summary: 1: add c, move f to d |
|
141 | summary: 1: add c, move f to d | |
142 |
|
142 | |||
143 | Check copy removal on missing parent |
|
143 | Check copy removal on missing parent | |
144 |
|
144 | |||
145 | $ hg log --follow --copies d |
|
145 | $ hg log --follow --copies d | |
146 | changeset: 0:23c3be426dce |
|
146 | changeset: 0:23c3be426dce | |
147 | user: test |
|
147 | user: test | |
148 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
148 | date: Thu Jan 01 00:00:01 1970 +0000 | |
149 | summary: 1: add c, move f to d |
|
149 | summary: 1: add c, move f to d | |
150 |
|
150 | |||
151 | $ hg cat -r tip a b |
|
151 | $ hg cat -r tip a b | |
152 | a |
|
152 | a | |
153 | a |
|
153 | a | |
154 | a |
|
154 | a | |
155 | b |
|
155 | b | |
156 | b |
|
156 | b | |
157 | $ hg -q verify |
|
157 | $ hg -q verify | |
158 | $ cd .. |
|
158 | $ cd .. | |
159 |
|
159 | |||
160 | Convert from merge |
|
160 | Convert from merge | |
161 |
|
161 | |||
162 | $ hg convert --config convert.hg.startrev=4 source conv4 |
|
162 | $ hg convert --config convert.hg.startrev=4 source conv4 | |
163 | initializing destination conv4 repository |
|
163 | initializing destination conv4 repository | |
164 | scanning source... |
|
164 | scanning source... | |
165 | sorting... |
|
165 | sorting... | |
166 | converting... |
|
166 | converting... | |
167 | 1 4: merge 2 and 3 |
|
167 | 1 4: merge 2 and 3 | |
168 | 0 5: change a |
|
168 | 0 5: change a | |
169 | $ glog conv4 |
|
169 | $ glog conv4 | |
170 | o 1 "5: change a" files: a |
|
170 | o 1 "5: change a" files: a | |
171 | | |
|
171 | | | |
172 | o 0 "4: merge 2 and 3" files: a b c d e |
|
172 | o 0 "4: merge 2 and 3" files: a b c d e | |
173 |
|
173 | |||
174 | $ cd conv4 |
|
174 | $ cd conv4 | |
175 | $ hg up -C |
|
175 | $ hg up -C | |
176 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
176 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
177 | $ hg cat -r tip a b |
|
177 | $ hg cat -r tip a b | |
178 | a |
|
178 | a | |
179 | a |
|
179 | a | |
180 | a |
|
180 | a | |
181 | b |
|
181 | b | |
182 | b |
|
182 | b | |
183 | $ hg -q verify |
|
183 | $ hg -q verify | |
184 | $ cd .. |
|
184 | $ cd .. | |
185 |
|
185 | |||
186 | Convert from revset in convert.hg.revs |
|
186 | Convert from revset in convert.hg.revs | |
187 |
|
187 | |||
188 | $ hg convert --config convert.hg.revs='3:4+0' source revsetrepo |
|
188 | $ hg convert --config convert.hg.revs='3:4+0' source revsetrepo | |
189 | initializing destination revsetrepo repository |
|
189 | initializing destination revsetrepo repository | |
190 | scanning source... |
|
190 | scanning source... | |
191 | sorting... |
|
191 | sorting... | |
192 | converting... |
|
192 | converting... | |
193 | 2 0: add a b f |
|
193 | 2 0: add a b f | |
194 | 1 3: change a |
|
194 | 1 3: change a | |
195 | 0 4: merge 2 and 3 |
|
195 | 0 4: merge 2 and 3 | |
196 |
|
196 | |||
197 | $ glog revsetrepo |
|
197 | $ glog revsetrepo | |
198 | o 2 "4: merge 2 and 3" files: b c d e f |
|
198 | o 2 "4: merge 2 and 3" files: b c d e f | |
199 | | |
|
199 | | | |
200 | o 1 "3: change a" files: a |
|
200 | o 1 "3: change a" files: a | |
201 | | |
|
201 | | | |
202 | o 0 "0: add a b f" files: a b f |
|
202 | o 0 "0: add a b f" files: a b f | |
203 |
|
203 | |||
204 | Convert from specified revs |
|
204 | Convert from specified revs | |
205 |
|
205 | |||
206 | $ hg convert --rev 3 --rev 2 source multiplerevs |
|
206 | $ hg convert --rev 3 --rev 2 source multiplerevs | |
207 | initializing destination multiplerevs repository |
|
207 | initializing destination multiplerevs repository | |
208 | scanning source... |
|
208 | scanning source... | |
209 | sorting... |
|
209 | sorting... | |
210 | converting... |
|
210 | converting... | |
211 | 3 0: add a b f |
|
211 | 3 0: add a b f | |
212 | 2 1: add c, move f to d |
|
212 | 2 1: add c, move f to d | |
213 | 1 2: copy e from a, change b |
|
213 | 1 2: copy e from a, change b | |
214 | 0 3: change a |
|
214 | 0 3: change a | |
215 | $ glog multiplerevs |
|
215 | $ glog multiplerevs | |
216 | o 3 "3: change a" files: a |
|
216 | o 3 "3: change a" files: a | |
217 | | |
|
217 | | | |
218 | | o 2 "2: copy e from a, change b" files: b e |
|
218 | | o 2 "2: copy e from a, change b" files: b e | |
219 | | | |
|
219 | | | | |
220 | | o 1 "1: add c, move f to d" files: c d f |
|
220 | | o 1 "1: add c, move f to d" files: c d f | |
221 | |/ |
|
221 | |/ | |
222 | o 0 "0: add a b f" files: a b f |
|
222 | o 0 "0: add a b f" files: a b f | |
223 |
|
223 | |||
|
224 | Convert in multiple steps that doesn't overlap - the link to the parent is | |||
|
225 | currently missing | |||
|
226 | ||||
|
227 | $ hg convert --config convert.hg.revs=::1 source multistep | |||
|
228 | initializing destination multistep repository | |||
|
229 | scanning source... | |||
|
230 | sorting... | |||
|
231 | converting... | |||
|
232 | 1 0: add a b f | |||
|
233 | 0 1: add c, move f to d | |||
|
234 | $ hg convert --config convert.hg.revs=2 source multistep | |||
|
235 | scanning source... | |||
|
236 | sorting... | |||
|
237 | converting... | |||
|
238 | 0 2: copy e from a, change b | |||
|
239 | $ glog multistep | |||
|
240 | o 2 "2: copy e from a, change b" files: a b c d e | |||
|
241 | ||||
|
242 | o 1 "1: add c, move f to d" files: c d f | |||
|
243 | | | |||
|
244 | o 0 "0: add a b f" files: a b f | |||
|
245 |
General Comments 0
You need to be logged in to leave comments.
Login now