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