Show More
@@ -1,405 +1,408 | |||
|
1 | 1 | # destutil.py - Mercurial utility function for command destination |
|
2 | 2 | # |
|
3 | 3 | # Copyright Matt Mackall <mpm@selenic.com> and other |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from __future__ import absolute_import |
|
9 | 9 | |
|
10 | 10 | from .i18n import _ |
|
11 | 11 | from . import ( |
|
12 | 12 | bookmarks, |
|
13 | 13 | error, |
|
14 | 14 | obsolete, |
|
15 | 15 | scmutil, |
|
16 | 16 | ) |
|
17 | 17 | |
|
18 | 18 | def _destupdateobs(repo, clean): |
|
19 | 19 | """decide of an update destination from obsolescence markers""" |
|
20 | 20 | node = None |
|
21 | 21 | wc = repo[None] |
|
22 | 22 | p1 = wc.p1() |
|
23 | 23 | movemark = None |
|
24 | 24 | |
|
25 | 25 | if p1.obsolete() and not p1.children(): |
|
26 | 26 | # allow updating to successors |
|
27 | 27 | successors = obsolete.successorssets(repo, p1.node()) |
|
28 | 28 | |
|
29 | 29 | # behavior of certain cases is as follows, |
|
30 | 30 | # |
|
31 | 31 | # divergent changesets: update to highest rev, similar to what |
|
32 | 32 | # is currently done when there are more than one head |
|
33 | 33 | # (i.e. 'tip') |
|
34 | 34 | # |
|
35 | 35 | # replaced changesets: same as divergent except we know there |
|
36 | 36 | # is no conflict |
|
37 | 37 | # |
|
38 | 38 | # pruned changeset: no update is done; though, we could |
|
39 | 39 | # consider updating to the first non-obsolete parent, |
|
40 | 40 | # similar to what is current done for 'hg prune' |
|
41 | 41 | |
|
42 | 42 | if successors: |
|
43 | 43 | # flatten the list here handles both divergent (len > 1) |
|
44 | 44 | # and the usual case (len = 1) |
|
45 | 45 | successors = [n for sub in successors for n in sub] |
|
46 | 46 | |
|
47 | 47 | # get the max revision for the given successors set, |
|
48 | 48 | # i.e. the 'tip' of a set |
|
49 | 49 | node = repo.revs('max(%ln)', successors).first() |
|
50 | 50 | if bookmarks.isactivewdirparent(repo): |
|
51 | 51 | movemark = repo['.'].node() |
|
52 | 52 | return node, movemark, None |
|
53 | 53 | |
|
54 | 54 | def _destupdatebook(repo, clean): |
|
55 | 55 | """decide on an update destination from active bookmark""" |
|
56 | 56 | # we also move the active bookmark, if any |
|
57 | 57 | activemark = None |
|
58 | 58 | node, movemark = bookmarks.calculateupdate(repo.ui, repo, None) |
|
59 | 59 | if node is not None: |
|
60 | 60 | activemark = node |
|
61 | 61 | return node, movemark, activemark |
|
62 | 62 | |
|
63 | 63 | def _destupdatebranch(repo, clean): |
|
64 | 64 | """decide on an update destination from current branch |
|
65 | 65 | |
|
66 | 66 | This ignores closed branch heads. |
|
67 | 67 | """ |
|
68 | 68 | wc = repo[None] |
|
69 | 69 | movemark = node = None |
|
70 | 70 | currentbranch = wc.branch() |
|
71 | 71 | |
|
72 | 72 | if clean: |
|
73 | 73 | currentbranch = repo['.'].branch() |
|
74 | 74 | |
|
75 | 75 | if currentbranch in repo.branchmap(): |
|
76 | 76 | heads = repo.branchheads(currentbranch) |
|
77 | 77 | if heads: |
|
78 | 78 | node = repo.revs('max(.::(%ln))', heads).first() |
|
79 | 79 | if bookmarks.isactivewdirparent(repo): |
|
80 | 80 | movemark = repo['.'].node() |
|
81 | 81 | elif currentbranch == 'default' and not wc.p1(): |
|
82 | 82 | # "null" parent belongs to "default" branch, but it doesn't exist, so |
|
83 | 83 | # update to the tipmost non-closed branch head |
|
84 | 84 | node = repo.revs('max(head() and not closed())').first() |
|
85 | 85 | else: |
|
86 | 86 | node = repo['.'].node() |
|
87 | 87 | return node, movemark, None |
|
88 | 88 | |
|
89 | 89 | def _destupdatebranchfallback(repo, clean): |
|
90 | 90 | """decide on an update destination from closed heads in current branch""" |
|
91 | 91 | wc = repo[None] |
|
92 | 92 | currentbranch = wc.branch() |
|
93 | 93 | movemark = None |
|
94 | 94 | if currentbranch in repo.branchmap(): |
|
95 | 95 | # here, all descendant branch heads are closed |
|
96 | 96 | heads = repo.branchheads(currentbranch, closed=True) |
|
97 | 97 | assert heads, "any branch has at least one head" |
|
98 | 98 | node = repo.revs('max(.::(%ln))', heads).first() |
|
99 | 99 | assert node is not None, ("any revision has at least " |
|
100 | 100 | "one descendant branch head") |
|
101 | 101 | if bookmarks.isactivewdirparent(repo): |
|
102 | 102 | movemark = repo['.'].node() |
|
103 | 103 | else: |
|
104 | 104 | # here, no "default" branch, and all branches are closed |
|
105 | 105 | node = repo.lookup('tip') |
|
106 | 106 | assert node is not None, "'tip' exists even in empty repository" |
|
107 | 107 | return node, movemark, None |
|
108 | 108 | |
|
109 | 109 | # order in which each step should be evaluated |
|
110 | 110 | # steps are run until one finds a destination |
|
111 | 111 | destupdatesteps = ['evolution', 'bookmark', 'branch', 'branchfallback'] |
|
112 | 112 | # mapping to ease extension overriding steps. |
|
113 | 113 | destupdatestepmap = {'evolution': _destupdateobs, |
|
114 | 114 | 'bookmark': _destupdatebook, |
|
115 | 115 | 'branch': _destupdatebranch, |
|
116 | 116 | 'branchfallback': _destupdatebranchfallback, |
|
117 | 117 | } |
|
118 | 118 | |
|
119 | 119 | def destupdate(repo, clean=False): |
|
120 | 120 | """destination for bare update operation |
|
121 | 121 | |
|
122 | 122 | return (rev, movemark, activemark) |
|
123 | 123 | |
|
124 | 124 | - rev: the revision to update to, |
|
125 | 125 | - movemark: node to move the active bookmark from |
|
126 | 126 | (cf bookmark.calculate update), |
|
127 | 127 | - activemark: a bookmark to activate at the end of the update. |
|
128 | 128 | """ |
|
129 | 129 | node = movemark = activemark = None |
|
130 | 130 | |
|
131 | 131 | for step in destupdatesteps: |
|
132 | 132 | node, movemark, activemark = destupdatestepmap[step](repo, clean) |
|
133 | 133 | if node is not None: |
|
134 | 134 | break |
|
135 | 135 | rev = repo[node].rev() |
|
136 | 136 | |
|
137 | 137 | return rev, movemark, activemark |
|
138 | 138 | |
|
139 | 139 | msgdestmerge = { |
|
140 | 140 | # too many matching divergent bookmark |
|
141 | 141 | 'toomanybookmarks': |
|
142 | 142 | {'merge': |
|
143 | 143 | (_("multiple matching bookmarks to merge -" |
|
144 | 144 | " please merge with an explicit rev or bookmark"), |
|
145 | 145 | _("run 'hg heads' to see all heads")), |
|
146 | 146 | 'rebase': |
|
147 | 147 | (_("multiple matching bookmarks to rebase -" |
|
148 | 148 | " please rebase to an explicit rev or bookmark"), |
|
149 | 149 | _("run 'hg heads' to see all heads")), |
|
150 | 150 | }, |
|
151 | 151 | # no other matching divergent bookmark |
|
152 | 152 | 'nootherbookmarks': |
|
153 | 153 | {'merge': |
|
154 | 154 | (_("no matching bookmark to merge - " |
|
155 | 155 | "please merge with an explicit rev or bookmark"), |
|
156 | 156 | _("run 'hg heads' to see all heads")), |
|
157 | 157 | 'rebase': |
|
158 | 158 | (_("no matching bookmark to rebase - " |
|
159 | 159 | "please rebase to an explicit rev or bookmark"), |
|
160 | 160 | _("run 'hg heads' to see all heads")), |
|
161 | 161 | }, |
|
162 | 162 | # branch have too many unbookmarked heads, no obvious destination |
|
163 | 163 | 'toomanyheads': |
|
164 | 164 | {'merge': |
|
165 | 165 | (_("branch '%s' has %d heads - please merge with an explicit rev"), |
|
166 | 166 | _("run 'hg heads .' to see heads")), |
|
167 | 167 | 'rebase': |
|
168 | 168 | (_("branch '%s' has %d heads - please rebase to an explicit rev"), |
|
169 | 169 | _("run 'hg heads .' to see heads")), |
|
170 | 170 | }, |
|
171 | 171 | # branch have no other unbookmarked heads |
|
172 | 172 | 'bookmarkedheads': |
|
173 | 173 | {'merge': |
|
174 | 174 | (_("heads are bookmarked - please merge with an explicit rev"), |
|
175 | 175 | _("run 'hg heads' to see all heads")), |
|
176 | 176 | 'rebase': |
|
177 | 177 | (_("heads are bookmarked - please rebase to an explicit rev"), |
|
178 | 178 | _("run 'hg heads' to see all heads")), |
|
179 | 179 | }, |
|
180 | 180 | # branch have just a single heads, but there is other branches |
|
181 | 181 | 'nootherbranchheads': |
|
182 | 182 | {'merge': |
|
183 | 183 | (_("branch '%s' has one head - please merge with an explicit rev"), |
|
184 | 184 | _("run 'hg heads' to see all heads")), |
|
185 | 185 | 'rebase': |
|
186 | 186 | (_("branch '%s' has one head - please rebase to an explicit rev"), |
|
187 | 187 | _("run 'hg heads' to see all heads")), |
|
188 | 188 | }, |
|
189 | 189 | # repository have a single head |
|
190 | 190 | 'nootherheads': |
|
191 | 191 | {'merge': |
|
192 | 192 | (_('nothing to merge'), |
|
193 | 193 | None), |
|
194 | 194 | 'rebase': |
|
195 | 195 | (_('nothing to rebase'), |
|
196 | 196 | None), |
|
197 | 197 | }, |
|
198 | 198 | # repository have a single head and we are not on it |
|
199 | 199 | 'nootherheadsbehind': |
|
200 | 200 | {'merge': |
|
201 | 201 | (_('nothing to merge'), |
|
202 | 202 | _("use 'hg update' instead")), |
|
203 | 203 | 'rebase': |
|
204 | 204 | (_('nothing to rebase'), |
|
205 | 205 | _("use 'hg update' instead")), |
|
206 | 206 | }, |
|
207 | 207 | # We are not on a head |
|
208 | 208 | 'notatheads': |
|
209 | 209 | {'merge': |
|
210 | 210 | (_('working directory not at a head revision'), |
|
211 | 211 | _("use 'hg update' or merge with an explicit revision")), |
|
212 | 212 | 'rebase': |
|
213 | 213 | (_('working directory not at a head revision'), |
|
214 | 214 | _("use 'hg update' or rebase to an explicit revision")) |
|
215 | 215 | }, |
|
216 | 216 | 'emptysourceset': |
|
217 | 217 | {'merge': |
|
218 | 218 | (_('source set is empty'), |
|
219 | 219 | None), |
|
220 | 220 | 'rebase': |
|
221 | 221 | (_('source set is empty'), |
|
222 | 222 | None), |
|
223 | 223 | }, |
|
224 | 224 | 'multiplebranchessourceset': |
|
225 | 225 | {'merge': |
|
226 | 226 | (_('source set is rooted in multiple branches'), |
|
227 | 227 | None), |
|
228 | 228 | 'rebase': |
|
229 | 229 | (_('rebaseset is rooted in multiple named branches'), |
|
230 | 230 | _('specify an explicit destination with --dest')), |
|
231 | 231 | }, |
|
232 | 232 | } |
|
233 | 233 | |
|
234 | 234 | def _destmergebook(repo, action='merge', sourceset=None, destspace=None): |
|
235 | 235 | """find merge destination in the active bookmark case""" |
|
236 | 236 | node = None |
|
237 | 237 | bmheads = bookmarks.headsforactive(repo) |
|
238 | 238 | curhead = repo[repo._activebookmark].node() |
|
239 | 239 | if len(bmheads) == 2: |
|
240 | 240 | if curhead == bmheads[0]: |
|
241 | 241 | node = bmheads[1] |
|
242 | 242 | else: |
|
243 | 243 | node = bmheads[0] |
|
244 | 244 | elif len(bmheads) > 2: |
|
245 | 245 | msg, hint = msgdestmerge['toomanybookmarks'][action] |
|
246 | 246 | raise error.ManyMergeDestAbort(msg, hint=hint) |
|
247 | 247 | elif len(bmheads) <= 1: |
|
248 | 248 | msg, hint = msgdestmerge['nootherbookmarks'][action] |
|
249 | 249 | raise error.NoMergeDestAbort(msg, hint=hint) |
|
250 | 250 | assert node is not None |
|
251 | 251 | return node |
|
252 | 252 | |
|
253 | 253 | def _destmergebranch(repo, action='merge', sourceset=None, onheadcheck=True, |
|
254 | 254 | destspace=None): |
|
255 | 255 | """find merge destination based on branch heads""" |
|
256 | 256 | node = None |
|
257 | 257 | |
|
258 | 258 | if sourceset is None: |
|
259 | 259 | sourceset = [repo[repo.dirstate.p1()].rev()] |
|
260 | 260 | branch = repo.dirstate.branch() |
|
261 | 261 | elif not sourceset: |
|
262 | 262 | msg, hint = msgdestmerge['emptysourceset'][action] |
|
263 | 263 | raise error.NoMergeDestAbort(msg, hint=hint) |
|
264 | 264 | else: |
|
265 | 265 | branch = None |
|
266 | 266 | for ctx in repo.set('roots(%ld::%ld)', sourceset, sourceset): |
|
267 | 267 | if branch is not None and ctx.branch() != branch: |
|
268 | 268 | msg, hint = msgdestmerge['multiplebranchessourceset'][action] |
|
269 | 269 | raise error.ManyMergeDestAbort(msg, hint=hint) |
|
270 | 270 | branch = ctx.branch() |
|
271 | 271 | |
|
272 | 272 | bheads = repo.branchheads(branch) |
|
273 | 273 | onhead = repo.revs('%ld and %ln', sourceset, bheads) |
|
274 | 274 | if onheadcheck and not onhead: |
|
275 | 275 | # Case A: working copy if not on a head. (merge only) |
|
276 | 276 | # |
|
277 | 277 | # This is probably a user mistake We bailout pointing at 'hg update' |
|
278 | 278 | if len(repo.heads()) <= 1: |
|
279 | 279 | msg, hint = msgdestmerge['nootherheadsbehind'][action] |
|
280 | 280 | else: |
|
281 | 281 | msg, hint = msgdestmerge['notatheads'][action] |
|
282 | 282 | raise error.Abort(msg, hint=hint) |
|
283 | 283 | # remove heads descendants of source from the set |
|
284 | 284 | bheads = list(repo.revs('%ln - (%ld::)', bheads, sourceset)) |
|
285 | 285 | # filters out bookmarked heads |
|
286 | 286 | nbhs = list(repo.revs('%ld - bookmark()', bheads)) |
|
287 | 287 | |
|
288 | 288 | if destspace is not None: |
|
289 | 289 | # restrict search space |
|
290 | 290 | # used in the 'hg pull --rebase' case, see issue 5214. |
|
291 | 291 | nbhs = list(repo.revs('%ld and %ld', destspace, nbhs)) |
|
292 | 292 | |
|
293 | 293 | if len(nbhs) > 1: |
|
294 | 294 | # Case B: There is more than 1 other anonymous heads |
|
295 | 295 | # |
|
296 | 296 | # This means that there will be more than 1 candidate. This is |
|
297 | 297 | # ambiguous. We abort asking the user to pick as explicit destination |
|
298 | 298 | # instead. |
|
299 | 299 | msg, hint = msgdestmerge['toomanyheads'][action] |
|
300 | 300 | msg %= (branch, len(bheads) + 1) |
|
301 | 301 | raise error.ManyMergeDestAbort(msg, hint=hint) |
|
302 | 302 | elif not nbhs: |
|
303 | 303 | # Case B: There is no other anonymous heads |
|
304 | 304 | # |
|
305 | 305 | # This means that there is no natural candidate to merge with. |
|
306 | 306 | # We abort, with various messages for various cases. |
|
307 | 307 | if bheads: |
|
308 | 308 | msg, hint = msgdestmerge['bookmarkedheads'][action] |
|
309 | 309 | elif len(repo.heads()) > 1: |
|
310 | 310 | msg, hint = msgdestmerge['nootherbranchheads'][action] |
|
311 | 311 | msg %= branch |
|
312 | 312 | elif not onhead: |
|
313 | 313 | # if 'onheadcheck == False' (rebase case), |
|
314 | 314 | # this was not caught in Case A. |
|
315 | 315 | msg, hint = msgdestmerge['nootherheadsbehind'][action] |
|
316 | 316 | else: |
|
317 | 317 | msg, hint = msgdestmerge['nootherheads'][action] |
|
318 | 318 | raise error.NoMergeDestAbort(msg, hint=hint) |
|
319 | 319 | else: |
|
320 | 320 | node = nbhs[0] |
|
321 | 321 | assert node is not None |
|
322 | 322 | return node |
|
323 | 323 | |
|
324 | 324 | def destmerge(repo, action='merge', sourceset=None, onheadcheck=True, |
|
325 | 325 | destspace=None): |
|
326 | 326 | """return the default destination for a merge |
|
327 | 327 | |
|
328 | 328 | (or raise exception about why it can't pick one) |
|
329 | 329 | |
|
330 | 330 | :action: the action being performed, controls emitted error message |
|
331 | 331 | """ |
|
332 | 332 | # destspace is here to work around issues with `hg pull --rebase` see |
|
333 | 333 | # issue5214 for details |
|
334 | 334 | if repo._activebookmark: |
|
335 | 335 | node = _destmergebook(repo, action=action, sourceset=sourceset, |
|
336 | 336 | destspace=destspace) |
|
337 | 337 | else: |
|
338 | 338 | node = _destmergebranch(repo, action=action, sourceset=sourceset, |
|
339 | 339 | onheadcheck=onheadcheck, destspace=destspace) |
|
340 | 340 | return repo[node].rev() |
|
341 | 341 | |
|
342 | 342 | histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())' |
|
343 | 343 | |
|
344 | 344 | def desthistedit(ui, repo): |
|
345 | 345 | """Default base revision to edit for `hg histedit`.""" |
|
346 | 346 | default = ui.config('histedit', 'defaultrev', histeditdefaultrevset) |
|
347 | 347 | if default: |
|
348 | 348 | revs = scmutil.revrange(repo, [default]) |
|
349 | 349 | if revs: |
|
350 | 350 | # The revset supplied by the user may not be in ascending order nor |
|
351 | 351 | # take the first revision. So do this manually. |
|
352 | 352 | revs.sort() |
|
353 | 353 | return revs.first() |
|
354 | 354 | |
|
355 | 355 | return None |
|
356 | 356 | |
|
357 | 357 | def _statusotherbook(ui, repo): |
|
358 | 358 | bmheads = bookmarks.headsforactive(repo) |
|
359 | 359 | curhead = repo[repo._activebookmark].node() |
|
360 | 360 | if repo.revs('%n and parents()', curhead): |
|
361 | 361 | # we are on the active bookmark |
|
362 | 362 | bmheads = [b for b in bmheads if curhead != b] |
|
363 | 363 | if bmheads: |
|
364 | 364 | msg = _('%i other divergent bookmarks for "%s"\n') |
|
365 | 365 | ui.status(msg % (len(bmheads), repo._activebookmark)) |
|
366 | 366 | |
|
367 | 367 | def _statusotherbranchheads(ui, repo): |
|
368 | 368 | currentbranch = repo.dirstate.branch() |
|
369 | 369 | allheads = repo.branchheads(currentbranch, closed=True) |
|
370 | 370 | heads = repo.branchheads(currentbranch) |
|
371 | 371 | if repo.revs('%ln and parents()', allheads): |
|
372 | 372 | # we are on a head, even though it might be closed |
|
373 | 373 | # |
|
374 | 374 | # on closed otherheads |
|
375 | 375 | # ========= ========== |
|
376 | 376 | # o 0 all heads for current branch are closed |
|
377 | 377 | # N only descendant branch heads are closed |
|
378 | 378 | # x 0 there is only one non-closed branch head |
|
379 | 379 | # N there are some non-closed branch heads |
|
380 | 380 | # ========= ========== |
|
381 | 381 | otherheads = repo.revs('%ln - parents()', heads) |
|
382 | 382 | if repo['.'].closesbranch(): |
|
383 | 383 | ui.warn(_('no open descendant heads on branch "%s", ' |
|
384 | 384 | 'updating to a closed head\n') % |
|
385 | 385 | (currentbranch)) |
|
386 | 386 | if otherheads: |
|
387 | 387 | ui.warn(_("(committing will reopen the head, " |
|
388 | 388 | "use 'hg heads .' to see %i other heads)\n") % |
|
389 | 389 | (len(otherheads))) |
|
390 | 390 | else: |
|
391 | 391 | ui.warn(_('(committing will reopen branch "%s")\n') % |
|
392 | 392 | (currentbranch)) |
|
393 | 393 | elif otherheads: |
|
394 | curhead = repo['.'] | |
|
395 | ui.status(_('updated to "%s: %s"\n') % (curhead, | |
|
396 | curhead.description().split('\n')[0])) | |
|
394 | 397 | ui.status(_('%i other heads for branch "%s"\n') % |
|
395 | 398 | (len(otherheads), currentbranch)) |
|
396 | 399 | |
|
397 | 400 | def statusotherdests(ui, repo): |
|
398 | 401 | """Print message about other head""" |
|
399 | 402 | # XXX we should probably include a hint: |
|
400 | 403 | # - about what to do |
|
401 | 404 | # - how to see such heads |
|
402 | 405 | if repo._activebookmark: |
|
403 | 406 | _statusotherbook(ui, repo) |
|
404 | 407 | else: |
|
405 | 408 | _statusotherbranchheads(ui, repo) |
@@ -1,796 +1,797 | |||
|
1 | 1 | # The tests in test-bisect are done on a linear history. Here the |
|
2 | 2 | # following repository history is used for testing: |
|
3 | 3 | # |
|
4 | 4 | # 17 |
|
5 | 5 | # | |
|
6 | 6 | # 18 16 |
|
7 | 7 | # \ / |
|
8 | 8 | # 15 |
|
9 | 9 | # / \ |
|
10 | 10 | # / \ |
|
11 | 11 | # 10 13 |
|
12 | 12 | # / \ | |
|
13 | 13 | # / \ | 14 |
|
14 | 14 | # 7 6 9 12 / |
|
15 | 15 | # \ / \ | |/ |
|
16 | 16 | # 4 \ | 11 |
|
17 | 17 | # \ \ | / |
|
18 | 18 | # 3 5 | / |
|
19 | 19 | # \ / |/ |
|
20 | 20 | # 2 8 |
|
21 | 21 | # \ / |
|
22 | 22 | # 1 |
|
23 | 23 | # | |
|
24 | 24 | # 0 |
|
25 | 25 | |
|
26 | 26 | init |
|
27 | 27 | |
|
28 | 28 | $ hg init |
|
29 | 29 | |
|
30 | 30 | committing changes |
|
31 | 31 | |
|
32 | 32 | $ echo > a |
|
33 | 33 | $ echo '0' >> a |
|
34 | 34 | $ hg add a |
|
35 | 35 | $ hg ci -m "0" -d "0 0" |
|
36 | 36 | $ echo '1' >> a |
|
37 | 37 | $ hg ci -m "1" -d "1 0" |
|
38 | 38 | $ echo '2' >> a |
|
39 | 39 | $ hg ci -m "2" -d "2 0" |
|
40 | 40 | $ echo '3' >> a |
|
41 | 41 | $ hg ci -m "3" -d "3 0" |
|
42 | 42 | $ echo '4' >> a |
|
43 | 43 | $ hg ci -m "4" -d "4 0" |
|
44 | 44 | |
|
45 | 45 | create branch |
|
46 | 46 | |
|
47 | 47 | $ hg up -r 2 |
|
48 | 48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
49 | 49 | $ echo '5' >> b |
|
50 | 50 | $ hg add b |
|
51 | 51 | $ hg ci -m "5" -d "5 0" |
|
52 | 52 | created new head |
|
53 | 53 | |
|
54 | 54 | merge |
|
55 | 55 | |
|
56 | 56 | $ hg merge |
|
57 | 57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
58 | 58 | (branch merge, don't forget to commit) |
|
59 | 59 | $ hg ci -m "merge 4,5" -d "6 0" |
|
60 | 60 | |
|
61 | 61 | create branch |
|
62 | 62 | |
|
63 | 63 | $ hg up -r 4 |
|
64 | 64 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
65 | 65 | $ echo '7' > c |
|
66 | 66 | $ hg add c |
|
67 | 67 | $ hg ci -m "7" -d "7 0" |
|
68 | 68 | created new head |
|
69 | 69 | |
|
70 | 70 | create branch |
|
71 | 71 | |
|
72 | 72 | $ hg up -r 1 |
|
73 | 73 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
74 | 74 | $ echo '8' > d |
|
75 | 75 | $ hg add d |
|
76 | 76 | $ hg ci -m "8" -d "8 0" |
|
77 | 77 | created new head |
|
78 | 78 | $ echo '9' >> d |
|
79 | 79 | $ hg ci -m "9" -d "9 0" |
|
80 | 80 | |
|
81 | 81 | merge |
|
82 | 82 | |
|
83 | 83 | $ hg merge -r 6 |
|
84 | 84 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
85 | 85 | (branch merge, don't forget to commit) |
|
86 | 86 | $ hg ci -m "merge 6,9" -d "10 0" |
|
87 | 87 | |
|
88 | 88 | create branch |
|
89 | 89 | |
|
90 | 90 | $ hg up -r 8 |
|
91 | 91 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
92 | 92 | $ echo '11' > e |
|
93 | 93 | $ hg add e |
|
94 | 94 | $ hg ci -m "11" -d "11 0" |
|
95 | 95 | created new head |
|
96 | 96 | $ echo '12' >> e |
|
97 | 97 | $ hg ci -m "12" -d "12 0" |
|
98 | 98 | $ echo '13' >> e |
|
99 | 99 | $ hg ci -m "13" -d "13 0" |
|
100 | 100 | |
|
101 | 101 | create branch |
|
102 | 102 | |
|
103 | 103 | $ hg up -r 11 |
|
104 | 104 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
105 | 105 | $ echo '14' > f |
|
106 | 106 | $ hg add f |
|
107 | 107 | $ hg ci -m "14" -d "14 0" |
|
108 | 108 | created new head |
|
109 | 109 | |
|
110 | 110 | merge |
|
111 | 111 | |
|
112 | 112 | $ hg up -r 13 -C |
|
113 | 113 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
114 | 114 | $ hg merge -r 10 |
|
115 | 115 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
116 | 116 | (branch merge, don't forget to commit) |
|
117 | 117 | $ hg ci -m "merge 10,13" -d "15 0" |
|
118 | 118 | $ echo '16' >> e |
|
119 | 119 | $ hg ci -m "16" -d "16 0" |
|
120 | 120 | $ echo '17' >> e |
|
121 | 121 | $ hg ci -m "17" -d "17 0" |
|
122 | 122 | |
|
123 | 123 | create branch |
|
124 | 124 | |
|
125 | 125 | $ hg up -r 15 |
|
126 | 126 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
127 | 127 | $ echo '18' >> e |
|
128 | 128 | $ hg ci -m "18" -d "18 0" |
|
129 | 129 | created new head |
|
130 | 130 | |
|
131 | 131 | log |
|
132 | 132 | |
|
133 | 133 | $ hg log |
|
134 | 134 | changeset: 18:d42e18c7bc9b |
|
135 | 135 | tag: tip |
|
136 | 136 | parent: 15:857b178a7cf3 |
|
137 | 137 | user: test |
|
138 | 138 | date: Thu Jan 01 00:00:18 1970 +0000 |
|
139 | 139 | summary: 18 |
|
140 | 140 | |
|
141 | 141 | changeset: 17:228c06deef46 |
|
142 | 142 | user: test |
|
143 | 143 | date: Thu Jan 01 00:00:17 1970 +0000 |
|
144 | 144 | summary: 17 |
|
145 | 145 | |
|
146 | 146 | changeset: 16:609d82a7ebae |
|
147 | 147 | user: test |
|
148 | 148 | date: Thu Jan 01 00:00:16 1970 +0000 |
|
149 | 149 | summary: 16 |
|
150 | 150 | |
|
151 | 151 | changeset: 15:857b178a7cf3 |
|
152 | 152 | parent: 13:b0a32c86eb31 |
|
153 | 153 | parent: 10:429fcd26f52d |
|
154 | 154 | user: test |
|
155 | 155 | date: Thu Jan 01 00:00:15 1970 +0000 |
|
156 | 156 | summary: merge 10,13 |
|
157 | 157 | |
|
158 | 158 | changeset: 14:faa450606157 |
|
159 | 159 | parent: 11:82ca6f06eccd |
|
160 | 160 | user: test |
|
161 | 161 | date: Thu Jan 01 00:00:14 1970 +0000 |
|
162 | 162 | summary: 14 |
|
163 | 163 | |
|
164 | 164 | changeset: 13:b0a32c86eb31 |
|
165 | 165 | user: test |
|
166 | 166 | date: Thu Jan 01 00:00:13 1970 +0000 |
|
167 | 167 | summary: 13 |
|
168 | 168 | |
|
169 | 169 | changeset: 12:9f259202bbe7 |
|
170 | 170 | user: test |
|
171 | 171 | date: Thu Jan 01 00:00:12 1970 +0000 |
|
172 | 172 | summary: 12 |
|
173 | 173 | |
|
174 | 174 | changeset: 11:82ca6f06eccd |
|
175 | 175 | parent: 8:dab8161ac8fc |
|
176 | 176 | user: test |
|
177 | 177 | date: Thu Jan 01 00:00:11 1970 +0000 |
|
178 | 178 | summary: 11 |
|
179 | 179 | |
|
180 | 180 | changeset: 10:429fcd26f52d |
|
181 | 181 | parent: 9:3c77083deb4a |
|
182 | 182 | parent: 6:a214d5d3811a |
|
183 | 183 | user: test |
|
184 | 184 | date: Thu Jan 01 00:00:10 1970 +0000 |
|
185 | 185 | summary: merge 6,9 |
|
186 | 186 | |
|
187 | 187 | changeset: 9:3c77083deb4a |
|
188 | 188 | user: test |
|
189 | 189 | date: Thu Jan 01 00:00:09 1970 +0000 |
|
190 | 190 | summary: 9 |
|
191 | 191 | |
|
192 | 192 | changeset: 8:dab8161ac8fc |
|
193 | 193 | parent: 1:4ca5088da217 |
|
194 | 194 | user: test |
|
195 | 195 | date: Thu Jan 01 00:00:08 1970 +0000 |
|
196 | 196 | summary: 8 |
|
197 | 197 | |
|
198 | 198 | changeset: 7:50c76098bbf2 |
|
199 | 199 | parent: 4:5c668c22234f |
|
200 | 200 | user: test |
|
201 | 201 | date: Thu Jan 01 00:00:07 1970 +0000 |
|
202 | 202 | summary: 7 |
|
203 | 203 | |
|
204 | 204 | changeset: 6:a214d5d3811a |
|
205 | 205 | parent: 5:385a529b6670 |
|
206 | 206 | parent: 4:5c668c22234f |
|
207 | 207 | user: test |
|
208 | 208 | date: Thu Jan 01 00:00:06 1970 +0000 |
|
209 | 209 | summary: merge 4,5 |
|
210 | 210 | |
|
211 | 211 | changeset: 5:385a529b6670 |
|
212 | 212 | parent: 2:051e12f87bf1 |
|
213 | 213 | user: test |
|
214 | 214 | date: Thu Jan 01 00:00:05 1970 +0000 |
|
215 | 215 | summary: 5 |
|
216 | 216 | |
|
217 | 217 | changeset: 4:5c668c22234f |
|
218 | 218 | user: test |
|
219 | 219 | date: Thu Jan 01 00:00:04 1970 +0000 |
|
220 | 220 | summary: 4 |
|
221 | 221 | |
|
222 | 222 | changeset: 3:0950834f0a9c |
|
223 | 223 | user: test |
|
224 | 224 | date: Thu Jan 01 00:00:03 1970 +0000 |
|
225 | 225 | summary: 3 |
|
226 | 226 | |
|
227 | 227 | changeset: 2:051e12f87bf1 |
|
228 | 228 | user: test |
|
229 | 229 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
230 | 230 | summary: 2 |
|
231 | 231 | |
|
232 | 232 | changeset: 1:4ca5088da217 |
|
233 | 233 | user: test |
|
234 | 234 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
235 | 235 | summary: 1 |
|
236 | 236 | |
|
237 | 237 | changeset: 0:33b1f9bc8bc5 |
|
238 | 238 | user: test |
|
239 | 239 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
240 | 240 | summary: 0 |
|
241 | 241 | |
|
242 | 242 | |
|
243 | 243 | hg up -C |
|
244 | 244 | |
|
245 | 245 | $ hg up -C |
|
246 | 246 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
247 | updated to "d42e18c7bc9b: 18" | |
|
247 | 248 | 3 other heads for branch "default" |
|
248 | 249 | |
|
249 | 250 | complex bisect test 1 # first bad rev is 9 |
|
250 | 251 | |
|
251 | 252 | $ hg bisect -r |
|
252 | 253 | $ hg bisect -g 0 |
|
253 | 254 | $ hg bisect -b 17 # -> update to rev 6 |
|
254 | 255 | Testing changeset 6:a214d5d3811a (15 changesets remaining, ~3 tests) |
|
255 | 256 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
256 | 257 | $ hg log -q -r 'bisect(pruned)' |
|
257 | 258 | 0:33b1f9bc8bc5 |
|
258 | 259 | 17:228c06deef46 |
|
259 | 260 | $ hg log -q -r 'bisect(untested)' |
|
260 | 261 | 1:4ca5088da217 |
|
261 | 262 | 2:051e12f87bf1 |
|
262 | 263 | 3:0950834f0a9c |
|
263 | 264 | 4:5c668c22234f |
|
264 | 265 | 5:385a529b6670 |
|
265 | 266 | 6:a214d5d3811a |
|
266 | 267 | 8:dab8161ac8fc |
|
267 | 268 | 9:3c77083deb4a |
|
268 | 269 | 10:429fcd26f52d |
|
269 | 270 | 11:82ca6f06eccd |
|
270 | 271 | 12:9f259202bbe7 |
|
271 | 272 | 13:b0a32c86eb31 |
|
272 | 273 | 15:857b178a7cf3 |
|
273 | 274 | 16:609d82a7ebae |
|
274 | 275 | $ hg log -q -r 'bisect(ignored)' |
|
275 | 276 | $ hg bisect -g # -> update to rev 13 |
|
276 | 277 | Testing changeset 13:b0a32c86eb31 (9 changesets remaining, ~3 tests) |
|
277 | 278 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
278 | 279 | $ hg bisect -s # -> update to rev 10 |
|
279 | 280 | Testing changeset 10:429fcd26f52d (9 changesets remaining, ~3 tests) |
|
280 | 281 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
281 | 282 | $ hg bisect -b # -> update to rev 8 |
|
282 | 283 | Testing changeset 8:dab8161ac8fc (3 changesets remaining, ~1 tests) |
|
283 | 284 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
284 | 285 | $ hg bisect -g # -> update to rev 9 |
|
285 | 286 | Testing changeset 9:3c77083deb4a (2 changesets remaining, ~1 tests) |
|
286 | 287 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
287 | 288 | $ hg bisect -b |
|
288 | 289 | The first bad revision is: |
|
289 | 290 | changeset: 9:3c77083deb4a |
|
290 | 291 | user: test |
|
291 | 292 | date: Thu Jan 01 00:00:09 1970 +0000 |
|
292 | 293 | summary: 9 |
|
293 | 294 | |
|
294 | 295 | $ hg log -q -r 'bisect(range)' |
|
295 | 296 | 0:33b1f9bc8bc5 |
|
296 | 297 | 1:4ca5088da217 |
|
297 | 298 | 2:051e12f87bf1 |
|
298 | 299 | 3:0950834f0a9c |
|
299 | 300 | 4:5c668c22234f |
|
300 | 301 | 5:385a529b6670 |
|
301 | 302 | 6:a214d5d3811a |
|
302 | 303 | 8:dab8161ac8fc |
|
303 | 304 | 9:3c77083deb4a |
|
304 | 305 | 10:429fcd26f52d |
|
305 | 306 | 11:82ca6f06eccd |
|
306 | 307 | 12:9f259202bbe7 |
|
307 | 308 | 13:b0a32c86eb31 |
|
308 | 309 | 15:857b178a7cf3 |
|
309 | 310 | 16:609d82a7ebae |
|
310 | 311 | 17:228c06deef46 |
|
311 | 312 | $ hg log -q -r 'bisect(pruned)' |
|
312 | 313 | 0:33b1f9bc8bc5 |
|
313 | 314 | 1:4ca5088da217 |
|
314 | 315 | 2:051e12f87bf1 |
|
315 | 316 | 3:0950834f0a9c |
|
316 | 317 | 4:5c668c22234f |
|
317 | 318 | 5:385a529b6670 |
|
318 | 319 | 6:a214d5d3811a |
|
319 | 320 | 8:dab8161ac8fc |
|
320 | 321 | 9:3c77083deb4a |
|
321 | 322 | 10:429fcd26f52d |
|
322 | 323 | 13:b0a32c86eb31 |
|
323 | 324 | 15:857b178a7cf3 |
|
324 | 325 | 16:609d82a7ebae |
|
325 | 326 | 17:228c06deef46 |
|
326 | 327 | 18:d42e18c7bc9b |
|
327 | 328 | $ hg log -q -r 'bisect(untested)' |
|
328 | 329 | 11:82ca6f06eccd |
|
329 | 330 | 12:9f259202bbe7 |
|
330 | 331 | $ hg log -q -r 'bisect(goods)' |
|
331 | 332 | 0:33b1f9bc8bc5 |
|
332 | 333 | 1:4ca5088da217 |
|
333 | 334 | 2:051e12f87bf1 |
|
334 | 335 | 3:0950834f0a9c |
|
335 | 336 | 4:5c668c22234f |
|
336 | 337 | 5:385a529b6670 |
|
337 | 338 | 6:a214d5d3811a |
|
338 | 339 | 8:dab8161ac8fc |
|
339 | 340 | $ hg log -q -r 'bisect(bads)' |
|
340 | 341 | 9:3c77083deb4a |
|
341 | 342 | 10:429fcd26f52d |
|
342 | 343 | 15:857b178a7cf3 |
|
343 | 344 | 16:609d82a7ebae |
|
344 | 345 | 17:228c06deef46 |
|
345 | 346 | 18:d42e18c7bc9b |
|
346 | 347 | |
|
347 | 348 | complex bisect test 2 # first good rev is 13 |
|
348 | 349 | |
|
349 | 350 | $ hg bisect -r |
|
350 | 351 | $ hg bisect -g 18 |
|
351 | 352 | $ hg bisect -b 1 # -> update to rev 6 |
|
352 | 353 | Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests) |
|
353 | 354 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
354 | 355 | $ hg bisect -s # -> update to rev 10 |
|
355 | 356 | Testing changeset 10:429fcd26f52d (13 changesets remaining, ~3 tests) |
|
356 | 357 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
357 | 358 | $ hg log -q -r 'bisect(pruned)' |
|
358 | 359 | 0:33b1f9bc8bc5 |
|
359 | 360 | 1:4ca5088da217 |
|
360 | 361 | 6:a214d5d3811a |
|
361 | 362 | 18:d42e18c7bc9b |
|
362 | 363 | $ hg bisect -b # -> update to rev 12 |
|
363 | 364 | Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests) |
|
364 | 365 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
365 | 366 | $ hg log -q -r 'bisect(pruned)' |
|
366 | 367 | 0:33b1f9bc8bc5 |
|
367 | 368 | 1:4ca5088da217 |
|
368 | 369 | 2:051e12f87bf1 |
|
369 | 370 | 3:0950834f0a9c |
|
370 | 371 | 4:5c668c22234f |
|
371 | 372 | 5:385a529b6670 |
|
372 | 373 | 6:a214d5d3811a |
|
373 | 374 | 8:dab8161ac8fc |
|
374 | 375 | 9:3c77083deb4a |
|
375 | 376 | 10:429fcd26f52d |
|
376 | 377 | 18:d42e18c7bc9b |
|
377 | 378 | $ hg log -q -r 'bisect(untested)' |
|
378 | 379 | 11:82ca6f06eccd |
|
379 | 380 | 12:9f259202bbe7 |
|
380 | 381 | 13:b0a32c86eb31 |
|
381 | 382 | 15:857b178a7cf3 |
|
382 | 383 | $ hg bisect -b # -> update to rev 13 |
|
383 | 384 | Testing changeset 13:b0a32c86eb31 (3 changesets remaining, ~1 tests) |
|
384 | 385 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
385 | 386 | $ hg bisect -g |
|
386 | 387 | The first good revision is: |
|
387 | 388 | changeset: 13:b0a32c86eb31 |
|
388 | 389 | user: test |
|
389 | 390 | date: Thu Jan 01 00:00:13 1970 +0000 |
|
390 | 391 | summary: 13 |
|
391 | 392 | |
|
392 | 393 | $ hg log -q -r 'bisect(range)' |
|
393 | 394 | 1:4ca5088da217 |
|
394 | 395 | 2:051e12f87bf1 |
|
395 | 396 | 3:0950834f0a9c |
|
396 | 397 | 4:5c668c22234f |
|
397 | 398 | 5:385a529b6670 |
|
398 | 399 | 6:a214d5d3811a |
|
399 | 400 | 8:dab8161ac8fc |
|
400 | 401 | 9:3c77083deb4a |
|
401 | 402 | 10:429fcd26f52d |
|
402 | 403 | 11:82ca6f06eccd |
|
403 | 404 | 12:9f259202bbe7 |
|
404 | 405 | 13:b0a32c86eb31 |
|
405 | 406 | 15:857b178a7cf3 |
|
406 | 407 | 18:d42e18c7bc9b |
|
407 | 408 | |
|
408 | 409 | complex bisect test 3 |
|
409 | 410 | |
|
410 | 411 | first bad rev is 15 |
|
411 | 412 | 10,9,13 are skipped an might be the first bad revisions as well |
|
412 | 413 | |
|
413 | 414 | $ hg bisect -r |
|
414 | 415 | $ hg bisect -g 1 |
|
415 | 416 | $ hg bisect -b 16 # -> update to rev 6 |
|
416 | 417 | Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests) |
|
417 | 418 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
418 | 419 | $ hg log -q -r 'bisect(pruned)' |
|
419 | 420 | 0:33b1f9bc8bc5 |
|
420 | 421 | 1:4ca5088da217 |
|
421 | 422 | 16:609d82a7ebae |
|
422 | 423 | 17:228c06deef46 |
|
423 | 424 | $ hg bisect -g # -> update to rev 13 |
|
424 | 425 | Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests) |
|
425 | 426 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
426 | 427 | $ hg bisect -s # -> update to rev 10 |
|
427 | 428 | Testing changeset 10:429fcd26f52d (8 changesets remaining, ~3 tests) |
|
428 | 429 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
429 | 430 | $ hg bisect -s # -> update to rev 12 |
|
430 | 431 | Testing changeset 12:9f259202bbe7 (8 changesets remaining, ~3 tests) |
|
431 | 432 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
432 | 433 | $ hg log -q -r 'bisect(pruned)' |
|
433 | 434 | 0:33b1f9bc8bc5 |
|
434 | 435 | 1:4ca5088da217 |
|
435 | 436 | 2:051e12f87bf1 |
|
436 | 437 | 3:0950834f0a9c |
|
437 | 438 | 4:5c668c22234f |
|
438 | 439 | 5:385a529b6670 |
|
439 | 440 | 6:a214d5d3811a |
|
440 | 441 | 10:429fcd26f52d |
|
441 | 442 | 13:b0a32c86eb31 |
|
442 | 443 | 16:609d82a7ebae |
|
443 | 444 | 17:228c06deef46 |
|
444 | 445 | $ hg bisect -g # -> update to rev 9 |
|
445 | 446 | Testing changeset 9:3c77083deb4a (5 changesets remaining, ~2 tests) |
|
446 | 447 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
447 | 448 | $ hg bisect -s # -> update to rev 15 |
|
448 | 449 | Testing changeset 15:857b178a7cf3 (5 changesets remaining, ~2 tests) |
|
449 | 450 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
450 | 451 | $ hg log -q -r 'bisect(ignored)' |
|
451 | 452 | $ hg bisect -b |
|
452 | 453 | Due to skipped revisions, the first bad revision could be any of: |
|
453 | 454 | changeset: 9:3c77083deb4a |
|
454 | 455 | user: test |
|
455 | 456 | date: Thu Jan 01 00:00:09 1970 +0000 |
|
456 | 457 | summary: 9 |
|
457 | 458 | |
|
458 | 459 | changeset: 10:429fcd26f52d |
|
459 | 460 | parent: 9:3c77083deb4a |
|
460 | 461 | parent: 6:a214d5d3811a |
|
461 | 462 | user: test |
|
462 | 463 | date: Thu Jan 01 00:00:10 1970 +0000 |
|
463 | 464 | summary: merge 6,9 |
|
464 | 465 | |
|
465 | 466 | changeset: 13:b0a32c86eb31 |
|
466 | 467 | user: test |
|
467 | 468 | date: Thu Jan 01 00:00:13 1970 +0000 |
|
468 | 469 | summary: 13 |
|
469 | 470 | |
|
470 | 471 | changeset: 15:857b178a7cf3 |
|
471 | 472 | parent: 13:b0a32c86eb31 |
|
472 | 473 | parent: 10:429fcd26f52d |
|
473 | 474 | user: test |
|
474 | 475 | date: Thu Jan 01 00:00:15 1970 +0000 |
|
475 | 476 | summary: merge 10,13 |
|
476 | 477 | |
|
477 | 478 | $ hg log -q -r 'bisect(range)' |
|
478 | 479 | 1:4ca5088da217 |
|
479 | 480 | 2:051e12f87bf1 |
|
480 | 481 | 3:0950834f0a9c |
|
481 | 482 | 4:5c668c22234f |
|
482 | 483 | 5:385a529b6670 |
|
483 | 484 | 6:a214d5d3811a |
|
484 | 485 | 8:dab8161ac8fc |
|
485 | 486 | 9:3c77083deb4a |
|
486 | 487 | 10:429fcd26f52d |
|
487 | 488 | 11:82ca6f06eccd |
|
488 | 489 | 12:9f259202bbe7 |
|
489 | 490 | 13:b0a32c86eb31 |
|
490 | 491 | 15:857b178a7cf3 |
|
491 | 492 | 16:609d82a7ebae |
|
492 | 493 | $ hg log -q -r 'bisect(ignored)' |
|
493 | 494 | |
|
494 | 495 | complex bisect test 4 |
|
495 | 496 | |
|
496 | 497 | first good revision is 17 |
|
497 | 498 | 15,16 are skipped an might be the first good revisions as well |
|
498 | 499 | |
|
499 | 500 | $ hg bisect -r |
|
500 | 501 | $ hg bisect -g 17 |
|
501 | 502 | $ hg bisect -b 8 # -> update to rev 10 |
|
502 | 503 | Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests) |
|
503 | 504 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
504 | 505 | $ hg bisect -b # -> update to rev 13 |
|
505 | 506 | Testing changeset 10:429fcd26f52d (5 changesets remaining, ~2 tests) |
|
506 | 507 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
507 | 508 | $ hg bisect -b # -> update to rev 15 |
|
508 | 509 | Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests) |
|
509 | 510 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
510 | 511 | $ hg log -q -r 'bisect(pruned)' |
|
511 | 512 | 0:33b1f9bc8bc5 |
|
512 | 513 | 1:4ca5088da217 |
|
513 | 514 | 2:051e12f87bf1 |
|
514 | 515 | 3:0950834f0a9c |
|
515 | 516 | 4:5c668c22234f |
|
516 | 517 | 5:385a529b6670 |
|
517 | 518 | 6:a214d5d3811a |
|
518 | 519 | 8:dab8161ac8fc |
|
519 | 520 | 9:3c77083deb4a |
|
520 | 521 | 10:429fcd26f52d |
|
521 | 522 | 11:82ca6f06eccd |
|
522 | 523 | 12:9f259202bbe7 |
|
523 | 524 | 13:b0a32c86eb31 |
|
524 | 525 | 17:228c06deef46 |
|
525 | 526 | $ hg bisect -s # -> update to rev 16 |
|
526 | 527 | Testing changeset 16:609d82a7ebae (3 changesets remaining, ~1 tests) |
|
527 | 528 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
528 | 529 | $ hg log -q -r 'bisect(pruned)' |
|
529 | 530 | 0:33b1f9bc8bc5 |
|
530 | 531 | 1:4ca5088da217 |
|
531 | 532 | 2:051e12f87bf1 |
|
532 | 533 | 3:0950834f0a9c |
|
533 | 534 | 4:5c668c22234f |
|
534 | 535 | 5:385a529b6670 |
|
535 | 536 | 6:a214d5d3811a |
|
536 | 537 | 8:dab8161ac8fc |
|
537 | 538 | 9:3c77083deb4a |
|
538 | 539 | 10:429fcd26f52d |
|
539 | 540 | 11:82ca6f06eccd |
|
540 | 541 | 12:9f259202bbe7 |
|
541 | 542 | 13:b0a32c86eb31 |
|
542 | 543 | 15:857b178a7cf3 |
|
543 | 544 | 17:228c06deef46 |
|
544 | 545 | $ hg bisect -s |
|
545 | 546 | Due to skipped revisions, the first good revision could be any of: |
|
546 | 547 | changeset: 15:857b178a7cf3 |
|
547 | 548 | parent: 13:b0a32c86eb31 |
|
548 | 549 | parent: 10:429fcd26f52d |
|
549 | 550 | user: test |
|
550 | 551 | date: Thu Jan 01 00:00:15 1970 +0000 |
|
551 | 552 | summary: merge 10,13 |
|
552 | 553 | |
|
553 | 554 | changeset: 16:609d82a7ebae |
|
554 | 555 | user: test |
|
555 | 556 | date: Thu Jan 01 00:00:16 1970 +0000 |
|
556 | 557 | summary: 16 |
|
557 | 558 | |
|
558 | 559 | changeset: 17:228c06deef46 |
|
559 | 560 | user: test |
|
560 | 561 | date: Thu Jan 01 00:00:17 1970 +0000 |
|
561 | 562 | summary: 17 |
|
562 | 563 | |
|
563 | 564 | $ hg log -q -r 'bisect(range)' |
|
564 | 565 | 8:dab8161ac8fc |
|
565 | 566 | 9:3c77083deb4a |
|
566 | 567 | 10:429fcd26f52d |
|
567 | 568 | 11:82ca6f06eccd |
|
568 | 569 | 12:9f259202bbe7 |
|
569 | 570 | 13:b0a32c86eb31 |
|
570 | 571 | 15:857b178a7cf3 |
|
571 | 572 | 16:609d82a7ebae |
|
572 | 573 | 17:228c06deef46 |
|
573 | 574 | $ hg log -q -r 'bisect(pruned)' |
|
574 | 575 | 0:33b1f9bc8bc5 |
|
575 | 576 | 1:4ca5088da217 |
|
576 | 577 | 2:051e12f87bf1 |
|
577 | 578 | 3:0950834f0a9c |
|
578 | 579 | 4:5c668c22234f |
|
579 | 580 | 5:385a529b6670 |
|
580 | 581 | 6:a214d5d3811a |
|
581 | 582 | 8:dab8161ac8fc |
|
582 | 583 | 9:3c77083deb4a |
|
583 | 584 | 10:429fcd26f52d |
|
584 | 585 | 11:82ca6f06eccd |
|
585 | 586 | 12:9f259202bbe7 |
|
586 | 587 | 13:b0a32c86eb31 |
|
587 | 588 | 15:857b178a7cf3 |
|
588 | 589 | 16:609d82a7ebae |
|
589 | 590 | 17:228c06deef46 |
|
590 | 591 | |
|
591 | 592 | test unrelated revs: |
|
592 | 593 | |
|
593 | 594 | $ hg bisect --reset |
|
594 | 595 | $ hg bisect -b 7 |
|
595 | 596 | $ hg bisect -g 14 |
|
596 | 597 | abort: starting revisions are not directly related |
|
597 | 598 | [255] |
|
598 | 599 | $ hg log -q -r 'bisect(range)' |
|
599 | 600 | $ hg log -q -r 'bisect(pruned)' |
|
600 | 601 | 0:33b1f9bc8bc5 |
|
601 | 602 | 1:4ca5088da217 |
|
602 | 603 | 2:051e12f87bf1 |
|
603 | 604 | 3:0950834f0a9c |
|
604 | 605 | 4:5c668c22234f |
|
605 | 606 | 7:50c76098bbf2 |
|
606 | 607 | 14:faa450606157 |
|
607 | 608 | $ hg bisect --reset |
|
608 | 609 | |
|
609 | 610 | end at merge: 17 bad, 11 good (but 9 is first bad) |
|
610 | 611 | |
|
611 | 612 | $ hg bisect -r |
|
612 | 613 | $ hg bisect -b 17 |
|
613 | 614 | $ hg bisect -g 11 |
|
614 | 615 | Testing changeset 13:b0a32c86eb31 (5 changesets remaining, ~2 tests) |
|
615 | 616 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
616 | 617 | $ hg log -q -r 'bisect(ignored)' |
|
617 | 618 | 2:051e12f87bf1 |
|
618 | 619 | 3:0950834f0a9c |
|
619 | 620 | 4:5c668c22234f |
|
620 | 621 | 5:385a529b6670 |
|
621 | 622 | 6:a214d5d3811a |
|
622 | 623 | 9:3c77083deb4a |
|
623 | 624 | 10:429fcd26f52d |
|
624 | 625 | $ hg bisect -g |
|
625 | 626 | Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests) |
|
626 | 627 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
627 | 628 | $ hg bisect -b |
|
628 | 629 | The first bad revision is: |
|
629 | 630 | changeset: 15:857b178a7cf3 |
|
630 | 631 | parent: 13:b0a32c86eb31 |
|
631 | 632 | parent: 10:429fcd26f52d |
|
632 | 633 | user: test |
|
633 | 634 | date: Thu Jan 01 00:00:15 1970 +0000 |
|
634 | 635 | summary: merge 10,13 |
|
635 | 636 | |
|
636 | 637 | Not all ancestors of this changeset have been checked. |
|
637 | 638 | Use bisect --extend to continue the bisection from |
|
638 | 639 | the common ancestor, dab8161ac8fc. |
|
639 | 640 | $ hg log -q -r 'bisect(range)' |
|
640 | 641 | 11:82ca6f06eccd |
|
641 | 642 | 12:9f259202bbe7 |
|
642 | 643 | 13:b0a32c86eb31 |
|
643 | 644 | 15:857b178a7cf3 |
|
644 | 645 | 16:609d82a7ebae |
|
645 | 646 | 17:228c06deef46 |
|
646 | 647 | $ hg log -q -r 'bisect(pruned)' |
|
647 | 648 | 0:33b1f9bc8bc5 |
|
648 | 649 | 1:4ca5088da217 |
|
649 | 650 | 8:dab8161ac8fc |
|
650 | 651 | 11:82ca6f06eccd |
|
651 | 652 | 12:9f259202bbe7 |
|
652 | 653 | 13:b0a32c86eb31 |
|
653 | 654 | 15:857b178a7cf3 |
|
654 | 655 | 16:609d82a7ebae |
|
655 | 656 | 17:228c06deef46 |
|
656 | 657 | 18:d42e18c7bc9b |
|
657 | 658 | $ hg log -q -r 'bisect(untested)' |
|
658 | 659 | $ hg log -q -r 'bisect(ignored)' |
|
659 | 660 | 2:051e12f87bf1 |
|
660 | 661 | 3:0950834f0a9c |
|
661 | 662 | 4:5c668c22234f |
|
662 | 663 | 5:385a529b6670 |
|
663 | 664 | 6:a214d5d3811a |
|
664 | 665 | 9:3c77083deb4a |
|
665 | 666 | 10:429fcd26f52d |
|
666 | 667 | $ hg bisect --extend |
|
667 | 668 | Extending search to changeset 8:dab8161ac8fc |
|
668 | 669 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
669 | 670 | $ hg log -q -r 'bisect(untested)' |
|
670 | 671 | $ hg log -q -r 'bisect(ignored)' |
|
671 | 672 | 2:051e12f87bf1 |
|
672 | 673 | 3:0950834f0a9c |
|
673 | 674 | 4:5c668c22234f |
|
674 | 675 | 5:385a529b6670 |
|
675 | 676 | 6:a214d5d3811a |
|
676 | 677 | 9:3c77083deb4a |
|
677 | 678 | 10:429fcd26f52d |
|
678 | 679 | $ hg bisect -g # dab8161ac8fc |
|
679 | 680 | Testing changeset 9:3c77083deb4a (3 changesets remaining, ~1 tests) |
|
680 | 681 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
681 | 682 | $ hg log -q -r 'bisect(untested)' |
|
682 | 683 | 9:3c77083deb4a |
|
683 | 684 | 10:429fcd26f52d |
|
684 | 685 | $ hg log -q -r 'bisect(ignored)' |
|
685 | 686 | 2:051e12f87bf1 |
|
686 | 687 | 3:0950834f0a9c |
|
687 | 688 | 4:5c668c22234f |
|
688 | 689 | 5:385a529b6670 |
|
689 | 690 | 6:a214d5d3811a |
|
690 | 691 | $ hg log -q -r 'bisect(goods)' |
|
691 | 692 | 0:33b1f9bc8bc5 |
|
692 | 693 | 1:4ca5088da217 |
|
693 | 694 | 8:dab8161ac8fc |
|
694 | 695 | 11:82ca6f06eccd |
|
695 | 696 | 12:9f259202bbe7 |
|
696 | 697 | 13:b0a32c86eb31 |
|
697 | 698 | $ hg log -q -r 'bisect(bads)' |
|
698 | 699 | 15:857b178a7cf3 |
|
699 | 700 | 16:609d82a7ebae |
|
700 | 701 | 17:228c06deef46 |
|
701 | 702 | 18:d42e18c7bc9b |
|
702 | 703 | $ hg bisect -b |
|
703 | 704 | The first bad revision is: |
|
704 | 705 | changeset: 9:3c77083deb4a |
|
705 | 706 | user: test |
|
706 | 707 | date: Thu Jan 01 00:00:09 1970 +0000 |
|
707 | 708 | summary: 9 |
|
708 | 709 | |
|
709 | 710 | $ hg log -q -r 'bisect(range)' |
|
710 | 711 | 8:dab8161ac8fc |
|
711 | 712 | 9:3c77083deb4a |
|
712 | 713 | 10:429fcd26f52d |
|
713 | 714 | 11:82ca6f06eccd |
|
714 | 715 | 12:9f259202bbe7 |
|
715 | 716 | 13:b0a32c86eb31 |
|
716 | 717 | 15:857b178a7cf3 |
|
717 | 718 | 16:609d82a7ebae |
|
718 | 719 | 17:228c06deef46 |
|
719 | 720 | $ hg log -q -r 'bisect(pruned)' |
|
720 | 721 | 0:33b1f9bc8bc5 |
|
721 | 722 | 1:4ca5088da217 |
|
722 | 723 | 8:dab8161ac8fc |
|
723 | 724 | 9:3c77083deb4a |
|
724 | 725 | 10:429fcd26f52d |
|
725 | 726 | 11:82ca6f06eccd |
|
726 | 727 | 12:9f259202bbe7 |
|
727 | 728 | 13:b0a32c86eb31 |
|
728 | 729 | 15:857b178a7cf3 |
|
729 | 730 | 16:609d82a7ebae |
|
730 | 731 | 17:228c06deef46 |
|
731 | 732 | 18:d42e18c7bc9b |
|
732 | 733 | $ hg log -q -r 'bisect(untested)' |
|
733 | 734 | $ hg log -q -r 'bisect(ignored)' |
|
734 | 735 | 2:051e12f87bf1 |
|
735 | 736 | 3:0950834f0a9c |
|
736 | 737 | 4:5c668c22234f |
|
737 | 738 | 5:385a529b6670 |
|
738 | 739 | 6:a214d5d3811a |
|
739 | 740 | $ hg log -q -r 'bisect(goods)' |
|
740 | 741 | 0:33b1f9bc8bc5 |
|
741 | 742 | 1:4ca5088da217 |
|
742 | 743 | 8:dab8161ac8fc |
|
743 | 744 | 11:82ca6f06eccd |
|
744 | 745 | 12:9f259202bbe7 |
|
745 | 746 | 13:b0a32c86eb31 |
|
746 | 747 | $ hg log -q -r 'bisect(bads)' |
|
747 | 748 | 9:3c77083deb4a |
|
748 | 749 | 10:429fcd26f52d |
|
749 | 750 | 15:857b178a7cf3 |
|
750 | 751 | 16:609d82a7ebae |
|
751 | 752 | 17:228c06deef46 |
|
752 | 753 | 18:d42e18c7bc9b |
|
753 | 754 | |
|
754 | 755 | user adds irrelevant but consistent information (here: -g 2) to bisect state |
|
755 | 756 | |
|
756 | 757 | $ hg bisect -r |
|
757 | 758 | $ hg bisect -b 13 |
|
758 | 759 | $ hg bisect -g 8 |
|
759 | 760 | Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests) |
|
760 | 761 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
761 | 762 | $ hg log -q -r 'bisect(untested)' |
|
762 | 763 | 11:82ca6f06eccd |
|
763 | 764 | 12:9f259202bbe7 |
|
764 | 765 | $ hg bisect -g 2 |
|
765 | 766 | Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests) |
|
766 | 767 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
767 | 768 | $ hg log -q -r 'bisect(untested)' |
|
768 | 769 | 11:82ca6f06eccd |
|
769 | 770 | 12:9f259202bbe7 |
|
770 | 771 | $ hg bisect -b |
|
771 | 772 | The first bad revision is: |
|
772 | 773 | changeset: 11:82ca6f06eccd |
|
773 | 774 | parent: 8:dab8161ac8fc |
|
774 | 775 | user: test |
|
775 | 776 | date: Thu Jan 01 00:00:11 1970 +0000 |
|
776 | 777 | summary: 11 |
|
777 | 778 | |
|
778 | 779 | $ hg log -q -r 'bisect(range)' |
|
779 | 780 | 8:dab8161ac8fc |
|
780 | 781 | 11:82ca6f06eccd |
|
781 | 782 | 12:9f259202bbe7 |
|
782 | 783 | 13:b0a32c86eb31 |
|
783 | 784 | $ hg log -q -r 'bisect(pruned)' |
|
784 | 785 | 0:33b1f9bc8bc5 |
|
785 | 786 | 1:4ca5088da217 |
|
786 | 787 | 2:051e12f87bf1 |
|
787 | 788 | 8:dab8161ac8fc |
|
788 | 789 | 11:82ca6f06eccd |
|
789 | 790 | 12:9f259202bbe7 |
|
790 | 791 | 13:b0a32c86eb31 |
|
791 | 792 | 14:faa450606157 |
|
792 | 793 | 15:857b178a7cf3 |
|
793 | 794 | 16:609d82a7ebae |
|
794 | 795 | 17:228c06deef46 |
|
795 | 796 | 18:d42e18c7bc9b |
|
796 | 797 | $ hg log -q -r 'bisect(untested)' |
@@ -1,223 +1,224 | |||
|
1 | 1 | setup |
|
2 | 2 | $ cat >> $HGRCPATH <<EOF |
|
3 | 3 | > [extensions] |
|
4 | 4 | > blackbox= |
|
5 | 5 | > mock=$TESTDIR/mockblackbox.py |
|
6 | 6 | > mq= |
|
7 | 7 | > [alias] |
|
8 | 8 | > confuse = log --limit 3 |
|
9 | 9 | > EOF |
|
10 | 10 | $ hg init blackboxtest |
|
11 | 11 | $ cd blackboxtest |
|
12 | 12 | |
|
13 | 13 | command, exit codes, and duration |
|
14 | 14 | |
|
15 | 15 | $ echo a > a |
|
16 | 16 | $ hg add a |
|
17 | 17 | $ hg blackbox --config blackbox.dirty=True |
|
18 | 18 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a |
|
19 | 19 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) |
|
20 | 20 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox |
|
21 | 21 | |
|
22 | 22 | alias expansion is logged |
|
23 | 23 | $ hg confuse |
|
24 | 24 | $ hg blackbox |
|
25 | 25 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a |
|
26 | 26 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) |
|
27 | 27 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox |
|
28 | 28 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* exited 0 after * seconds (glob) |
|
29 | 29 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse |
|
30 | 30 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3' |
|
31 | 31 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob) |
|
32 | 32 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox |
|
33 | 33 | |
|
34 | 34 | incoming change tracking |
|
35 | 35 | |
|
36 | 36 | create two heads to verify that we only see one change in the log later |
|
37 | 37 | $ hg commit -ma |
|
38 | 38 | $ hg up null |
|
39 | 39 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
40 | 40 | $ echo b > b |
|
41 | 41 | $ hg commit -Amb |
|
42 | 42 | adding b |
|
43 | 43 | created new head |
|
44 | 44 | |
|
45 | 45 | clone, commit, pull |
|
46 | 46 | $ hg clone . ../blackboxtest2 |
|
47 | 47 | updating to branch default |
|
48 | 48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
49 | 49 | $ echo c > c |
|
50 | 50 | $ hg commit -Amc |
|
51 | 51 | adding c |
|
52 | 52 | $ cd ../blackboxtest2 |
|
53 | 53 | $ hg pull |
|
54 | 54 | pulling from $TESTTMP/blackboxtest (glob) |
|
55 | 55 | searching for changes |
|
56 | 56 | adding changesets |
|
57 | 57 | adding manifests |
|
58 | 58 | adding file changes |
|
59 | 59 | added 1 changesets with 1 changes to 1 files |
|
60 | 60 | (run 'hg update' to get a working copy) |
|
61 | 61 | $ hg blackbox -l 6 |
|
62 | 62 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull |
|
63 | 63 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated served branch cache in * seconds (glob) |
|
64 | 64 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote served branch cache with 1 labels and 2 nodes |
|
65 | 65 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62 |
|
66 | 66 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob) |
|
67 | 67 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6 |
|
68 | 68 | |
|
69 | 69 | we must not cause a failure if we cannot write to the log |
|
70 | 70 | |
|
71 | 71 | $ hg rollback |
|
72 | 72 | repository tip rolled back to revision 1 (undo pull) |
|
73 | 73 | |
|
74 | 74 | $ mv .hg/blackbox.log .hg/blackbox.log- |
|
75 | 75 | $ mkdir .hg/blackbox.log |
|
76 | 76 | $ hg --debug incoming |
|
77 | 77 | warning: cannot write to blackbox.log: * (glob) |
|
78 | 78 | comparing with $TESTTMP/blackboxtest (glob) |
|
79 | 79 | query 1; heads |
|
80 | 80 | searching for changes |
|
81 | 81 | all local heads known remotely |
|
82 | 82 | changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51 |
|
83 | 83 | tag: tip |
|
84 | 84 | phase: draft |
|
85 | 85 | parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06 |
|
86 | 86 | parent: -1:0000000000000000000000000000000000000000 |
|
87 | 87 | manifest: 2:ab9d46b053ebf45b7996f2922b9893ff4b63d892 |
|
88 | 88 | user: test |
|
89 | 89 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
90 | 90 | files+: c |
|
91 | 91 | extra: branch=default |
|
92 | 92 | description: |
|
93 | 93 | c |
|
94 | 94 | |
|
95 | 95 | |
|
96 | 96 | $ hg pull |
|
97 | 97 | pulling from $TESTTMP/blackboxtest (glob) |
|
98 | 98 | searching for changes |
|
99 | 99 | adding changesets |
|
100 | 100 | adding manifests |
|
101 | 101 | adding file changes |
|
102 | 102 | added 1 changesets with 1 changes to 1 files |
|
103 | 103 | (run 'hg update' to get a working copy) |
|
104 | 104 | |
|
105 | 105 | a failure reading from the log is fatal |
|
106 | 106 | |
|
107 | 107 | $ hg blackbox -l 3 |
|
108 | 108 | abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob) |
|
109 | 109 | [255] |
|
110 | 110 | |
|
111 | 111 | $ rmdir .hg/blackbox.log |
|
112 | 112 | $ mv .hg/blackbox.log- .hg/blackbox.log |
|
113 | 113 | |
|
114 | 114 | backup bundles get logged |
|
115 | 115 | |
|
116 | 116 | $ touch d |
|
117 | 117 | $ hg commit -Amd |
|
118 | 118 | adding d |
|
119 | 119 | created new head |
|
120 | 120 | $ hg strip tip |
|
121 | 121 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
122 | 122 | saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob) |
|
123 | 123 | $ hg blackbox -l 6 |
|
124 | 124 | 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip |
|
125 | 125 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg (glob) |
|
126 | 126 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated base branch cache in * seconds (glob) |
|
127 | 127 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote base branch cache with 1 labels and 2 nodes |
|
128 | 128 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob) |
|
129 | 129 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6 |
|
130 | 130 | |
|
131 | 131 | extension and python hooks - use the eol extension for a pythonhook |
|
132 | 132 | |
|
133 | 133 | $ echo '[extensions]' >> .hg/hgrc |
|
134 | 134 | $ echo 'eol=' >> .hg/hgrc |
|
135 | 135 | $ echo '[hooks]' >> .hg/hgrc |
|
136 | 136 | $ echo 'update = echo hooked' >> .hg/hgrc |
|
137 | 137 | $ hg update |
|
138 | 138 | hooked |
|
139 | 139 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
140 | updated to "d02f48003e62: c" | |
|
140 | 141 | 1 other heads for branch "default" |
|
141 | 142 | $ hg blackbox -l 6 |
|
142 | 143 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update |
|
143 | 144 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> writing .hg/cache/tags2-visible with 0 tags |
|
144 | 145 | 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob) |
|
145 | 146 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob) |
|
146 | 147 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob) |
|
147 | 148 | 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 6 |
|
148 | 149 | |
|
149 | 150 | log rotation |
|
150 | 151 | |
|
151 | 152 | $ echo '[blackbox]' >> .hg/hgrc |
|
152 | 153 | $ echo 'maxsize = 20 b' >> .hg/hgrc |
|
153 | 154 | $ echo 'maxfiles = 3' >> .hg/hgrc |
|
154 | 155 | $ hg status |
|
155 | 156 | $ hg status |
|
156 | 157 | $ hg status |
|
157 | 158 | $ hg tip -q |
|
158 | 159 | 2:d02f48003e62 |
|
159 | 160 | $ ls .hg/blackbox.log* |
|
160 | 161 | .hg/blackbox.log |
|
161 | 162 | .hg/blackbox.log.1 |
|
162 | 163 | .hg/blackbox.log.2 |
|
163 | 164 | $ cd .. |
|
164 | 165 | |
|
165 | 166 | $ hg init blackboxtest3 |
|
166 | 167 | $ cd blackboxtest3 |
|
167 | 168 | $ hg blackbox |
|
168 | 169 | 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox |
|
169 | 170 | $ mv .hg/blackbox.log .hg/blackbox.log- |
|
170 | 171 | $ mkdir .hg/blackbox.log |
|
171 | 172 | $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\ |
|
172 | 173 | > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\ |
|
173 | 174 | > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py |
|
174 | 175 | $ python $TESTDIR/blackbox-readonly-dispatch.py |
|
175 | 176 | running: add foo |
|
176 | 177 | result: 0 |
|
177 | 178 | running: commit -m commit1 -d 2000-01-01 foo |
|
178 | 179 | result: None |
|
179 | 180 | running: commit -m commit2 -d 2000-01-02 foo |
|
180 | 181 | result: None |
|
181 | 182 | running: log -r 0 |
|
182 | 183 | changeset: 0:0e4634943879 |
|
183 | 184 | user: test |
|
184 | 185 | date: Sat Jan 01 00:00:00 2000 +0000 |
|
185 | 186 | summary: commit1 |
|
186 | 187 | |
|
187 | 188 | result: None |
|
188 | 189 | running: log -r tip |
|
189 | 190 | changeset: 1:45589e459b2e |
|
190 | 191 | tag: tip |
|
191 | 192 | user: test |
|
192 | 193 | date: Sun Jan 02 00:00:00 2000 +0000 |
|
193 | 194 | summary: commit2 |
|
194 | 195 | |
|
195 | 196 | result: None |
|
196 | 197 | $ hg blackbox |
|
197 | 198 | 1970/01/01 00:00:00 bob @0e46349438790c460c5c9f7546bfcd39b267bbd2 (5000)> commit -m commit2 -d 2000-01-02 foo |
|
198 | 199 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob) |
|
199 | 200 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes |
|
200 | 201 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> commit -m commit2 -d 2000-01-02 foo exited 0 after * seconds (glob) |
|
201 | 202 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r 0 |
|
202 | 203 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags |
|
203 | 204 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r 0 exited 0 after * seconds (glob) |
|
204 | 205 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r tip |
|
205 | 206 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r tip exited 0 after * seconds (glob) |
|
206 | 207 | 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox |
|
207 | 208 | |
|
208 | 209 | Test log recursion from dirty status check |
|
209 | 210 | |
|
210 | 211 | $ cat > ../r.py <<EOF |
|
211 | 212 | > from mercurial import context, error, extensions |
|
212 | 213 | > x=[False] |
|
213 | 214 | > def status(orig, *args, **opts): |
|
214 | 215 | > args[0].repo().ui.log("broken", "recursion?") |
|
215 | 216 | > return orig(*args, **opts) |
|
216 | 217 | > def reposetup(ui, repo): |
|
217 | 218 | > extensions.wrapfunction(context.basectx, 'status', status) |
|
218 | 219 | > EOF |
|
219 | 220 | $ hg id --config extensions.x=../r.py --config blackbox.dirty=True |
|
220 | 221 | 45589e459b2e tip |
|
221 | 222 | |
|
222 | 223 | cleanup |
|
223 | 224 | $ cd .. |
@@ -1,279 +1,281 | |||
|
1 | 1 | $ hg init |
|
2 | 2 | $ cat << EOF > a |
|
3 | 3 | > Small Mathematical Series. |
|
4 | 4 | > One |
|
5 | 5 | > Two |
|
6 | 6 | > Three |
|
7 | 7 | > Four |
|
8 | 8 | > Five |
|
9 | 9 | > Hop we are done. |
|
10 | 10 | > EOF |
|
11 | 11 | $ hg add a |
|
12 | 12 | $ hg commit -m ancestor |
|
13 | 13 | $ cat << EOF > a |
|
14 | 14 | > Small Mathematical Series. |
|
15 | 15 | > 1 |
|
16 | 16 | > 2 |
|
17 | 17 | > 3 |
|
18 | 18 | > 4 |
|
19 | 19 | > 5 |
|
20 | 20 | > Hop we are done. |
|
21 | 21 | > EOF |
|
22 | 22 | $ hg commit -m branch1 |
|
23 | 23 | $ hg co 0 |
|
24 | 24 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
25 | 25 | $ cat << EOF > a |
|
26 | 26 | > Small Mathematical Series. |
|
27 | 27 | > 1 |
|
28 | 28 | > 2 |
|
29 | 29 | > 3 |
|
30 | 30 | > 6 |
|
31 | 31 | > 8 |
|
32 | 32 | > Hop we are done. |
|
33 | 33 | > EOF |
|
34 | 34 | $ hg commit -m branch2 |
|
35 | 35 | created new head |
|
36 | 36 | |
|
37 | 37 | $ hg merge 1 |
|
38 | 38 | merging a |
|
39 | 39 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
40 | 40 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
41 | 41 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
42 | 42 | [1] |
|
43 | 43 | |
|
44 | 44 | $ hg id |
|
45 | 45 | 618808747361+c0c68e4fe667+ tip |
|
46 | 46 | |
|
47 | 47 | $ cat a |
|
48 | 48 | Small Mathematical Series. |
|
49 | 49 | 1 |
|
50 | 50 | 2 |
|
51 | 51 | 3 |
|
52 | 52 | <<<<<<< working copy: 618808747361 - test: branch2 |
|
53 | 53 | 6 |
|
54 | 54 | 8 |
|
55 | 55 | ======= |
|
56 | 56 | 4 |
|
57 | 57 | 5 |
|
58 | 58 | >>>>>>> merge rev: c0c68e4fe667 - test: branch1 |
|
59 | 59 | Hop we are done. |
|
60 | 60 | |
|
61 | 61 | $ hg status |
|
62 | 62 | M a |
|
63 | 63 | ? a.orig |
|
64 | 64 | |
|
65 | 65 | Verify custom conflict markers |
|
66 | 66 | |
|
67 | 67 | $ hg up -q --clean . |
|
68 | 68 | $ cat <<EOF >> .hg/hgrc |
|
69 | 69 | > [ui] |
|
70 | 70 | > mergemarkertemplate = '{author} {rev}' |
|
71 | 71 | > EOF |
|
72 | 72 | |
|
73 | 73 | $ hg merge 1 |
|
74 | 74 | merging a |
|
75 | 75 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
76 | 76 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
77 | 77 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
78 | 78 | [1] |
|
79 | 79 | |
|
80 | 80 | $ cat a |
|
81 | 81 | Small Mathematical Series. |
|
82 | 82 | 1 |
|
83 | 83 | 2 |
|
84 | 84 | 3 |
|
85 | 85 | <<<<<<< working copy: test 2 |
|
86 | 86 | 6 |
|
87 | 87 | 8 |
|
88 | 88 | ======= |
|
89 | 89 | 4 |
|
90 | 90 | 5 |
|
91 | 91 | >>>>>>> merge rev: test 1 |
|
92 | 92 | Hop we are done. |
|
93 | 93 | |
|
94 | 94 | Verify line splitting of custom conflict marker which causes multiple lines |
|
95 | 95 | |
|
96 | 96 | $ hg up -q --clean . |
|
97 | 97 | $ cat >> .hg/hgrc <<EOF |
|
98 | 98 | > [ui] |
|
99 | 99 | > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz |
|
100 | 100 | > EOF |
|
101 | 101 | |
|
102 | 102 | $ hg -q merge 1 |
|
103 | 103 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
104 | 104 | [1] |
|
105 | 105 | |
|
106 | 106 | $ cat a |
|
107 | 107 | Small Mathematical Series. |
|
108 | 108 | 1 |
|
109 | 109 | 2 |
|
110 | 110 | 3 |
|
111 | 111 | <<<<<<< working copy: test 2 |
|
112 | 112 | 6 |
|
113 | 113 | 8 |
|
114 | 114 | ======= |
|
115 | 115 | 4 |
|
116 | 116 | 5 |
|
117 | 117 | >>>>>>> merge rev: test 1 |
|
118 | 118 | Hop we are done. |
|
119 | 119 | |
|
120 | 120 | Verify line trimming of custom conflict marker using multi-byte characters |
|
121 | 121 | |
|
122 | 122 | $ hg up -q --clean . |
|
123 | 123 | $ python <<EOF |
|
124 | 124 | > fp = open('logfile', 'w') |
|
125 | 125 | > fp.write('12345678901234567890123456789012345678901234567890' + |
|
126 | 126 | > '1234567890') # there are 5 more columns for 80 columns |
|
127 | 127 | > |
|
128 | 128 | > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes |
|
129 | 129 | > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8')) |
|
130 | 130 | > |
|
131 | 131 | > fp.close() |
|
132 | 132 | > EOF |
|
133 | 133 | $ hg add logfile |
|
134 | 134 | $ hg --encoding utf-8 commit --logfile logfile |
|
135 | 135 | |
|
136 | 136 | $ cat >> .hg/hgrc <<EOF |
|
137 | 137 | > [ui] |
|
138 | 138 | > mergemarkertemplate={desc|firstline} |
|
139 | 139 | > EOF |
|
140 | 140 | |
|
141 | 141 | $ hg -q --encoding utf-8 merge 1 |
|
142 | 142 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
143 | 143 | [1] |
|
144 | 144 | |
|
145 | 145 | $ cat a |
|
146 | 146 | Small Mathematical Series. |
|
147 | 147 | 1 |
|
148 | 148 | 2 |
|
149 | 149 | 3 |
|
150 | 150 | <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345... |
|
151 | 151 | 6 |
|
152 | 152 | 8 |
|
153 | 153 | ======= |
|
154 | 154 | 4 |
|
155 | 155 | 5 |
|
156 | 156 | >>>>>>> merge rev: branch1 |
|
157 | 157 | Hop we are done. |
|
158 | 158 | |
|
159 | 159 | Verify basic conflict markers |
|
160 | 160 | |
|
161 | 161 | $ hg up -q --clean 2 |
|
162 | 162 | $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc |
|
163 | 163 | |
|
164 | 164 | $ hg merge 1 |
|
165 | 165 | merging a |
|
166 | 166 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
167 | 167 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
168 | 168 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
169 | 169 | [1] |
|
170 | 170 | |
|
171 | 171 | $ cat a |
|
172 | 172 | Small Mathematical Series. |
|
173 | 173 | 1 |
|
174 | 174 | 2 |
|
175 | 175 | 3 |
|
176 | 176 | <<<<<<< working copy |
|
177 | 177 | 6 |
|
178 | 178 | 8 |
|
179 | 179 | ======= |
|
180 | 180 | 4 |
|
181 | 181 | 5 |
|
182 | 182 | >>>>>>> merge rev |
|
183 | 183 | Hop we are done. |
|
184 | 184 | |
|
185 | 185 | internal:merge3 |
|
186 | 186 | |
|
187 | 187 | $ hg up -q --clean . |
|
188 | 188 | |
|
189 | 189 | $ hg merge 1 --tool internal:merge3 |
|
190 | 190 | merging a |
|
191 | 191 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
192 | 192 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
193 | 193 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
194 | 194 | [1] |
|
195 | 195 | $ cat a |
|
196 | 196 | Small Mathematical Series. |
|
197 | 197 | <<<<<<< working copy |
|
198 | 198 | 1 |
|
199 | 199 | 2 |
|
200 | 200 | 3 |
|
201 | 201 | 6 |
|
202 | 202 | 8 |
|
203 | 203 | ||||||| base |
|
204 | 204 | One |
|
205 | 205 | Two |
|
206 | 206 | Three |
|
207 | 207 | Four |
|
208 | 208 | Five |
|
209 | 209 | ======= |
|
210 | 210 | 1 |
|
211 | 211 | 2 |
|
212 | 212 | 3 |
|
213 | 213 | 4 |
|
214 | 214 | 5 |
|
215 | 215 | >>>>>>> merge rev |
|
216 | 216 | Hop we are done. |
|
217 | 217 | |
|
218 | 218 | Add some unconflicting changes on each head, to make sure we really |
|
219 | 219 | are merging, unlike :local and :other |
|
220 | 220 | |
|
221 | 221 | $ hg up -C |
|
222 | 222 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
223 | updated to "e0693e20f496: 123456789012345678901234567890123456789012345678901234567890????" | |
|
223 | 224 | 1 other heads for branch "default" |
|
224 | 225 | $ printf "\n\nEnd of file\n" >> a |
|
225 | 226 | $ hg ci -m "Add some stuff at the end" |
|
226 | 227 | $ hg up -r 1 |
|
227 | 228 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
228 | 229 | $ printf "Start of file\n\n\n" > tmp |
|
229 | 230 | $ cat a >> tmp |
|
230 | 231 | $ mv tmp a |
|
231 | 232 | $ hg ci -m "Add some stuff at the beginning" |
|
232 | 233 | |
|
233 | 234 | Now test :merge-other and :merge-local |
|
234 | 235 | |
|
235 | 236 | $ hg merge |
|
236 | 237 | merging a |
|
237 | 238 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
238 | 239 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
239 | 240 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
240 | 241 | [1] |
|
241 | 242 | $ hg resolve --tool :merge-other a |
|
242 | 243 | merging a |
|
243 | 244 | (no more unresolved files) |
|
244 | 245 | $ cat a |
|
245 | 246 | Start of file |
|
246 | 247 | |
|
247 | 248 | |
|
248 | 249 | Small Mathematical Series. |
|
249 | 250 | 1 |
|
250 | 251 | 2 |
|
251 | 252 | 3 |
|
252 | 253 | 6 |
|
253 | 254 | 8 |
|
254 | 255 | Hop we are done. |
|
255 | 256 | |
|
256 | 257 | |
|
257 | 258 | End of file |
|
258 | 259 | |
|
259 | 260 | $ hg up -C |
|
260 | 261 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
262 | updated to "18b51d585961: Add some stuff at the beginning" | |
|
261 | 263 | 1 other heads for branch "default" |
|
262 | 264 | $ hg merge --tool :merge-local |
|
263 | 265 | merging a |
|
264 | 266 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
265 | 267 | (branch merge, don't forget to commit) |
|
266 | 268 | $ cat a |
|
267 | 269 | Start of file |
|
268 | 270 | |
|
269 | 271 | |
|
270 | 272 | Small Mathematical Series. |
|
271 | 273 | 1 |
|
272 | 274 | 2 |
|
273 | 275 | 3 |
|
274 | 276 | 4 |
|
275 | 277 | 5 |
|
276 | 278 | Hop we are done. |
|
277 | 279 | |
|
278 | 280 | |
|
279 | 281 | End of file |
@@ -1,258 +1,259 | |||
|
1 | 1 | Create user cache directory |
|
2 | 2 | |
|
3 | 3 | $ USERCACHE=`pwd`/cache; export USERCACHE |
|
4 | 4 | $ cat <<EOF >> ${HGRCPATH} |
|
5 | 5 | > [extensions] |
|
6 | 6 | > hgext.largefiles= |
|
7 | 7 | > [largefiles] |
|
8 | 8 | > usercache=${USERCACHE} |
|
9 | 9 | > EOF |
|
10 | 10 | $ mkdir -p ${USERCACHE} |
|
11 | 11 | |
|
12 | 12 | Create source repo, and commit adding largefile. |
|
13 | 13 | |
|
14 | 14 | $ hg init src |
|
15 | 15 | $ cd src |
|
16 | 16 | $ echo large > large |
|
17 | 17 | $ hg add --large large |
|
18 | 18 | $ hg commit -m 'add largefile' |
|
19 | 19 | $ hg rm large |
|
20 | 20 | $ hg commit -m 'branchhead without largefile' large |
|
21 | 21 | $ hg up -qr 0 |
|
22 | 22 | $ rm large |
|
23 | 23 | $ echo "0000000000000000000000000000000000000000" > .hglf/large |
|
24 | 24 | $ hg commit -m 'commit missing file with corrupt standin' large |
|
25 | 25 | abort: large: file not found! |
|
26 | 26 | [255] |
|
27 | 27 | $ hg up -Cqr 0 |
|
28 | 28 | $ cd .. |
|
29 | 29 | |
|
30 | 30 | Discard all cached largefiles in USERCACHE |
|
31 | 31 | |
|
32 | 32 | $ rm -rf ${USERCACHE} |
|
33 | 33 | |
|
34 | 34 | Create mirror repo, and pull from source without largefile: |
|
35 | 35 | "pull" is used instead of "clone" for suppression of (1) updating to |
|
36 | 36 | tip (= caching largefile from source repo), and (2) recording source |
|
37 | 37 | repo as "default" path in .hg/hgrc. |
|
38 | 38 | |
|
39 | 39 | $ hg init mirror |
|
40 | 40 | $ cd mirror |
|
41 | 41 | $ hg pull ../src |
|
42 | 42 | pulling from ../src |
|
43 | 43 | requesting all changes |
|
44 | 44 | adding changesets |
|
45 | 45 | adding manifests |
|
46 | 46 | adding file changes |
|
47 | 47 | added 2 changesets with 1 changes to 1 files |
|
48 | 48 | (run 'hg update' to get a working copy) |
|
49 | 49 | |
|
50 | 50 | Update working directory to "tip", which requires largefile("large"), |
|
51 | 51 | but there is no cache file for it. So, hg must treat it as |
|
52 | 52 | "missing"(!) file. |
|
53 | 53 | |
|
54 | 54 | $ hg update -r0 |
|
55 | 55 | getting changed largefiles |
|
56 | 56 | large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob) |
|
57 | 57 | 0 largefiles updated, 0 removed |
|
58 | 58 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
59 | 59 | $ hg status |
|
60 | 60 | ! large |
|
61 | 61 | |
|
62 | 62 | Update working directory to null: this cleanup .hg/largefiles/dirstate |
|
63 | 63 | |
|
64 | 64 | $ hg update null |
|
65 | 65 | getting changed largefiles |
|
66 | 66 | 0 largefiles updated, 0 removed |
|
67 | 67 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
68 | 68 | |
|
69 | 69 | Update working directory to tip, again. |
|
70 | 70 | |
|
71 | 71 | $ hg update -r0 |
|
72 | 72 | getting changed largefiles |
|
73 | 73 | large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob) |
|
74 | 74 | 0 largefiles updated, 0 removed |
|
75 | 75 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
76 | 76 | $ hg status |
|
77 | 77 | ! large |
|
78 | 78 | $ cd .. |
|
79 | 79 | |
|
80 | 80 | Verify that largefiles from pulled branchheads are fetched, also to an empty repo |
|
81 | 81 | |
|
82 | 82 | $ hg init mirror2 |
|
83 | 83 | $ hg -R mirror2 pull src -r0 |
|
84 | 84 | pulling from src |
|
85 | 85 | adding changesets |
|
86 | 86 | adding manifests |
|
87 | 87 | adding file changes |
|
88 | 88 | added 1 changesets with 1 changes to 1 files |
|
89 | 89 | (run 'hg update' to get a working copy) |
|
90 | 90 | |
|
91 | 91 | #if unix-permissions |
|
92 | 92 | |
|
93 | 93 | Portable way to print file permissions: |
|
94 | 94 | |
|
95 | 95 | $ cat > ls-l.py <<EOF |
|
96 | 96 | > #!/usr/bin/env python |
|
97 | 97 | > import sys, os |
|
98 | 98 | > path = sys.argv[1] |
|
99 | 99 | > print '%03o' % (os.lstat(path).st_mode & 0777) |
|
100 | 100 | > EOF |
|
101 | 101 | $ chmod +x ls-l.py |
|
102 | 102 | |
|
103 | 103 | Test that files in .hg/largefiles inherit mode from .hg/store, not |
|
104 | 104 | from file in working copy: |
|
105 | 105 | |
|
106 | 106 | $ cd src |
|
107 | 107 | $ chmod 750 .hg/store |
|
108 | 108 | $ chmod 660 large |
|
109 | 109 | $ echo change >> large |
|
110 | 110 | $ hg commit -m change |
|
111 | 111 | created new head |
|
112 | 112 | $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea |
|
113 | 113 | 640 |
|
114 | 114 | |
|
115 | 115 | Test permission of with files in .hg/largefiles created by update: |
|
116 | 116 | |
|
117 | 117 | $ cd ../mirror |
|
118 | 118 | $ rm -r "$USERCACHE" .hg/largefiles # avoid links |
|
119 | 119 | $ chmod 750 .hg/store |
|
120 | 120 | $ hg pull ../src --update -q |
|
121 | 121 | $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea |
|
122 | 122 | 640 |
|
123 | 123 | |
|
124 | 124 | Test permission of files created by push: |
|
125 | 125 | |
|
126 | 126 | $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \ |
|
127 | 127 | > --config "web.allow_push=*" --config web.push_ssl=no |
|
128 | 128 | $ cat hg.pid >> $DAEMON_PIDS |
|
129 | 129 | |
|
130 | 130 | $ echo change >> large |
|
131 | 131 | $ hg commit -m change |
|
132 | 132 | |
|
133 | 133 | $ rm -r "$USERCACHE" |
|
134 | 134 | |
|
135 | 135 | $ hg push -q http://localhost:$HGPORT/ |
|
136 | 136 | |
|
137 | 137 | $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9 |
|
138 | 138 | 640 |
|
139 | 139 | |
|
140 | 140 | $ cd .. |
|
141 | 141 | |
|
142 | 142 | #endif |
|
143 | 143 | |
|
144 | 144 | Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say |
|
145 | 145 | it is missing, but a remove on a nonexistent unknown file still should. Same |
|
146 | 146 | for a forget.) |
|
147 | 147 | |
|
148 | 148 | $ cd src |
|
149 | 149 | $ touch x |
|
150 | 150 | $ hg add x |
|
151 | 151 | $ mv x y |
|
152 | 152 | $ hg remove -A x y ENOENT |
|
153 | 153 | ENOENT: * (glob) |
|
154 | 154 | not removing y: file is untracked |
|
155 | 155 | [1] |
|
156 | 156 | $ hg add y |
|
157 | 157 | $ mv y z |
|
158 | 158 | $ hg forget y z ENOENT |
|
159 | 159 | ENOENT: * (glob) |
|
160 | 160 | not removing z: file is already untracked |
|
161 | 161 | [1] |
|
162 | 162 | |
|
163 | 163 | Largefiles are accessible from the share's store |
|
164 | 164 | $ cd .. |
|
165 | 165 | $ hg share -q src share_dst --config extensions.share= |
|
166 | 166 | $ hg -R share_dst update -r0 |
|
167 | 167 | getting changed largefiles |
|
168 | 168 | 1 largefiles updated, 0 removed |
|
169 | 169 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
170 | 170 | |
|
171 | 171 | $ echo modified > share_dst/large |
|
172 | 172 | $ hg -R share_dst ci -m modified |
|
173 | 173 | created new head |
|
174 | 174 | |
|
175 | 175 | Only dirstate is in the local store for the share, and the largefile is in the |
|
176 | 176 | share source's local store. Avoid the extra largefiles added in the unix |
|
177 | 177 | conditional above. |
|
178 | 178 | $ hash=`hg -R share_dst cat share_dst/.hglf/large` |
|
179 | 179 | $ echo $hash |
|
180 | 180 | e2fb5f2139d086ded2cb600d5a91a196e76bf020 |
|
181 | 181 | |
|
182 | 182 | $ find share_dst/.hg/largefiles/* | sort |
|
183 | 183 | share_dst/.hg/largefiles/dirstate |
|
184 | 184 | |
|
185 | 185 | $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort |
|
186 | 186 | src/.hg/largefiles/dirstate |
|
187 | 187 | src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 |
|
188 | 188 | |
|
189 | 189 | Verify that backwards compatibility is maintained for old storage layout |
|
190 | 190 | $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles |
|
191 | 191 | $ hg verify --quiet --lfa -R share_dst --config largefiles.usercache= |
|
192 | 192 | |
|
193 | 193 | Inject corruption into the largefiles store and see how update handles that: |
|
194 | 194 | |
|
195 | 195 | $ cd src |
|
196 | 196 | $ hg up -qC tip |
|
197 | 197 | $ cat large |
|
198 | 198 | modified |
|
199 | 199 | $ rm large |
|
200 | 200 | $ cat .hglf/large |
|
201 | 201 | e2fb5f2139d086ded2cb600d5a91a196e76bf020 |
|
202 | 202 | $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 .. |
|
203 | 203 | $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 |
|
204 | 204 | $ hg up -C |
|
205 | 205 | getting changed largefiles |
|
206 | 206 | large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob) |
|
207 | 207 | 0 largefiles updated, 0 removed |
|
208 | 208 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
209 | updated to "cd24c147f45c: modified" | |
|
209 | 210 | [12] other heads for branch "default" (re) |
|
210 | 211 | $ hg st |
|
211 | 212 | ! large |
|
212 | 213 | ? z |
|
213 | 214 | $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 |
|
214 | 215 | |
|
215 | 216 | #if serve |
|
216 | 217 | |
|
217 | 218 | Test coverage of error handling from putlfile: |
|
218 | 219 | |
|
219 | 220 | $ mkdir $TESTTMP/mirrorcache |
|
220 | 221 | $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache |
|
221 | 222 | $ cat hg.pid >> $DAEMON_PIDS |
|
222 | 223 | |
|
223 | 224 | $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache |
|
224 | 225 | pushing to http://localhost:$HGPORT1/ |
|
225 | 226 | searching for changes |
|
226 | 227 | abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required (glob) |
|
227 | 228 | [255] |
|
228 | 229 | |
|
229 | 230 | $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 |
|
230 | 231 | |
|
231 | 232 | Test coverage of 'missing from store': |
|
232 | 233 | |
|
233 | 234 | $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no |
|
234 | 235 | $ cat hg.pid >> $DAEMON_PIDS |
|
235 | 236 | |
|
236 | 237 | $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache |
|
237 | 238 | pushing to http://localhost:$HGPORT2/ |
|
238 | 239 | searching for changes |
|
239 | 240 | abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded) |
|
240 | 241 | [255] |
|
241 | 242 | |
|
242 | 243 | Verify that --lfrev controls which revisions are checked for largefiles to push |
|
243 | 244 | |
|
244 | 245 | $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev tip |
|
245 | 246 | pushing to http://localhost:$HGPORT2/ |
|
246 | 247 | searching for changes |
|
247 | 248 | abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded) |
|
248 | 249 | [255] |
|
249 | 250 | |
|
250 | 251 | $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev null |
|
251 | 252 | pushing to http://localhost:$HGPORT2/ |
|
252 | 253 | searching for changes |
|
253 | 254 | remote: adding changesets |
|
254 | 255 | remote: adding manifests |
|
255 | 256 | remote: adding file changes |
|
256 | 257 | remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
257 | 258 | |
|
258 | 259 | #endif |
@@ -1,784 +1,788 | |||
|
1 | 1 | This file focuses mainly on updating largefiles in the working |
|
2 | 2 | directory (and ".hg/largefiles/dirstate") |
|
3 | 3 | |
|
4 | 4 | $ cat >> $HGRCPATH <<EOF |
|
5 | 5 | > [ui] |
|
6 | 6 | > merge = internal:fail |
|
7 | 7 | > [extensions] |
|
8 | 8 | > largefiles = |
|
9 | 9 | > [extdiff] |
|
10 | 10 | > # for portability: |
|
11 | 11 | > pdiff = sh "$RUNTESTDIR/pdiff" |
|
12 | 12 | > EOF |
|
13 | 13 | |
|
14 | 14 | $ hg init repo |
|
15 | 15 | $ cd repo |
|
16 | 16 | |
|
17 | 17 | $ echo large1 > large1 |
|
18 | 18 | $ echo large2 > large2 |
|
19 | 19 | $ hg add --large large1 large2 |
|
20 | 20 | $ echo normal1 > normal1 |
|
21 | 21 | $ hg add normal1 |
|
22 | 22 | $ hg commit -m '#0' |
|
23 | 23 | $ echo 'large1 in #1' > large1 |
|
24 | 24 | $ echo 'normal1 in #1' > normal1 |
|
25 | 25 | $ hg commit -m '#1' |
|
26 | 26 | $ hg pdiff -r '.^' --config extensions.extdiff= |
|
27 | 27 | diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1 |
|
28 | 28 | --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob) |
|
29 | 29 | +++ repo/.hglf/large1 * (glob) |
|
30 | 30 | @@ -1* +1* @@ (glob) |
|
31 | 31 | -4669e532d5b2c093a78eca010077e708a071bb64 |
|
32 | 32 | +58e24f733a964da346e2407a2bee99d9001184f5 |
|
33 | 33 | diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1 |
|
34 | 34 | --- repo.0d9d9b8dc9a3/normal1 * (glob) |
|
35 | 35 | +++ repo/normal1 * (glob) |
|
36 | 36 | @@ -1* +1* @@ (glob) |
|
37 | 37 | -normal1 |
|
38 | 38 | +normal1 in #1 |
|
39 | 39 | [1] |
|
40 | 40 | $ hg update -q -C 0 |
|
41 | 41 | $ echo 'large2 in #2' > large2 |
|
42 | 42 | $ hg commit -m '#2' |
|
43 | 43 | created new head |
|
44 | 44 | |
|
45 | 45 | Test that update also updates the lfdirstate of 'unsure' largefiles after |
|
46 | 46 | hashing them: |
|
47 | 47 | |
|
48 | 48 | The previous operations will usually have left us with largefiles with a mtime |
|
49 | 49 | within the same second as the dirstate was written. |
|
50 | 50 | The lfdirstate entries will thus have been written with an invalidated/unset |
|
51 | 51 | mtime to make sure further changes within the same second is detected. |
|
52 | 52 | We will however occasionally be "lucky" and get a tick between writing |
|
53 | 53 | largefiles and writing dirstate so we get valid lfdirstate timestamps. The |
|
54 | 54 | following verification is thus disabled but can be verified manually. |
|
55 | 55 | |
|
56 | 56 | #if false |
|
57 | 57 | $ hg debugdirstate --large --nodate |
|
58 | 58 | n 644 7 unset large1 |
|
59 | 59 | n 644 13 unset large2 |
|
60 | 60 | #endif |
|
61 | 61 | |
|
62 | 62 | Wait to make sure we get a tick so the mtime of the largefiles become valid. |
|
63 | 63 | |
|
64 | 64 | $ sleep 1 |
|
65 | 65 | |
|
66 | 66 | A linear merge will update standins before performing the actual merge. It will |
|
67 | 67 | do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and |
|
68 | 68 | update the corresponding standins. |
|
69 | 69 | Verify that it actually marks the clean files as clean in lfdirstate so |
|
70 | 70 | we don't have to hash them again next time we update. |
|
71 | 71 | |
|
72 | 72 | $ hg up |
|
73 | 73 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
74 | updated to "f74e50bd9e55: #2" | |
|
74 | 75 | 1 other heads for branch "default" |
|
75 | 76 | $ hg debugdirstate --large --nodate |
|
76 | 77 | n 644 7 set large1 |
|
77 | 78 | n 644 13 set large2 |
|
78 | 79 | |
|
79 | 80 | Test that lfdirstate keeps track of last modification of largefiles and |
|
80 | 81 | prevents unnecessary hashing of content - also after linear/noop update |
|
81 | 82 | |
|
82 | 83 | $ sleep 1 |
|
83 | 84 | $ hg st |
|
84 | 85 | $ hg debugdirstate --large --nodate |
|
85 | 86 | n 644 7 set large1 |
|
86 | 87 | n 644 13 set large2 |
|
87 | 88 | $ hg up |
|
88 | 89 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | updated to "f74e50bd9e55: #2" | |
|
89 | 91 | 1 other heads for branch "default" |
|
90 | 92 | $ hg debugdirstate --large --nodate |
|
91 | 93 | n 644 7 set large1 |
|
92 | 94 | n 644 13 set large2 |
|
93 | 95 | |
|
94 | 96 | Test that "hg merge" updates largefiles from "other" correctly |
|
95 | 97 | |
|
96 | 98 | (getting largefiles from "other" normally) |
|
97 | 99 | |
|
98 | 100 | $ hg status -A large1 |
|
99 | 101 | C large1 |
|
100 | 102 | $ cat large1 |
|
101 | 103 | large1 |
|
102 | 104 | $ cat .hglf/large1 |
|
103 | 105 | 4669e532d5b2c093a78eca010077e708a071bb64 |
|
104 | 106 | $ hg merge --config debug.dirstate.delaywrite=2 |
|
105 | 107 | getting changed largefiles |
|
106 | 108 | 1 largefiles updated, 0 removed |
|
107 | 109 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
108 | 110 | (branch merge, don't forget to commit) |
|
109 | 111 | $ hg status -A large1 |
|
110 | 112 | M large1 |
|
111 | 113 | $ cat large1 |
|
112 | 114 | large1 in #1 |
|
113 | 115 | $ cat .hglf/large1 |
|
114 | 116 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
115 | 117 | $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' |
|
116 | 118 | -4669e532d5b2c093a78eca010077e708a071bb64 |
|
117 | 119 | +58e24f733a964da346e2407a2bee99d9001184f5 |
|
118 | 120 | |
|
119 | 121 | (getting largefiles from "other" via conflict prompt) |
|
120 | 122 | |
|
121 | 123 | $ hg update -q -C 2 |
|
122 | 124 | $ echo 'large1 in #3' > large1 |
|
123 | 125 | $ echo 'normal1 in #3' > normal1 |
|
124 | 126 | $ hg commit -m '#3' |
|
125 | 127 | $ cat .hglf/large1 |
|
126 | 128 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
127 | 129 | $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF |
|
128 | 130 | > o |
|
129 | 131 | > EOF |
|
130 | 132 | largefile large1 has a merge conflict |
|
131 | 133 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
132 | 134 | keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or |
|
133 | 135 | take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o |
|
134 | 136 | merging normal1 |
|
135 | 137 | warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') |
|
136 | 138 | getting changed largefiles |
|
137 | 139 | 1 largefiles updated, 0 removed |
|
138 | 140 | 0 files updated, 1 files merged, 0 files removed, 1 files unresolved |
|
139 | 141 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
140 | 142 | [1] |
|
141 | 143 | $ hg status -A large1 |
|
142 | 144 | M large1 |
|
143 | 145 | $ cat large1 |
|
144 | 146 | large1 in #1 |
|
145 | 147 | $ cat .hglf/large1 |
|
146 | 148 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
147 | 149 | $ rm normal1.orig |
|
148 | 150 | |
|
149 | 151 | (merge non-existing largefiles from "other" via conflict prompt - |
|
150 | 152 | make sure the following commit doesn't abort in a confusing way when trying to |
|
151 | 153 | mark the non-existing file as normal in lfdirstate) |
|
152 | 154 | |
|
153 | 155 | $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 . |
|
154 | 156 | $ hg update -q -C 3 |
|
155 | 157 | $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF |
|
156 | 158 | > o |
|
157 | 159 | > EOF |
|
158 | 160 | largefile large1 has a merge conflict |
|
159 | 161 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
160 | 162 | keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or |
|
161 | 163 | take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o |
|
162 | 164 | getting changed largefiles |
|
163 | 165 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) |
|
164 | 166 | 0 largefiles updated, 0 removed |
|
165 | 167 | 0 files updated, 2 files merged, 0 files removed, 0 files unresolved |
|
166 | 168 | (branch merge, don't forget to commit) |
|
167 | 169 | $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not |
|
168 | 170 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store |
|
169 | 171 | $ hg up -C . --config largefiles.usercache=not |
|
170 | 172 | getting changed largefiles |
|
171 | 173 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) |
|
172 | 174 | 0 largefiles updated, 0 removed |
|
173 | 175 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
174 | 176 | $ hg st large1 |
|
175 | 177 | ! large1 |
|
176 | 178 | $ hg rollback -q |
|
177 | 179 | $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/ |
|
178 | 180 | |
|
179 | 181 | Test that "hg revert -r REV" updates largefiles from "REV" correctly |
|
180 | 182 | |
|
181 | 183 | $ hg update -q -C 3 |
|
182 | 184 | $ hg status -A large1 |
|
183 | 185 | C large1 |
|
184 | 186 | $ cat large1 |
|
185 | 187 | large1 in #3 |
|
186 | 188 | $ cat .hglf/large1 |
|
187 | 189 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
188 | 190 | $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' |
|
189 | 191 | -4669e532d5b2c093a78eca010077e708a071bb64 |
|
190 | 192 | +58e24f733a964da346e2407a2bee99d9001184f5 |
|
191 | 193 | $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1 |
|
192 | 194 | $ hg status -A large1 |
|
193 | 195 | M large1 |
|
194 | 196 | $ cat large1 |
|
195 | 197 | large1 in #1 |
|
196 | 198 | $ cat .hglf/large1 |
|
197 | 199 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
198 | 200 | |
|
199 | 201 | Test that "hg rollback" restores status of largefiles correctly |
|
200 | 202 | |
|
201 | 203 | $ hg update -C -q |
|
202 | 204 | $ hg remove large1 |
|
203 | 205 | $ test -f .hglf/large1 |
|
204 | 206 | [1] |
|
205 | 207 | $ hg forget large2 |
|
206 | 208 | $ test -f .hglf/large2 |
|
207 | 209 | [1] |
|
208 | 210 | $ echo largeX > largeX |
|
209 | 211 | $ hg add --large largeX |
|
210 | 212 | $ cat .hglf/largeX |
|
211 | 213 | |
|
212 | 214 | $ hg commit -m 'will be rollback-ed soon' |
|
213 | 215 | $ echo largeY > largeY |
|
214 | 216 | $ hg add --large largeY |
|
215 | 217 | #if windows |
|
216 | 218 | $ hg status -A large1 |
|
217 | 219 | large1: * (glob) |
|
218 | 220 | #else |
|
219 | 221 | $ hg status -A large1 |
|
220 | 222 | large1: No such file or directory |
|
221 | 223 | #endif |
|
222 | 224 | $ hg status -A large2 |
|
223 | 225 | ? large2 |
|
224 | 226 | $ hg status -A largeX |
|
225 | 227 | C largeX |
|
226 | 228 | $ hg status -A largeY |
|
227 | 229 | A largeY |
|
228 | 230 | $ hg rollback |
|
229 | 231 | repository tip rolled back to revision 3 (undo commit) |
|
230 | 232 | working directory now based on revision 3 |
|
231 | 233 | $ hg status -A large1 |
|
232 | 234 | R large1 |
|
233 | 235 | $ test -f .hglf/large1 |
|
234 | 236 | [1] |
|
235 | 237 | $ hg status -A large2 |
|
236 | 238 | R large2 |
|
237 | 239 | $ test -f .hglf/large2 |
|
238 | 240 | [1] |
|
239 | 241 | $ hg status -A largeX |
|
240 | 242 | A largeX |
|
241 | 243 | $ cat .hglf/largeX |
|
242 | 244 | |
|
243 | 245 | $ hg status -A largeY |
|
244 | 246 | ? largeY |
|
245 | 247 | $ test -f .hglf/largeY |
|
246 | 248 | [1] |
|
247 | 249 | $ rm largeY |
|
248 | 250 | |
|
249 | 251 | Test that "hg rollback" restores standins correctly |
|
250 | 252 | |
|
251 | 253 | $ hg commit -m 'will be rollback-ed soon' |
|
252 | 254 | $ hg update -q -C 2 |
|
253 | 255 | $ cat large1 |
|
254 | 256 | large1 |
|
255 | 257 | $ cat .hglf/large1 |
|
256 | 258 | 4669e532d5b2c093a78eca010077e708a071bb64 |
|
257 | 259 | $ cat large2 |
|
258 | 260 | large2 in #2 |
|
259 | 261 | $ cat .hglf/large2 |
|
260 | 262 | 3cfce6277e7668985707b6887ce56f9f62f6ccd9 |
|
261 | 263 | |
|
262 | 264 | $ hg rollback -q -f |
|
263 | 265 | $ cat large1 |
|
264 | 266 | large1 |
|
265 | 267 | $ cat .hglf/large1 |
|
266 | 268 | 4669e532d5b2c093a78eca010077e708a071bb64 |
|
267 | 269 | $ cat large2 |
|
268 | 270 | large2 in #2 |
|
269 | 271 | $ cat .hglf/large2 |
|
270 | 272 | 3cfce6277e7668985707b6887ce56f9f62f6ccd9 |
|
271 | 273 | |
|
272 | 274 | (rollback the parent of the working directory, when the parent of it |
|
273 | 275 | is not branch-tip) |
|
274 | 276 | |
|
275 | 277 | $ hg update -q -C 1 |
|
276 | 278 | $ cat .hglf/large1 |
|
277 | 279 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
278 | 280 | $ cat .hglf/large2 |
|
279 | 281 | 1deebade43c8c498a3c8daddac0244dc55d1331d |
|
280 | 282 | |
|
281 | 283 | $ echo normalX > normalX |
|
282 | 284 | $ hg add normalX |
|
283 | 285 | $ hg commit -m 'will be rollback-ed soon' |
|
284 | 286 | $ hg rollback -q |
|
285 | 287 | |
|
286 | 288 | $ cat .hglf/large1 |
|
287 | 289 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
288 | 290 | $ cat .hglf/large2 |
|
289 | 291 | 1deebade43c8c498a3c8daddac0244dc55d1331d |
|
290 | 292 | $ rm normalX |
|
291 | 293 | |
|
292 | 294 | Test that "hg status" shows status of largefiles correctly just after |
|
293 | 295 | automated commit like rebase/transplant |
|
294 | 296 | |
|
295 | 297 | $ cat >> .hg/hgrc <<EOF |
|
296 | 298 | > [extensions] |
|
297 | 299 | > rebase = |
|
298 | 300 | > strip = |
|
299 | 301 | > transplant = |
|
300 | 302 | > EOF |
|
301 | 303 | $ hg update -q -C 1 |
|
302 | 304 | $ hg remove large1 |
|
303 | 305 | $ echo largeX > largeX |
|
304 | 306 | $ hg add --large largeX |
|
305 | 307 | $ hg commit -m '#4' |
|
306 | 308 | |
|
307 | 309 | $ hg rebase -s 1 -d 2 --keep |
|
308 | 310 | rebasing 1:72518492caa6 "#1" |
|
309 | 311 | rebasing 4:07d6153b5c04 "#4" (tip) |
|
310 | 312 | #if windows |
|
311 | 313 | $ hg status -A large1 |
|
312 | 314 | large1: * (glob) |
|
313 | 315 | #else |
|
314 | 316 | $ hg status -A large1 |
|
315 | 317 | large1: No such file or directory |
|
316 | 318 | #endif |
|
317 | 319 | $ hg status -A largeX |
|
318 | 320 | C largeX |
|
319 | 321 | $ hg strip -q 5 |
|
320 | 322 | |
|
321 | 323 | $ hg update -q -C 2 |
|
322 | 324 | $ hg transplant -q 1 4 |
|
323 | 325 | #if windows |
|
324 | 326 | $ hg status -A large1 |
|
325 | 327 | large1: * (glob) |
|
326 | 328 | #else |
|
327 | 329 | $ hg status -A large1 |
|
328 | 330 | large1: No such file or directory |
|
329 | 331 | #endif |
|
330 | 332 | $ hg status -A largeX |
|
331 | 333 | C largeX |
|
332 | 334 | $ hg strip -q 5 |
|
333 | 335 | |
|
334 | 336 | $ hg update -q -C 2 |
|
335 | 337 | $ hg transplant -q --merge 1 --merge 4 |
|
336 | 338 | #if windows |
|
337 | 339 | $ hg status -A large1 |
|
338 | 340 | large1: * (glob) |
|
339 | 341 | #else |
|
340 | 342 | $ hg status -A large1 |
|
341 | 343 | large1: No such file or directory |
|
342 | 344 | #endif |
|
343 | 345 | $ hg status -A largeX |
|
344 | 346 | C largeX |
|
345 | 347 | $ hg strip -q 5 |
|
346 | 348 | |
|
347 | 349 | Test that linear merge can detect modification (and conflict) correctly |
|
348 | 350 | |
|
349 | 351 | (linear merge without conflict) |
|
350 | 352 | |
|
351 | 353 | $ echo 'large2 for linear merge (no conflict)' > large2 |
|
352 | 354 | $ hg update 3 --config debug.dirstate.delaywrite=2 |
|
353 | 355 | getting changed largefiles |
|
354 | 356 | 1 largefiles updated, 0 removed |
|
355 | 357 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
356 | 358 | $ hg status -A large2 |
|
357 | 359 | M large2 |
|
358 | 360 | $ cat large2 |
|
359 | 361 | large2 for linear merge (no conflict) |
|
360 | 362 | $ cat .hglf/large2 |
|
361 | 363 | 9c4bf8f1b33536d6e5f89447e10620cfe52ea710 |
|
362 | 364 | |
|
363 | 365 | (linear merge with conflict, choosing "other") |
|
364 | 366 | |
|
365 | 367 | $ hg update -q -C 2 |
|
366 | 368 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
367 | 369 | $ hg update 3 --config ui.interactive=True <<EOF |
|
368 | 370 | > o |
|
369 | 371 | > EOF |
|
370 | 372 | largefile large1 has a merge conflict |
|
371 | 373 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
372 | 374 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
373 | 375 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o |
|
374 | 376 | getting changed largefiles |
|
375 | 377 | 1 largefiles updated, 0 removed |
|
376 | 378 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
377 | 379 | $ hg status -A large1 |
|
378 | 380 | C large1 |
|
379 | 381 | $ cat large1 |
|
380 | 382 | large1 in #3 |
|
381 | 383 | $ cat .hglf/large1 |
|
382 | 384 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
383 | 385 | |
|
384 | 386 | (linear merge with conflict, choosing "local") |
|
385 | 387 | |
|
386 | 388 | $ hg update -q -C 2 |
|
387 | 389 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
388 | 390 | $ hg update 3 --config debug.dirstate.delaywrite=2 |
|
389 | 391 | largefile large1 has a merge conflict |
|
390 | 392 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
391 | 393 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
392 | 394 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
393 | 395 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
394 | 396 | $ hg status -A large1 |
|
395 | 397 | M large1 |
|
396 | 398 | $ cat large1 |
|
397 | 399 | large1 for linear merge (conflict) |
|
398 | 400 | $ cat .hglf/large1 |
|
399 | 401 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
400 | 402 | |
|
401 | 403 | Test a linear merge to a revision containing same-name normal file |
|
402 | 404 | |
|
403 | 405 | $ hg update -q -C 3 |
|
404 | 406 | $ hg remove large2 |
|
405 | 407 | $ echo 'large2 as normal file' > large2 |
|
406 | 408 | $ hg add large2 |
|
407 | 409 | $ echo 'large3 as normal file' > large3 |
|
408 | 410 | $ hg add large3 |
|
409 | 411 | $ hg commit -m '#5' |
|
410 | 412 | $ hg manifest |
|
411 | 413 | .hglf/large1 |
|
412 | 414 | large2 |
|
413 | 415 | large3 |
|
414 | 416 | normal1 |
|
415 | 417 | |
|
416 | 418 | (modified largefile is already switched to normal) |
|
417 | 419 | |
|
418 | 420 | $ hg update -q -C 2 |
|
419 | 421 | $ echo 'modified large2 for linear merge' > large2 |
|
420 | 422 | $ hg update -q 5 |
|
421 | 423 | remote turned local largefile large2 into a normal file |
|
422 | 424 | keep (l)argefile or use (n)ormal file? l |
|
423 | 425 | $ hg debugdirstate --nodates | grep large2 |
|
424 | 426 | a 0 -1 unset .hglf/large2 |
|
425 | 427 | r 0 0 set large2 |
|
426 | 428 | $ hg status -A large2 |
|
427 | 429 | A large2 |
|
428 | 430 | $ cat large2 |
|
429 | 431 | modified large2 for linear merge |
|
430 | 432 | |
|
431 | 433 | (added largefile is already committed as normal) |
|
432 | 434 | |
|
433 | 435 | $ hg update -q -C 2 |
|
434 | 436 | $ echo 'large3 as large file for linear merge' > large3 |
|
435 | 437 | $ hg add --large large3 |
|
436 | 438 | $ hg update -q 5 |
|
437 | 439 | remote turned local largefile large3 into a normal file |
|
438 | 440 | keep (l)argefile or use (n)ormal file? l |
|
439 | 441 | $ hg debugdirstate --nodates | grep large3 |
|
440 | 442 | a 0 -1 unset .hglf/large3 |
|
441 | 443 | r 0 0 set large3 |
|
442 | 444 | $ hg status -A large3 |
|
443 | 445 | A large3 |
|
444 | 446 | $ cat large3 |
|
445 | 447 | large3 as large file for linear merge |
|
446 | 448 | $ rm -f large3 .hglf/large3 |
|
447 | 449 | |
|
448 | 450 | Test that the internal linear merging works correctly |
|
449 | 451 | (both heads are stripped to keep pairing of revision number and commit log) |
|
450 | 452 | |
|
451 | 453 | $ hg update -q -C 2 |
|
452 | 454 | $ hg strip 3 4 |
|
453 | 455 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob) |
|
454 | 456 | $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP |
|
455 | 457 | |
|
456 | 458 | (internal linear merging at "hg pull --update") |
|
457 | 459 | |
|
458 | 460 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
459 | 461 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 |
|
460 | 462 | $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg |
|
461 | 463 | pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob) |
|
462 | 464 | searching for changes |
|
463 | 465 | adding changesets |
|
464 | 466 | adding manifests |
|
465 | 467 | adding file changes |
|
466 | 468 | added 3 changesets with 5 changes to 5 files |
|
467 | 469 | remote turned local largefile large2 into a normal file |
|
468 | 470 | keep (l)argefile or use (n)ormal file? l |
|
469 | 471 | largefile large1 has a merge conflict |
|
470 | 472 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
471 | 473 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
472 | 474 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
473 | 475 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
476 | updated to "d65e59e952a9: #5" | |
|
474 | 477 | 1 other heads for branch "default" |
|
475 | 478 | |
|
476 | 479 | $ hg status -A large1 |
|
477 | 480 | M large1 |
|
478 | 481 | $ cat large1 |
|
479 | 482 | large1 for linear merge (conflict) |
|
480 | 483 | $ cat .hglf/large1 |
|
481 | 484 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
482 | 485 | $ hg status -A large2 |
|
483 | 486 | A large2 |
|
484 | 487 | $ cat large2 |
|
485 | 488 | large2 for linear merge (conflict with normal file) |
|
486 | 489 | $ cat .hglf/large2 |
|
487 | 490 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 |
|
488 | 491 | |
|
489 | 492 | (internal linear merging at "hg unbundle --update") |
|
490 | 493 | |
|
491 | 494 | $ hg update -q -C 2 |
|
492 | 495 | $ hg rollback -q |
|
493 | 496 | |
|
494 | 497 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
495 | 498 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 |
|
496 | 499 | $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg |
|
497 | 500 | adding changesets |
|
498 | 501 | adding manifests |
|
499 | 502 | adding file changes |
|
500 | 503 | added 3 changesets with 5 changes to 5 files |
|
501 | 504 | remote turned local largefile large2 into a normal file |
|
502 | 505 | keep (l)argefile or use (n)ormal file? l |
|
503 | 506 | largefile large1 has a merge conflict |
|
504 | 507 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
505 | 508 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
506 | 509 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
507 | 510 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
511 | updated to "d65e59e952a9: #5" | |
|
508 | 512 | 1 other heads for branch "default" |
|
509 | 513 | |
|
510 | 514 | $ hg status -A large1 |
|
511 | 515 | M large1 |
|
512 | 516 | $ cat large1 |
|
513 | 517 | large1 for linear merge (conflict) |
|
514 | 518 | $ cat .hglf/large1 |
|
515 | 519 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
516 | 520 | $ hg status -A large2 |
|
517 | 521 | A large2 |
|
518 | 522 | $ cat large2 |
|
519 | 523 | large2 for linear merge (conflict with normal file) |
|
520 | 524 | $ cat .hglf/large2 |
|
521 | 525 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 |
|
522 | 526 | |
|
523 | 527 | (internal linear merging in subrepo at "hg update") |
|
524 | 528 | |
|
525 | 529 | $ cd .. |
|
526 | 530 | $ hg init subparent |
|
527 | 531 | $ cd subparent |
|
528 | 532 | |
|
529 | 533 | $ hg clone -q -u 2 ../repo sub |
|
530 | 534 | $ cat > .hgsub <<EOF |
|
531 | 535 | > sub = sub |
|
532 | 536 | > EOF |
|
533 | 537 | $ hg add .hgsub |
|
534 | 538 | $ hg commit -m '#0@parent' |
|
535 | 539 | $ cat .hgsubstate |
|
536 | 540 | f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub |
|
537 | 541 | $ hg -R sub update -q |
|
538 | 542 | $ hg commit -m '#1@parent' |
|
539 | 543 | $ cat .hgsubstate |
|
540 | 544 | d65e59e952a9638e2ce863b41a420ca723dd3e8d sub |
|
541 | 545 | $ hg update -q 0 |
|
542 | 546 | |
|
543 | 547 | $ echo 'large1 for linear merge (conflict)' > sub/large1 |
|
544 | 548 | $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2 |
|
545 | 549 | $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF |
|
546 | 550 | > m |
|
547 | 551 | > r |
|
548 | 552 | > l |
|
549 | 553 | > l |
|
550 | 554 | > EOF |
|
551 | 555 | subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9) |
|
552 | 556 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
553 | 557 | subrepository sources for sub differ (in checked out version) |
|
554 | 558 | use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r |
|
555 | 559 | remote turned local largefile large2 into a normal file |
|
556 | 560 | keep (l)argefile or use (n)ormal file? l |
|
557 | 561 | largefile large1 has a merge conflict |
|
558 | 562 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
559 | 563 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
560 | 564 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
561 | 565 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
562 | 566 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
563 | 567 | |
|
564 | 568 | $ hg -R sub status -A sub/large1 |
|
565 | 569 | M sub/large1 |
|
566 | 570 | $ cat sub/large1 |
|
567 | 571 | large1 for linear merge (conflict) |
|
568 | 572 | $ cat sub/.hglf/large1 |
|
569 | 573 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
570 | 574 | $ hg -R sub status -A sub/large2 |
|
571 | 575 | A sub/large2 |
|
572 | 576 | $ cat sub/large2 |
|
573 | 577 | large2 for linear merge (conflict with normal file) |
|
574 | 578 | $ cat sub/.hglf/large2 |
|
575 | 579 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 |
|
576 | 580 | |
|
577 | 581 | $ cd .. |
|
578 | 582 | $ cd repo |
|
579 | 583 | |
|
580 | 584 | Test that rebase updates largefiles in the working directory even if |
|
581 | 585 | it is aborted by conflict. |
|
582 | 586 | |
|
583 | 587 | $ hg update -q -C 3 |
|
584 | 588 | $ cat .hglf/large1 |
|
585 | 589 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
586 | 590 | $ cat large1 |
|
587 | 591 | large1 in #3 |
|
588 | 592 | $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF |
|
589 | 593 | > o |
|
590 | 594 | > EOF |
|
591 | 595 | rebasing 1:72518492caa6 "#1" |
|
592 | 596 | largefile large1 has a merge conflict |
|
593 | 597 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
594 | 598 | keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or |
|
595 | 599 | take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o |
|
596 | 600 | merging normal1 |
|
597 | 601 | warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') |
|
598 | 602 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
599 | 603 | [1] |
|
600 | 604 | $ cat .hglf/large1 |
|
601 | 605 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
602 | 606 | $ cat large1 |
|
603 | 607 | large1 in #1 |
|
604 | 608 | $ rm normal1.orig |
|
605 | 609 | |
|
606 | 610 | Test that rebase updates standins for manually modified largefiles at |
|
607 | 611 | the 1st commit of resuming. |
|
608 | 612 | |
|
609 | 613 | $ echo "manually modified before 'hg rebase --continue'" > large1 |
|
610 | 614 | $ hg resolve -m normal1 |
|
611 | 615 | (no more unresolved files) |
|
612 | 616 | continue: hg rebase --continue |
|
613 | 617 | $ hg rebase --continue --config ui.interactive=True <<EOF |
|
614 | 618 | > c |
|
615 | 619 | > EOF |
|
616 | 620 | rebasing 1:72518492caa6 "#1" |
|
617 | 621 | rebasing 4:07d6153b5c04 "#4" |
|
618 | 622 | local [dest] changed .hglf/large1 which other [source] deleted |
|
619 | 623 | use (c)hanged version, (d)elete, or leave (u)nresolved? c |
|
620 | 624 | |
|
621 | 625 | $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]' |
|
622 | 626 | -e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
623 | 627 | +8a4f783556e7dea21139ca0466eafce954c75c13 |
|
624 | 628 | $ rm -f large1 |
|
625 | 629 | $ hg update -q -C tip |
|
626 | 630 | $ cat large1 |
|
627 | 631 | manually modified before 'hg rebase --continue' |
|
628 | 632 | |
|
629 | 633 | Test that transplant updates largefiles, of which standins are safely |
|
630 | 634 | changed, even if it is aborted by conflict of other. |
|
631 | 635 | |
|
632 | 636 | $ hg update -q -C 5 |
|
633 | 637 | $ cat .hglf/large1 |
|
634 | 638 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
635 | 639 | $ cat large1 |
|
636 | 640 | large1 in #3 |
|
637 | 641 | $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]' |
|
638 | 642 | +fa44618ea25181aff4f48b70428294790cec9f61 |
|
639 | 643 | $ hg transplant 4 |
|
640 | 644 | applying 07d6153b5c04 |
|
641 | 645 | patching file .hglf/large1 |
|
642 | 646 | Hunk #1 FAILED at 0 |
|
643 | 647 | 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej |
|
644 | 648 | patch failed to apply |
|
645 | 649 | abort: fix up the working directory and run hg transplant --continue |
|
646 | 650 | [255] |
|
647 | 651 | $ hg status -A large1 |
|
648 | 652 | C large1 |
|
649 | 653 | $ cat .hglf/large1 |
|
650 | 654 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
651 | 655 | $ cat large1 |
|
652 | 656 | large1 in #3 |
|
653 | 657 | $ hg status -A largeX |
|
654 | 658 | A largeX |
|
655 | 659 | $ cat .hglf/largeX |
|
656 | 660 | fa44618ea25181aff4f48b70428294790cec9f61 |
|
657 | 661 | $ cat largeX |
|
658 | 662 | largeX |
|
659 | 663 | |
|
660 | 664 | Test that transplant updates standins for manually modified largefiles |
|
661 | 665 | at the 1st commit of resuming. |
|
662 | 666 | |
|
663 | 667 | $ echo "manually modified before 'hg transplant --continue'" > large1 |
|
664 | 668 | $ hg transplant --continue |
|
665 | 669 | 07d6153b5c04 transplanted as f1bf30eb88cc |
|
666 | 670 | $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]' |
|
667 | 671 | -e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
668 | 672 | +6a4f36d4075fbe0f30ec1d26ca44e63c05903671 |
|
669 | 673 | $ rm -f large1 |
|
670 | 674 | $ hg update -q -C tip |
|
671 | 675 | $ cat large1 |
|
672 | 676 | manually modified before 'hg transplant --continue' |
|
673 | 677 | |
|
674 | 678 | Test that "hg status" doesn't show removal of largefiles not managed |
|
675 | 679 | in the target context. |
|
676 | 680 | |
|
677 | 681 | $ hg update -q -C 4 |
|
678 | 682 | $ hg remove largeX |
|
679 | 683 | $ hg status -A largeX |
|
680 | 684 | R largeX |
|
681 | 685 | $ hg status -A --rev '.^1' largeX |
|
682 | 686 | |
|
683 | 687 | #if execbit |
|
684 | 688 | |
|
685 | 689 | Test that "hg status" against revisions other than parent notices exec |
|
686 | 690 | bit changes of largefiles. |
|
687 | 691 | |
|
688 | 692 | $ hg update -q -C 4 |
|
689 | 693 | |
|
690 | 694 | (the case that large2 doesn't have exec bit in the target context but |
|
691 | 695 | in the working context) |
|
692 | 696 | |
|
693 | 697 | $ chmod +x large2 |
|
694 | 698 | $ hg status -A --rev 0 large2 |
|
695 | 699 | M large2 |
|
696 | 700 | $ hg commit -m 'chmod +x large2' |
|
697 | 701 | |
|
698 | 702 | (the case that large2 has exec bit in the target context but not in |
|
699 | 703 | the working context) |
|
700 | 704 | |
|
701 | 705 | $ echo dummy > dummy |
|
702 | 706 | $ hg add dummy |
|
703 | 707 | $ hg commit -m 'revision for separation' |
|
704 | 708 | $ chmod -x large2 |
|
705 | 709 | $ hg status -A --rev '.^1' large2 |
|
706 | 710 | M large2 |
|
707 | 711 | |
|
708 | 712 | #else |
|
709 | 713 | |
|
710 | 714 | Test that "hg status" against revisions other than parent ignores exec |
|
711 | 715 | bit correctly on the platform being unaware of it. |
|
712 | 716 | |
|
713 | 717 | $ hg update -q -C 4 |
|
714 | 718 | |
|
715 | 719 | $ cat > ../exec-bit.patch <<EOF |
|
716 | 720 | > # HG changeset patch |
|
717 | 721 | > # User test |
|
718 | 722 | > # Date 0 0 |
|
719 | 723 | > # Thu Jan 01 00:00:00 1970 +0000 |
|
720 | 724 | > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90 |
|
721 | 725 | > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727 |
|
722 | 726 | > chmod +x large2 |
|
723 | 727 | > |
|
724 | 728 | > diff --git a/.hglf/large2 b/.hglf/large2 |
|
725 | 729 | > old mode 100644 |
|
726 | 730 | > new mode 100755 |
|
727 | 731 | > EOF |
|
728 | 732 | $ hg import --exact --bypass ../exec-bit.patch |
|
729 | 733 | applying ../exec-bit.patch |
|
730 | 734 | $ hg status -A --rev tip large2 |
|
731 | 735 | C large2 |
|
732 | 736 | |
|
733 | 737 | #endif |
|
734 | 738 | |
|
735 | 739 | Test a fatal error interrupting an update. Verify that status report dirty |
|
736 | 740 | files correctly after an interrupted update. Also verify that checking all |
|
737 | 741 | hashes reveals it isn't clean. |
|
738 | 742 | |
|
739 | 743 | Start with clean dirstates: |
|
740 | 744 | $ hg up --quiet --clean --rev "8^" |
|
741 | 745 | $ sleep 1 |
|
742 | 746 | $ hg st |
|
743 | 747 | Update standins without updating largefiles - large1 is modified and largeX is |
|
744 | 748 | added: |
|
745 | 749 | $ cat << EOF > ../crashupdatelfiles.py |
|
746 | 750 | > import hgext.largefiles.lfutil |
|
747 | 751 | > def getlfilestoupdate(oldstandins, newstandins): |
|
748 | 752 | > raise SystemExit(7) |
|
749 | 753 | > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate |
|
750 | 754 | > EOF |
|
751 | 755 | $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py |
|
752 | 756 | [7] |
|
753 | 757 | Check large1 content and status ... and that update will undo modifications: |
|
754 | 758 | $ cat large1 |
|
755 | 759 | large1 in #3 |
|
756 | 760 | $ hg st |
|
757 | 761 | M large1 |
|
758 | 762 | ! largeX |
|
759 | 763 | $ hg up -Cr . |
|
760 | 764 | getting changed largefiles |
|
761 | 765 | 2 largefiles updated, 0 removed |
|
762 | 766 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
763 | 767 | $ cat large1 |
|
764 | 768 | manually modified before 'hg transplant --continue' |
|
765 | 769 | $ hg st |
|
766 | 770 | Force largefiles rehashing and check that all changes have been caught by |
|
767 | 771 | status and update: |
|
768 | 772 | $ rm .hg/largefiles/dirstate |
|
769 | 773 | $ hg st |
|
770 | 774 | |
|
771 | 775 | $ cd .. |
|
772 | 776 | |
|
773 | 777 | Test that "hg convert" avoids copying largefiles from the working |
|
774 | 778 | directory into store, because "hg convert" doesn't update largefiles |
|
775 | 779 | in the working directory (removing files under ".cache/largefiles" |
|
776 | 780 | forces "hg convert" to copy corresponding largefiles) |
|
777 | 781 | |
|
778 | 782 | $ cat >> $HGRCPATH <<EOF |
|
779 | 783 | > [extensions] |
|
780 | 784 | > convert = |
|
781 | 785 | > EOF |
|
782 | 786 | |
|
783 | 787 | $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671 |
|
784 | 788 | $ hg convert -q repo repo.converted |
@@ -1,1086 +1,1095 | |||
|
1 | 1 | Tests for change/delete conflicts, including: |
|
2 | 2 | b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again |
|
3 | 3 | (issue897) |
|
4 | 4 | |
|
5 | 5 | 840e2b315c1f: Fix misleading error and prompts during update/merge |
|
6 | 6 | (issue556) |
|
7 | 7 | |
|
8 | 8 | Make sure HGMERGE doesn't interfere with the test |
|
9 | 9 | $ unset HGMERGE |
|
10 | 10 | |
|
11 | 11 | $ status() { |
|
12 | 12 | > echo "--- status ---" |
|
13 | 13 | > hg st -A file1 file2 file3 |
|
14 | 14 | > echo "--- resolve --list ---" |
|
15 | 15 | > hg resolve --list file1 file2 file3 |
|
16 | 16 | > echo "--- debugmergestate ---" |
|
17 | 17 | > hg debugmergestate |
|
18 | 18 | > for file in file1 file2 file3; do |
|
19 | 19 | > if [ -f $file ]; then |
|
20 | 20 | > echo "--- $file ---" |
|
21 | 21 | > cat $file |
|
22 | 22 | > else |
|
23 | 23 | > echo "*** $file does not exist" |
|
24 | 24 | > fi |
|
25 | 25 | > done |
|
26 | 26 | > } |
|
27 | 27 | |
|
28 | 28 | $ hg init repo |
|
29 | 29 | $ cd repo |
|
30 | 30 | |
|
31 | 31 | $ echo 1 > file1 |
|
32 | 32 | $ echo 2 > file2 |
|
33 | 33 | $ echo 3 > file3 |
|
34 | 34 | $ hg ci -Am 'added files' |
|
35 | 35 | adding file1 |
|
36 | 36 | adding file2 |
|
37 | 37 | adding file3 |
|
38 | 38 | |
|
39 | 39 | $ hg rm file1 |
|
40 | 40 | $ echo changed >> file2 |
|
41 | 41 | $ echo changed1 >> file3 |
|
42 | 42 | $ hg ci -m 'removed file1, changed file2, changed file3' |
|
43 | 43 | |
|
44 | 44 | $ hg co 0 |
|
45 | 45 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
46 | 46 | |
|
47 | 47 | $ echo changed >> file1 |
|
48 | 48 | $ hg rm file2 |
|
49 | 49 | $ echo changed2 >> file3 |
|
50 | 50 | $ hg ci -m 'changed file1, removed file2, changed file3' |
|
51 | 51 | created new head |
|
52 | 52 | |
|
53 | 53 | |
|
54 | 54 | Non-interactive merge: |
|
55 | 55 | |
|
56 | 56 | $ hg merge -y |
|
57 | 57 | local [working copy] changed file1 which other [merge rev] deleted |
|
58 | 58 | use (c)hanged version, (d)elete, or leave (u)nresolved? u |
|
59 | 59 | other [merge rev] changed file2 which local [working copy] deleted |
|
60 | 60 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u |
|
61 | 61 | merging file3 |
|
62 | 62 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
63 | 63 | 0 files updated, 0 files merged, 0 files removed, 3 files unresolved |
|
64 | 64 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
65 | 65 | [1] |
|
66 | 66 | |
|
67 | 67 | $ status |
|
68 | 68 | --- status --- |
|
69 | 69 | M file2 |
|
70 | 70 | M file3 |
|
71 | 71 | C file1 |
|
72 | 72 | --- resolve --list --- |
|
73 | 73 | U file1 |
|
74 | 74 | U file2 |
|
75 | 75 | U file3 |
|
76 | 76 | --- debugmergestate --- |
|
77 | 77 | * version 2 records |
|
78 | 78 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
79 | 79 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
80 | 80 | labels: |
|
81 | 81 | local: working copy |
|
82 | 82 | other: merge rev |
|
83 | 83 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
84 | 84 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
85 | 85 | local path: file1 (flags "") |
|
86 | 86 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
87 | 87 | other path: file1 (node null) |
|
88 | 88 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
89 | 89 | file: file2 (record type "C", state "u", hash null) |
|
90 | 90 | local path: file2 (flags "") |
|
91 | 91 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
92 | 92 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
93 | 93 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
94 | 94 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
95 | 95 | local path: file3 (flags "") |
|
96 | 96 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
97 | 97 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
98 | 98 | --- file1 --- |
|
99 | 99 | 1 |
|
100 | 100 | changed |
|
101 | 101 | --- file2 --- |
|
102 | 102 | 2 |
|
103 | 103 | changed |
|
104 | 104 | --- file3 --- |
|
105 | 105 | 3 |
|
106 | 106 | <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... |
|
107 | 107 | changed2 |
|
108 | 108 | ======= |
|
109 | 109 | changed1 |
|
110 | 110 | >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... |
|
111 | 111 | |
|
112 | 112 | |
|
113 | 113 | Interactive merge: |
|
114 | 114 | |
|
115 | 115 | $ hg co -C |
|
116 | 116 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
117 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
117 | 118 | 1 other heads for branch "default" |
|
118 | 119 | |
|
119 | 120 | $ hg merge --config ui.interactive=true <<EOF |
|
120 | 121 | > c |
|
121 | 122 | > d |
|
122 | 123 | > EOF |
|
123 | 124 | local [working copy] changed file1 which other [merge rev] deleted |
|
124 | 125 | use (c)hanged version, (d)elete, or leave (u)nresolved? c |
|
125 | 126 | other [merge rev] changed file2 which local [working copy] deleted |
|
126 | 127 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d |
|
127 | 128 | merging file3 |
|
128 | 129 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
129 | 130 | 0 files updated, 2 files merged, 0 files removed, 1 files unresolved |
|
130 | 131 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
131 | 132 | [1] |
|
132 | 133 | |
|
133 | 134 | $ status |
|
134 | 135 | --- status --- |
|
135 | 136 | file2: * (glob) |
|
136 | 137 | M file3 |
|
137 | 138 | C file1 |
|
138 | 139 | --- resolve --list --- |
|
139 | 140 | R file1 |
|
140 | 141 | R file2 |
|
141 | 142 | U file3 |
|
142 | 143 | --- debugmergestate --- |
|
143 | 144 | * version 2 records |
|
144 | 145 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
145 | 146 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
146 | 147 | labels: |
|
147 | 148 | local: working copy |
|
148 | 149 | other: merge rev |
|
149 | 150 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
150 | 151 | file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
151 | 152 | local path: file1 (flags "") |
|
152 | 153 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
153 | 154 | other path: file1 (node null) |
|
154 | 155 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
155 | 156 | file: file2 (record type "C", state "r", hash null) |
|
156 | 157 | local path: file2 (flags "") |
|
157 | 158 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
158 | 159 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
159 | 160 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
160 | 161 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
161 | 162 | local path: file3 (flags "") |
|
162 | 163 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
163 | 164 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
164 | 165 | --- file1 --- |
|
165 | 166 | 1 |
|
166 | 167 | changed |
|
167 | 168 | *** file2 does not exist |
|
168 | 169 | --- file3 --- |
|
169 | 170 | 3 |
|
170 | 171 | <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... |
|
171 | 172 | changed2 |
|
172 | 173 | ======= |
|
173 | 174 | changed1 |
|
174 | 175 | >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... |
|
175 | 176 | |
|
176 | 177 | |
|
177 | 178 | Interactive merge with bad input: |
|
178 | 179 | |
|
179 | 180 | $ hg co -C |
|
180 | 181 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
182 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
181 | 183 | 1 other heads for branch "default" |
|
182 | 184 | |
|
183 | 185 | $ hg merge --config ui.interactive=true <<EOF |
|
184 | 186 | > foo |
|
185 | 187 | > bar |
|
186 | 188 | > d |
|
187 | 189 | > baz |
|
188 | 190 | > c |
|
189 | 191 | > EOF |
|
190 | 192 | local [working copy] changed file1 which other [merge rev] deleted |
|
191 | 193 | use (c)hanged version, (d)elete, or leave (u)nresolved? foo |
|
192 | 194 | unrecognized response |
|
193 | 195 | local [working copy] changed file1 which other [merge rev] deleted |
|
194 | 196 | use (c)hanged version, (d)elete, or leave (u)nresolved? bar |
|
195 | 197 | unrecognized response |
|
196 | 198 | local [working copy] changed file1 which other [merge rev] deleted |
|
197 | 199 | use (c)hanged version, (d)elete, or leave (u)nresolved? d |
|
198 | 200 | other [merge rev] changed file2 which local [working copy] deleted |
|
199 | 201 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? baz |
|
200 | 202 | unrecognized response |
|
201 | 203 | other [merge rev] changed file2 which local [working copy] deleted |
|
202 | 204 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c |
|
203 | 205 | merging file3 |
|
204 | 206 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
205 | 207 | 0 files updated, 1 files merged, 1 files removed, 1 files unresolved |
|
206 | 208 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
207 | 209 | [1] |
|
208 | 210 | |
|
209 | 211 | $ status |
|
210 | 212 | --- status --- |
|
211 | 213 | M file2 |
|
212 | 214 | M file3 |
|
213 | 215 | R file1 |
|
214 | 216 | --- resolve --list --- |
|
215 | 217 | R file1 |
|
216 | 218 | R file2 |
|
217 | 219 | U file3 |
|
218 | 220 | --- debugmergestate --- |
|
219 | 221 | * version 2 records |
|
220 | 222 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
221 | 223 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
222 | 224 | labels: |
|
223 | 225 | local: working copy |
|
224 | 226 | other: merge rev |
|
225 | 227 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
226 | 228 | file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
227 | 229 | local path: file1 (flags "") |
|
228 | 230 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
229 | 231 | other path: file1 (node null) |
|
230 | 232 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
231 | 233 | file: file2 (record type "C", state "r", hash null) |
|
232 | 234 | local path: file2 (flags "") |
|
233 | 235 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
234 | 236 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
235 | 237 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
236 | 238 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
237 | 239 | local path: file3 (flags "") |
|
238 | 240 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
239 | 241 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
240 | 242 | *** file1 does not exist |
|
241 | 243 | --- file2 --- |
|
242 | 244 | 2 |
|
243 | 245 | changed |
|
244 | 246 | --- file3 --- |
|
245 | 247 | 3 |
|
246 | 248 | <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... |
|
247 | 249 | changed2 |
|
248 | 250 | ======= |
|
249 | 251 | changed1 |
|
250 | 252 | >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... |
|
251 | 253 | |
|
252 | 254 | |
|
253 | 255 | Interactive merge with not enough input: |
|
254 | 256 | |
|
255 | 257 | $ hg co -C |
|
256 | 258 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
259 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
257 | 260 | 1 other heads for branch "default" |
|
258 | 261 | |
|
259 | 262 | $ hg merge --config ui.interactive=true <<EOF |
|
260 | 263 | > d |
|
261 | 264 | > EOF |
|
262 | 265 | local [working copy] changed file1 which other [merge rev] deleted |
|
263 | 266 | use (c)hanged version, (d)elete, or leave (u)nresolved? d |
|
264 | 267 | other [merge rev] changed file2 which local [working copy] deleted |
|
265 | 268 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
266 | 269 | merging file3 |
|
267 | 270 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
268 | 271 | 0 files updated, 0 files merged, 1 files removed, 2 files unresolved |
|
269 | 272 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
270 | 273 | [1] |
|
271 | 274 | |
|
272 | 275 | $ status |
|
273 | 276 | --- status --- |
|
274 | 277 | M file2 |
|
275 | 278 | M file3 |
|
276 | 279 | R file1 |
|
277 | 280 | --- resolve --list --- |
|
278 | 281 | R file1 |
|
279 | 282 | U file2 |
|
280 | 283 | U file3 |
|
281 | 284 | --- debugmergestate --- |
|
282 | 285 | * version 2 records |
|
283 | 286 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
284 | 287 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
285 | 288 | labels: |
|
286 | 289 | local: working copy |
|
287 | 290 | other: merge rev |
|
288 | 291 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
289 | 292 | file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
290 | 293 | local path: file1 (flags "") |
|
291 | 294 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
292 | 295 | other path: file1 (node null) |
|
293 | 296 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
294 | 297 | file: file2 (record type "C", state "u", hash null) |
|
295 | 298 | local path: file2 (flags "") |
|
296 | 299 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
297 | 300 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
298 | 301 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
299 | 302 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
300 | 303 | local path: file3 (flags "") |
|
301 | 304 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
302 | 305 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
303 | 306 | *** file1 does not exist |
|
304 | 307 | --- file2 --- |
|
305 | 308 | 2 |
|
306 | 309 | changed |
|
307 | 310 | --- file3 --- |
|
308 | 311 | 3 |
|
309 | 312 | <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... |
|
310 | 313 | changed2 |
|
311 | 314 | ======= |
|
312 | 315 | changed1 |
|
313 | 316 | >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... |
|
314 | 317 | |
|
315 | 318 | Choose local versions of files |
|
316 | 319 | |
|
317 | 320 | $ hg co -C |
|
318 | 321 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
322 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
319 | 323 | 1 other heads for branch "default" |
|
320 | 324 | |
|
321 | 325 | $ hg merge --tool :local |
|
322 | 326 | 0 files updated, 3 files merged, 0 files removed, 0 files unresolved |
|
323 | 327 | (branch merge, don't forget to commit) |
|
324 | 328 | $ status 2>&1 | tee $TESTTMP/local.status |
|
325 | 329 | --- status --- |
|
326 | 330 | file2: * (glob) |
|
327 | 331 | M file3 |
|
328 | 332 | C file1 |
|
329 | 333 | --- resolve --list --- |
|
330 | 334 | R file1 |
|
331 | 335 | R file2 |
|
332 | 336 | R file3 |
|
333 | 337 | --- debugmergestate --- |
|
334 | 338 | * version 2 records |
|
335 | 339 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
336 | 340 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
337 | 341 | labels: |
|
338 | 342 | local: working copy |
|
339 | 343 | other: merge rev |
|
340 | 344 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
341 | 345 | file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
342 | 346 | local path: file1 (flags "") |
|
343 | 347 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
344 | 348 | other path: file1 (node null) |
|
345 | 349 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
346 | 350 | file: file2 (record type "C", state "r", hash null) |
|
347 | 351 | local path: file2 (flags "") |
|
348 | 352 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
349 | 353 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
350 | 354 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
351 | 355 | file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
352 | 356 | local path: file3 (flags "") |
|
353 | 357 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
354 | 358 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
355 | 359 | --- file1 --- |
|
356 | 360 | 1 |
|
357 | 361 | changed |
|
358 | 362 | *** file2 does not exist |
|
359 | 363 | --- file3 --- |
|
360 | 364 | 3 |
|
361 | 365 | changed2 |
|
362 | 366 | |
|
363 | 367 | Choose other versions of files |
|
364 | 368 | |
|
365 | 369 | $ hg co -C |
|
366 | 370 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
371 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
367 | 372 | 1 other heads for branch "default" |
|
368 | 373 | |
|
369 | 374 | $ hg merge --tool :other |
|
370 | 375 | 0 files updated, 2 files merged, 1 files removed, 0 files unresolved |
|
371 | 376 | (branch merge, don't forget to commit) |
|
372 | 377 | $ status 2>&1 | tee $TESTTMP/other.status |
|
373 | 378 | --- status --- |
|
374 | 379 | M file2 |
|
375 | 380 | M file3 |
|
376 | 381 | R file1 |
|
377 | 382 | --- resolve --list --- |
|
378 | 383 | R file1 |
|
379 | 384 | R file2 |
|
380 | 385 | R file3 |
|
381 | 386 | --- debugmergestate --- |
|
382 | 387 | * version 2 records |
|
383 | 388 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
384 | 389 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
385 | 390 | labels: |
|
386 | 391 | local: working copy |
|
387 | 392 | other: merge rev |
|
388 | 393 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
389 | 394 | file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
390 | 395 | local path: file1 (flags "") |
|
391 | 396 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
392 | 397 | other path: file1 (node null) |
|
393 | 398 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
394 | 399 | file: file2 (record type "C", state "r", hash null) |
|
395 | 400 | local path: file2 (flags "") |
|
396 | 401 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
397 | 402 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
398 | 403 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
399 | 404 | file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
400 | 405 | local path: file3 (flags "") |
|
401 | 406 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
402 | 407 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
403 | 408 | *** file1 does not exist |
|
404 | 409 | --- file2 --- |
|
405 | 410 | 2 |
|
406 | 411 | changed |
|
407 | 412 | --- file3 --- |
|
408 | 413 | 3 |
|
409 | 414 | changed1 |
|
410 | 415 | |
|
411 | 416 | Fail |
|
412 | 417 | |
|
413 | 418 | $ hg co -C |
|
414 | 419 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
420 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
415 | 421 | 1 other heads for branch "default" |
|
416 | 422 | |
|
417 | 423 | $ hg merge --tool :fail |
|
418 | 424 | 0 files updated, 0 files merged, 0 files removed, 3 files unresolved |
|
419 | 425 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
420 | 426 | [1] |
|
421 | 427 | $ status 2>&1 | tee $TESTTMP/fail.status |
|
422 | 428 | --- status --- |
|
423 | 429 | M file2 |
|
424 | 430 | M file3 |
|
425 | 431 | C file1 |
|
426 | 432 | --- resolve --list --- |
|
427 | 433 | U file1 |
|
428 | 434 | U file2 |
|
429 | 435 | U file3 |
|
430 | 436 | --- debugmergestate --- |
|
431 | 437 | * version 2 records |
|
432 | 438 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
433 | 439 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
434 | 440 | labels: |
|
435 | 441 | local: working copy |
|
436 | 442 | other: merge rev |
|
437 | 443 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
438 | 444 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
439 | 445 | local path: file1 (flags "") |
|
440 | 446 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
441 | 447 | other path: file1 (node null) |
|
442 | 448 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
443 | 449 | file: file2 (record type "C", state "u", hash null) |
|
444 | 450 | local path: file2 (flags "") |
|
445 | 451 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
446 | 452 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
447 | 453 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
448 | 454 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
449 | 455 | local path: file3 (flags "") |
|
450 | 456 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
451 | 457 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
452 | 458 | --- file1 --- |
|
453 | 459 | 1 |
|
454 | 460 | changed |
|
455 | 461 | --- file2 --- |
|
456 | 462 | 2 |
|
457 | 463 | changed |
|
458 | 464 | --- file3 --- |
|
459 | 465 | 3 |
|
460 | 466 | changed2 |
|
461 | 467 | |
|
462 | 468 | Force prompts with no input (should be similar to :fail) |
|
463 | 469 | |
|
464 | 470 | $ hg co -C |
|
465 | 471 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
472 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
466 | 473 | 1 other heads for branch "default" |
|
467 | 474 | |
|
468 | 475 | $ hg merge --config ui.interactive=True --tool :prompt |
|
469 | 476 | local [working copy] changed file1 which other [merge rev] deleted |
|
470 | 477 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
471 | 478 | other [merge rev] changed file2 which local [working copy] deleted |
|
472 | 479 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
473 | 480 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? |
|
474 | 481 | 0 files updated, 0 files merged, 0 files removed, 3 files unresolved |
|
475 | 482 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
476 | 483 | [1] |
|
477 | 484 | $ status 2>&1 | tee $TESTTMP/prompt.status |
|
478 | 485 | --- status --- |
|
479 | 486 | M file2 |
|
480 | 487 | M file3 |
|
481 | 488 | C file1 |
|
482 | 489 | --- resolve --list --- |
|
483 | 490 | U file1 |
|
484 | 491 | U file2 |
|
485 | 492 | U file3 |
|
486 | 493 | --- debugmergestate --- |
|
487 | 494 | * version 2 records |
|
488 | 495 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
489 | 496 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
490 | 497 | labels: |
|
491 | 498 | local: working copy |
|
492 | 499 | other: merge rev |
|
493 | 500 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
494 | 501 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
495 | 502 | local path: file1 (flags "") |
|
496 | 503 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
497 | 504 | other path: file1 (node null) |
|
498 | 505 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
499 | 506 | file: file2 (record type "C", state "u", hash null) |
|
500 | 507 | local path: file2 (flags "") |
|
501 | 508 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
502 | 509 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
503 | 510 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
504 | 511 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
505 | 512 | local path: file3 (flags "") |
|
506 | 513 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
507 | 514 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
508 | 515 | --- file1 --- |
|
509 | 516 | 1 |
|
510 | 517 | changed |
|
511 | 518 | --- file2 --- |
|
512 | 519 | 2 |
|
513 | 520 | changed |
|
514 | 521 | --- file3 --- |
|
515 | 522 | 3 |
|
516 | 523 | changed2 |
|
517 | 524 | $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status |
|
518 | 525 | |
|
519 | 526 | |
|
520 | 527 | Force prompts |
|
521 | 528 | |
|
522 | 529 | $ hg co -C |
|
523 | 530 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
531 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
524 | 532 | 1 other heads for branch "default" |
|
525 | 533 | |
|
526 | 534 | $ hg merge --tool :prompt |
|
527 | 535 | local [working copy] changed file1 which other [merge rev] deleted |
|
528 | 536 | use (c)hanged version, (d)elete, or leave (u)nresolved? u |
|
529 | 537 | other [merge rev] changed file2 which local [working copy] deleted |
|
530 | 538 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u |
|
531 | 539 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? u |
|
532 | 540 | 0 files updated, 0 files merged, 0 files removed, 3 files unresolved |
|
533 | 541 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
534 | 542 | [1] |
|
535 | 543 | $ status |
|
536 | 544 | --- status --- |
|
537 | 545 | M file2 |
|
538 | 546 | M file3 |
|
539 | 547 | C file1 |
|
540 | 548 | --- resolve --list --- |
|
541 | 549 | U file1 |
|
542 | 550 | U file2 |
|
543 | 551 | U file3 |
|
544 | 552 | --- debugmergestate --- |
|
545 | 553 | * version 2 records |
|
546 | 554 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
547 | 555 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
548 | 556 | labels: |
|
549 | 557 | local: working copy |
|
550 | 558 | other: merge rev |
|
551 | 559 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
552 | 560 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
553 | 561 | local path: file1 (flags "") |
|
554 | 562 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
555 | 563 | other path: file1 (node null) |
|
556 | 564 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
557 | 565 | file: file2 (record type "C", state "u", hash null) |
|
558 | 566 | local path: file2 (flags "") |
|
559 | 567 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
560 | 568 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
561 | 569 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
562 | 570 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
563 | 571 | local path: file3 (flags "") |
|
564 | 572 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
565 | 573 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
566 | 574 | --- file1 --- |
|
567 | 575 | 1 |
|
568 | 576 | changed |
|
569 | 577 | --- file2 --- |
|
570 | 578 | 2 |
|
571 | 579 | changed |
|
572 | 580 | --- file3 --- |
|
573 | 581 | 3 |
|
574 | 582 | changed2 |
|
575 | 583 | |
|
576 | 584 | Choose to merge all files |
|
577 | 585 | |
|
578 | 586 | $ hg co -C |
|
579 | 587 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
588 | updated to "13910f48cf7b: changed file1, removed file2, changed file3" | |
|
580 | 589 | 1 other heads for branch "default" |
|
581 | 590 | |
|
582 | 591 | $ hg merge --tool :merge3 |
|
583 | 592 | local [working copy] changed file1 which other [merge rev] deleted |
|
584 | 593 | use (c)hanged version, (d)elete, or leave (u)nresolved? u |
|
585 | 594 | other [merge rev] changed file2 which local [working copy] deleted |
|
586 | 595 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u |
|
587 | 596 | merging file3 |
|
588 | 597 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
589 | 598 | 0 files updated, 0 files merged, 0 files removed, 3 files unresolved |
|
590 | 599 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
591 | 600 | [1] |
|
592 | 601 | $ status |
|
593 | 602 | --- status --- |
|
594 | 603 | M file2 |
|
595 | 604 | M file3 |
|
596 | 605 | C file1 |
|
597 | 606 | --- resolve --list --- |
|
598 | 607 | U file1 |
|
599 | 608 | U file2 |
|
600 | 609 | U file3 |
|
601 | 610 | --- debugmergestate --- |
|
602 | 611 | * version 2 records |
|
603 | 612 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 |
|
604 | 613 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
605 | 614 | labels: |
|
606 | 615 | local: working copy |
|
607 | 616 | other: merge rev |
|
608 | 617 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
609 | 618 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
610 | 619 | local path: file1 (flags "") |
|
611 | 620 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
612 | 621 | other path: file1 (node null) |
|
613 | 622 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
614 | 623 | file: file2 (record type "C", state "u", hash null) |
|
615 | 624 | local path: file2 (flags "") |
|
616 | 625 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
617 | 626 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
618 | 627 | file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
619 | 628 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) |
|
620 | 629 | local path: file3 (flags "") |
|
621 | 630 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) |
|
622 | 631 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) |
|
623 | 632 | --- file1 --- |
|
624 | 633 | 1 |
|
625 | 634 | changed |
|
626 | 635 | --- file2 --- |
|
627 | 636 | 2 |
|
628 | 637 | changed |
|
629 | 638 | --- file3 --- |
|
630 | 639 | 3 |
|
631 | 640 | <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... |
|
632 | 641 | changed2 |
|
633 | 642 | ||||||| base |
|
634 | 643 | ======= |
|
635 | 644 | changed1 |
|
636 | 645 | >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... |
|
637 | 646 | |
|
638 | 647 | Exercise transitions between local, other, fail and prompt, and make sure the |
|
639 | 648 | dirstate stays consistent. (Compare with each other and to the above |
|
640 | 649 | invocations.) |
|
641 | 650 | |
|
642 | 651 | $ testtransitions() { |
|
643 | 652 | > # this traversal order covers every transition |
|
644 | 653 | > tools="local other prompt local fail other local prompt other fail prompt fail local" |
|
645 | 654 | > lasttool="merge3" |
|
646 | 655 | > for tool in $tools; do |
|
647 | 656 | > echo "=== :$lasttool -> :$tool ===" |
|
648 | 657 | > ref="$TESTTMP/$tool.status" |
|
649 | 658 | > hg resolve --unmark --all |
|
650 | 659 | > hg resolve --tool ":$tool" --all --config ui.interactive=True |
|
651 | 660 | > status > "$TESTTMP/compare.status" 2>&1 |
|
652 | 661 | > echo '--- diff of status ---' |
|
653 | 662 | > if cmp "$TESTTMP/$tool.status" "$TESTTMP/compare.status" || diff -U8 "$TESTTMP/$tool.status" "$TESTTMP/compare.status"; then |
|
654 | 663 | > echo '(status identical)' |
|
655 | 664 | > fi |
|
656 | 665 | > lasttool="$tool" |
|
657 | 666 | > echo |
|
658 | 667 | > done |
|
659 | 668 | > } |
|
660 | 669 | |
|
661 | 670 | $ testtransitions |
|
662 | 671 | === :merge3 -> :local === |
|
663 | 672 | (no more unresolved files) |
|
664 | 673 | --- diff of status --- |
|
665 | 674 | (status identical) |
|
666 | 675 | |
|
667 | 676 | === :local -> :other === |
|
668 | 677 | (no more unresolved files) |
|
669 | 678 | --- diff of status --- |
|
670 | 679 | (status identical) |
|
671 | 680 | |
|
672 | 681 | === :other -> :prompt === |
|
673 | 682 | local [working copy] changed file1 which other [merge rev] deleted |
|
674 | 683 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
675 | 684 | other [merge rev] changed file2 which local [working copy] deleted |
|
676 | 685 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
677 | 686 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? |
|
678 | 687 | --- diff of status --- |
|
679 | 688 | (status identical) |
|
680 | 689 | |
|
681 | 690 | === :prompt -> :local === |
|
682 | 691 | (no more unresolved files) |
|
683 | 692 | --- diff of status --- |
|
684 | 693 | (status identical) |
|
685 | 694 | |
|
686 | 695 | === :local -> :fail === |
|
687 | 696 | --- diff of status --- |
|
688 | 697 | (status identical) |
|
689 | 698 | |
|
690 | 699 | === :fail -> :other === |
|
691 | 700 | (no more unresolved files) |
|
692 | 701 | --- diff of status --- |
|
693 | 702 | (status identical) |
|
694 | 703 | |
|
695 | 704 | === :other -> :local === |
|
696 | 705 | (no more unresolved files) |
|
697 | 706 | --- diff of status --- |
|
698 | 707 | (status identical) |
|
699 | 708 | |
|
700 | 709 | === :local -> :prompt === |
|
701 | 710 | local [working copy] changed file1 which other [merge rev] deleted |
|
702 | 711 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
703 | 712 | other [merge rev] changed file2 which local [working copy] deleted |
|
704 | 713 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
705 | 714 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? |
|
706 | 715 | --- diff of status --- |
|
707 | 716 | (status identical) |
|
708 | 717 | |
|
709 | 718 | === :prompt -> :other === |
|
710 | 719 | (no more unresolved files) |
|
711 | 720 | --- diff of status --- |
|
712 | 721 | (status identical) |
|
713 | 722 | |
|
714 | 723 | === :other -> :fail === |
|
715 | 724 | --- diff of status --- |
|
716 | 725 | (status identical) |
|
717 | 726 | |
|
718 | 727 | === :fail -> :prompt === |
|
719 | 728 | local [working copy] changed file1 which other [merge rev] deleted |
|
720 | 729 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
721 | 730 | other [merge rev] changed file2 which local [working copy] deleted |
|
722 | 731 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
723 | 732 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? |
|
724 | 733 | --- diff of status --- |
|
725 | 734 | (status identical) |
|
726 | 735 | |
|
727 | 736 | === :prompt -> :fail === |
|
728 | 737 | --- diff of status --- |
|
729 | 738 | (status identical) |
|
730 | 739 | |
|
731 | 740 | === :fail -> :local === |
|
732 | 741 | (no more unresolved files) |
|
733 | 742 | --- diff of status --- |
|
734 | 743 | (status identical) |
|
735 | 744 | |
|
736 | 745 | |
|
737 | 746 | |
|
738 | 747 | Non-interactive linear update |
|
739 | 748 | |
|
740 | 749 | $ hg co -C 0 |
|
741 | 750 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
742 | 751 | $ echo changed >> file1 |
|
743 | 752 | $ hg rm file2 |
|
744 | 753 | $ hg update 1 -y |
|
745 | 754 | local [working copy] changed file1 which other [destination] deleted |
|
746 | 755 | use (c)hanged version, (d)elete, or leave (u)nresolved? u |
|
747 | 756 | other [destination] changed file2 which local [working copy] deleted |
|
748 | 757 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u |
|
749 | 758 | 1 files updated, 0 files merged, 0 files removed, 2 files unresolved |
|
750 | 759 | use 'hg resolve' to retry unresolved file merges |
|
751 | 760 | [1] |
|
752 | 761 | $ status |
|
753 | 762 | --- status --- |
|
754 | 763 | A file1 |
|
755 | 764 | C file2 |
|
756 | 765 | C file3 |
|
757 | 766 | --- resolve --list --- |
|
758 | 767 | U file1 |
|
759 | 768 | U file2 |
|
760 | 769 | --- debugmergestate --- |
|
761 | 770 | * version 2 records |
|
762 | 771 | local: ab57bf49aa276a22d35a473592d4c34b5abc3eff |
|
763 | 772 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
764 | 773 | labels: |
|
765 | 774 | local: working copy |
|
766 | 775 | other: destination |
|
767 | 776 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
768 | 777 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
769 | 778 | local path: file1 (flags "") |
|
770 | 779 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
771 | 780 | other path: file1 (node null) |
|
772 | 781 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
773 | 782 | file: file2 (record type "C", state "u", hash null) |
|
774 | 783 | local path: file2 (flags "") |
|
775 | 784 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
776 | 785 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
777 | 786 | --- file1 --- |
|
778 | 787 | 1 |
|
779 | 788 | changed |
|
780 | 789 | --- file2 --- |
|
781 | 790 | 2 |
|
782 | 791 | changed |
|
783 | 792 | --- file3 --- |
|
784 | 793 | 3 |
|
785 | 794 | changed1 |
|
786 | 795 | |
|
787 | 796 | Choose local versions of files |
|
788 | 797 | |
|
789 | 798 | $ hg co -C 0 |
|
790 | 799 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
791 | 800 | $ echo changed >> file1 |
|
792 | 801 | $ hg rm file2 |
|
793 | 802 | $ hg update 1 --tool :local |
|
794 | 803 | 1 files updated, 2 files merged, 0 files removed, 0 files unresolved |
|
795 | 804 | $ status 2>&1 | tee $TESTTMP/local.status |
|
796 | 805 | --- status --- |
|
797 | 806 | file2: * (glob) |
|
798 | 807 | A file1 |
|
799 | 808 | C file3 |
|
800 | 809 | --- resolve --list --- |
|
801 | 810 | R file1 |
|
802 | 811 | R file2 |
|
803 | 812 | --- debugmergestate --- |
|
804 | 813 | * version 2 records |
|
805 | 814 | local: ab57bf49aa276a22d35a473592d4c34b5abc3eff |
|
806 | 815 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
807 | 816 | labels: |
|
808 | 817 | local: working copy |
|
809 | 818 | other: destination |
|
810 | 819 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
811 | 820 | file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
812 | 821 | local path: file1 (flags "") |
|
813 | 822 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
814 | 823 | other path: file1 (node null) |
|
815 | 824 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
816 | 825 | file: file2 (record type "C", state "r", hash null) |
|
817 | 826 | local path: file2 (flags "") |
|
818 | 827 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
819 | 828 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
820 | 829 | --- file1 --- |
|
821 | 830 | 1 |
|
822 | 831 | changed |
|
823 | 832 | *** file2 does not exist |
|
824 | 833 | --- file3 --- |
|
825 | 834 | 3 |
|
826 | 835 | changed1 |
|
827 | 836 | |
|
828 | 837 | Choose other versions of files |
|
829 | 838 | |
|
830 | 839 | $ hg co -C 0 |
|
831 | 840 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
832 | 841 | $ echo changed >> file1 |
|
833 | 842 | $ hg rm file2 |
|
834 | 843 | $ hg update 1 --tool :other |
|
835 | 844 | 1 files updated, 1 files merged, 1 files removed, 0 files unresolved |
|
836 | 845 | $ status 2>&1 | tee $TESTTMP/other.status |
|
837 | 846 | --- status --- |
|
838 | 847 | file1: * (glob) |
|
839 | 848 | C file2 |
|
840 | 849 | C file3 |
|
841 | 850 | --- resolve --list --- |
|
842 | 851 | R file1 |
|
843 | 852 | R file2 |
|
844 | 853 | --- debugmergestate --- |
|
845 | 854 | * version 2 records |
|
846 | 855 | local: ab57bf49aa276a22d35a473592d4c34b5abc3eff |
|
847 | 856 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
848 | 857 | labels: |
|
849 | 858 | local: working copy |
|
850 | 859 | other: destination |
|
851 | 860 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
852 | 861 | file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
853 | 862 | local path: file1 (flags "") |
|
854 | 863 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
855 | 864 | other path: file1 (node null) |
|
856 | 865 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
857 | 866 | file: file2 (record type "C", state "r", hash null) |
|
858 | 867 | local path: file2 (flags "") |
|
859 | 868 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
860 | 869 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
861 | 870 | *** file1 does not exist |
|
862 | 871 | --- file2 --- |
|
863 | 872 | 2 |
|
864 | 873 | changed |
|
865 | 874 | --- file3 --- |
|
866 | 875 | 3 |
|
867 | 876 | changed1 |
|
868 | 877 | |
|
869 | 878 | Fail |
|
870 | 879 | |
|
871 | 880 | $ hg co -C 0 |
|
872 | 881 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
873 | 882 | $ echo changed >> file1 |
|
874 | 883 | $ hg rm file2 |
|
875 | 884 | $ hg update 1 --tool :fail |
|
876 | 885 | 1 files updated, 0 files merged, 0 files removed, 2 files unresolved |
|
877 | 886 | use 'hg resolve' to retry unresolved file merges |
|
878 | 887 | [1] |
|
879 | 888 | $ status 2>&1 | tee $TESTTMP/fail.status |
|
880 | 889 | --- status --- |
|
881 | 890 | A file1 |
|
882 | 891 | C file2 |
|
883 | 892 | C file3 |
|
884 | 893 | --- resolve --list --- |
|
885 | 894 | U file1 |
|
886 | 895 | U file2 |
|
887 | 896 | --- debugmergestate --- |
|
888 | 897 | * version 2 records |
|
889 | 898 | local: ab57bf49aa276a22d35a473592d4c34b5abc3eff |
|
890 | 899 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
891 | 900 | labels: |
|
892 | 901 | local: working copy |
|
893 | 902 | other: destination |
|
894 | 903 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
895 | 904 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
896 | 905 | local path: file1 (flags "") |
|
897 | 906 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
898 | 907 | other path: file1 (node null) |
|
899 | 908 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
900 | 909 | file: file2 (record type "C", state "u", hash null) |
|
901 | 910 | local path: file2 (flags "") |
|
902 | 911 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
903 | 912 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
904 | 913 | --- file1 --- |
|
905 | 914 | 1 |
|
906 | 915 | changed |
|
907 | 916 | --- file2 --- |
|
908 | 917 | 2 |
|
909 | 918 | changed |
|
910 | 919 | --- file3 --- |
|
911 | 920 | 3 |
|
912 | 921 | changed1 |
|
913 | 922 | |
|
914 | 923 | Force prompts with no input |
|
915 | 924 | |
|
916 | 925 | $ hg co -C 0 |
|
917 | 926 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
918 | 927 | $ echo changed >> file1 |
|
919 | 928 | $ hg rm file2 |
|
920 | 929 | $ hg update 1 --config ui.interactive=True --tool :prompt |
|
921 | 930 | local [working copy] changed file1 which other [destination] deleted |
|
922 | 931 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
923 | 932 | other [destination] changed file2 which local [working copy] deleted |
|
924 | 933 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
925 | 934 | 1 files updated, 0 files merged, 0 files removed, 2 files unresolved |
|
926 | 935 | use 'hg resolve' to retry unresolved file merges |
|
927 | 936 | [1] |
|
928 | 937 | $ status 2>&1 | tee $TESTTMP/prompt.status |
|
929 | 938 | --- status --- |
|
930 | 939 | A file1 |
|
931 | 940 | C file2 |
|
932 | 941 | C file3 |
|
933 | 942 | --- resolve --list --- |
|
934 | 943 | U file1 |
|
935 | 944 | U file2 |
|
936 | 945 | --- debugmergestate --- |
|
937 | 946 | * version 2 records |
|
938 | 947 | local: ab57bf49aa276a22d35a473592d4c34b5abc3eff |
|
939 | 948 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
940 | 949 | labels: |
|
941 | 950 | local: working copy |
|
942 | 951 | other: destination |
|
943 | 952 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
944 | 953 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
945 | 954 | local path: file1 (flags "") |
|
946 | 955 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
947 | 956 | other path: file1 (node null) |
|
948 | 957 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
949 | 958 | file: file2 (record type "C", state "u", hash null) |
|
950 | 959 | local path: file2 (flags "") |
|
951 | 960 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
952 | 961 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
953 | 962 | --- file1 --- |
|
954 | 963 | 1 |
|
955 | 964 | changed |
|
956 | 965 | --- file2 --- |
|
957 | 966 | 2 |
|
958 | 967 | changed |
|
959 | 968 | --- file3 --- |
|
960 | 969 | 3 |
|
961 | 970 | changed1 |
|
962 | 971 | $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status |
|
963 | 972 | |
|
964 | 973 | Choose to merge all files |
|
965 | 974 | |
|
966 | 975 | $ hg co -C 0 |
|
967 | 976 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
968 | 977 | $ echo changed >> file1 |
|
969 | 978 | $ hg rm file2 |
|
970 | 979 | $ hg update 1 --tool :merge3 |
|
971 | 980 | local [working copy] changed file1 which other [destination] deleted |
|
972 | 981 | use (c)hanged version, (d)elete, or leave (u)nresolved? u |
|
973 | 982 | other [destination] changed file2 which local [working copy] deleted |
|
974 | 983 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u |
|
975 | 984 | 1 files updated, 0 files merged, 0 files removed, 2 files unresolved |
|
976 | 985 | use 'hg resolve' to retry unresolved file merges |
|
977 | 986 | [1] |
|
978 | 987 | $ status |
|
979 | 988 | --- status --- |
|
980 | 989 | A file1 |
|
981 | 990 | C file2 |
|
982 | 991 | C file3 |
|
983 | 992 | --- resolve --list --- |
|
984 | 993 | U file1 |
|
985 | 994 | U file2 |
|
986 | 995 | --- debugmergestate --- |
|
987 | 996 | * version 2 records |
|
988 | 997 | local: ab57bf49aa276a22d35a473592d4c34b5abc3eff |
|
989 | 998 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 |
|
990 | 999 | labels: |
|
991 | 1000 | local: working copy |
|
992 | 1001 | other: destination |
|
993 | 1002 | file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
994 | 1003 | file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) |
|
995 | 1004 | local path: file1 (flags "") |
|
996 | 1005 | ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) |
|
997 | 1006 | other path: file1 (node null) |
|
998 | 1007 | file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) |
|
999 | 1008 | file: file2 (record type "C", state "u", hash null) |
|
1000 | 1009 | local path: file2 (flags "") |
|
1001 | 1010 | ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) |
|
1002 | 1011 | other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) |
|
1003 | 1012 | --- file1 --- |
|
1004 | 1013 | 1 |
|
1005 | 1014 | changed |
|
1006 | 1015 | --- file2 --- |
|
1007 | 1016 | 2 |
|
1008 | 1017 | changed |
|
1009 | 1018 | --- file3 --- |
|
1010 | 1019 | 3 |
|
1011 | 1020 | changed1 |
|
1012 | 1021 | |
|
1013 | 1022 | Test transitions between different merge tools |
|
1014 | 1023 | |
|
1015 | 1024 | $ testtransitions |
|
1016 | 1025 | === :merge3 -> :local === |
|
1017 | 1026 | (no more unresolved files) |
|
1018 | 1027 | --- diff of status --- |
|
1019 | 1028 | (status identical) |
|
1020 | 1029 | |
|
1021 | 1030 | === :local -> :other === |
|
1022 | 1031 | (no more unresolved files) |
|
1023 | 1032 | --- diff of status --- |
|
1024 | 1033 | (status identical) |
|
1025 | 1034 | |
|
1026 | 1035 | === :other -> :prompt === |
|
1027 | 1036 | local [working copy] changed file1 which other [destination] deleted |
|
1028 | 1037 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
1029 | 1038 | other [destination] changed file2 which local [working copy] deleted |
|
1030 | 1039 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
1031 | 1040 | --- diff of status --- |
|
1032 | 1041 | (status identical) |
|
1033 | 1042 | |
|
1034 | 1043 | === :prompt -> :local === |
|
1035 | 1044 | (no more unresolved files) |
|
1036 | 1045 | --- diff of status --- |
|
1037 | 1046 | (status identical) |
|
1038 | 1047 | |
|
1039 | 1048 | === :local -> :fail === |
|
1040 | 1049 | --- diff of status --- |
|
1041 | 1050 | (status identical) |
|
1042 | 1051 | |
|
1043 | 1052 | === :fail -> :other === |
|
1044 | 1053 | (no more unresolved files) |
|
1045 | 1054 | --- diff of status --- |
|
1046 | 1055 | (status identical) |
|
1047 | 1056 | |
|
1048 | 1057 | === :other -> :local === |
|
1049 | 1058 | (no more unresolved files) |
|
1050 | 1059 | --- diff of status --- |
|
1051 | 1060 | (status identical) |
|
1052 | 1061 | |
|
1053 | 1062 | === :local -> :prompt === |
|
1054 | 1063 | local [working copy] changed file1 which other [destination] deleted |
|
1055 | 1064 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
1056 | 1065 | other [destination] changed file2 which local [working copy] deleted |
|
1057 | 1066 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
1058 | 1067 | --- diff of status --- |
|
1059 | 1068 | (status identical) |
|
1060 | 1069 | |
|
1061 | 1070 | === :prompt -> :other === |
|
1062 | 1071 | (no more unresolved files) |
|
1063 | 1072 | --- diff of status --- |
|
1064 | 1073 | (status identical) |
|
1065 | 1074 | |
|
1066 | 1075 | === :other -> :fail === |
|
1067 | 1076 | --- diff of status --- |
|
1068 | 1077 | (status identical) |
|
1069 | 1078 | |
|
1070 | 1079 | === :fail -> :prompt === |
|
1071 | 1080 | local [working copy] changed file1 which other [destination] deleted |
|
1072 | 1081 | use (c)hanged version, (d)elete, or leave (u)nresolved? |
|
1073 | 1082 | other [destination] changed file2 which local [working copy] deleted |
|
1074 | 1083 | use (c)hanged version, leave (d)eleted, or leave (u)nresolved? |
|
1075 | 1084 | --- diff of status --- |
|
1076 | 1085 | (status identical) |
|
1077 | 1086 | |
|
1078 | 1087 | === :prompt -> :fail === |
|
1079 | 1088 | --- diff of status --- |
|
1080 | 1089 | (status identical) |
|
1081 | 1090 | |
|
1082 | 1091 | === :fail -> :local === |
|
1083 | 1092 | (no more unresolved files) |
|
1084 | 1093 | --- diff of status --- |
|
1085 | 1094 | (status identical) |
|
1086 | 1095 |
@@ -1,151 +1,152 | |||
|
1 | 1 | $ hg init |
|
2 | 2 | $ echo a > a |
|
3 | 3 | $ hg commit -A -ma |
|
4 | 4 | adding a |
|
5 | 5 | |
|
6 | 6 | $ echo b >> a |
|
7 | 7 | $ hg commit -mb |
|
8 | 8 | |
|
9 | 9 | $ echo c >> a |
|
10 | 10 | $ hg commit -mc |
|
11 | 11 | |
|
12 | 12 | $ hg up 1 |
|
13 | 13 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
14 | 14 | $ echo d >> a |
|
15 | 15 | $ hg commit -md |
|
16 | 16 | created new head |
|
17 | 17 | |
|
18 | 18 | $ hg up 1 |
|
19 | 19 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
20 | 20 | $ echo e >> a |
|
21 | 21 | $ hg commit -me |
|
22 | 22 | created new head |
|
23 | 23 | |
|
24 | 24 | $ hg up 1 |
|
25 | 25 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
26 | 26 | |
|
27 | 27 | Should fail because not at a head: |
|
28 | 28 | |
|
29 | 29 | $ hg merge |
|
30 | 30 | abort: working directory not at a head revision |
|
31 | 31 | (use 'hg update' or merge with an explicit revision) |
|
32 | 32 | [255] |
|
33 | 33 | |
|
34 | 34 | $ hg up |
|
35 | 35 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
36 | updated to "f25cbe84d8b3: e" | |
|
36 | 37 | 2 other heads for branch "default" |
|
37 | 38 | |
|
38 | 39 | Should fail because > 2 heads: |
|
39 | 40 | |
|
40 | 41 | $ HGMERGE=internal:other; export HGMERGE |
|
41 | 42 | $ hg merge |
|
42 | 43 | abort: branch 'default' has 3 heads - please merge with an explicit rev |
|
43 | 44 | (run 'hg heads .' to see heads) |
|
44 | 45 | [255] |
|
45 | 46 | |
|
46 | 47 | Should succeed: |
|
47 | 48 | |
|
48 | 49 | $ hg merge 2 |
|
49 | 50 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
50 | 51 | (branch merge, don't forget to commit) |
|
51 | 52 | $ hg commit -mm1 |
|
52 | 53 | |
|
53 | 54 | Should succeed - 2 heads: |
|
54 | 55 | |
|
55 | 56 | $ hg merge -P |
|
56 | 57 | changeset: 3:ea9ff125ff88 |
|
57 | 58 | parent: 1:1846eede8b68 |
|
58 | 59 | user: test |
|
59 | 60 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 61 | summary: d |
|
61 | 62 | |
|
62 | 63 | $ hg merge |
|
63 | 64 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
64 | 65 | (branch merge, don't forget to commit) |
|
65 | 66 | $ hg commit -mm2 |
|
66 | 67 | |
|
67 | 68 | Should fail because at tip: |
|
68 | 69 | |
|
69 | 70 | $ hg merge |
|
70 | 71 | abort: nothing to merge |
|
71 | 72 | [255] |
|
72 | 73 | |
|
73 | 74 | $ hg up 0 |
|
74 | 75 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
75 | 76 | |
|
76 | 77 | Should fail because there is only one head: |
|
77 | 78 | |
|
78 | 79 | $ hg merge |
|
79 | 80 | abort: nothing to merge |
|
80 | 81 | (use 'hg update' instead) |
|
81 | 82 | [255] |
|
82 | 83 | |
|
83 | 84 | $ hg up 3 |
|
84 | 85 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
85 | 86 | |
|
86 | 87 | $ echo f >> a |
|
87 | 88 | $ hg branch foobranch |
|
88 | 89 | marked working directory as branch foobranch |
|
89 | 90 | (branches are permanent and global, did you want a bookmark?) |
|
90 | 91 | $ hg commit -mf |
|
91 | 92 | |
|
92 | 93 | Should fail because merge with other branch: |
|
93 | 94 | |
|
94 | 95 | $ hg merge |
|
95 | 96 | abort: branch 'foobranch' has one head - please merge with an explicit rev |
|
96 | 97 | (run 'hg heads' to see all heads) |
|
97 | 98 | [255] |
|
98 | 99 | |
|
99 | 100 | |
|
100 | 101 | Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that |
|
101 | 102 | are not ancestors of 7, regardless of where their common ancestors are. |
|
102 | 103 | |
|
103 | 104 | Merge preview not affected by common ancestor: |
|
104 | 105 | |
|
105 | 106 | $ hg up -q 7 |
|
106 | 107 | $ hg merge -q -P 6 |
|
107 | 108 | 2:2d95304fed5d |
|
108 | 109 | 4:f25cbe84d8b3 |
|
109 | 110 | 5:a431fabd6039 |
|
110 | 111 | 6:e88e33f3bf62 |
|
111 | 112 | |
|
112 | 113 | Test experimental destination revset |
|
113 | 114 | |
|
114 | 115 | $ hg log -r '_destmerge()' |
|
115 | 116 | abort: branch 'foobranch' has one head - please merge with an explicit rev |
|
116 | 117 | (run 'hg heads' to see all heads) |
|
117 | 118 | [255] |
|
118 | 119 | |
|
119 | 120 | (on a branch with a two heads) |
|
120 | 121 | |
|
121 | 122 | $ hg up 5 |
|
122 | 123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
123 | 124 | $ echo f >> a |
|
124 | 125 | $ hg commit -mf |
|
125 | 126 | created new head |
|
126 | 127 | $ hg log -r '_destmerge()' |
|
127 | 128 | changeset: 6:e88e33f3bf62 |
|
128 | 129 | parent: 5:a431fabd6039 |
|
129 | 130 | parent: 3:ea9ff125ff88 |
|
130 | 131 | user: test |
|
131 | 132 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
132 | 133 | summary: m2 |
|
133 | 134 | |
|
134 | 135 | |
|
135 | 136 | (from the other head) |
|
136 | 137 | |
|
137 | 138 | $ hg log -r '_destmerge(e88e33f3bf62)' |
|
138 | 139 | changeset: 8:b613918999e2 |
|
139 | 140 | tag: tip |
|
140 | 141 | parent: 5:a431fabd6039 |
|
141 | 142 | user: test |
|
142 | 143 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
143 | 144 | summary: f |
|
144 | 145 | |
|
145 | 146 | |
|
146 | 147 | (from unrelated branch) |
|
147 | 148 | |
|
148 | 149 | $ hg log -r '_destmerge(foobranch)' |
|
149 | 150 | abort: branch 'foobranch' has one head - please merge with an explicit rev |
|
150 | 151 | (run 'hg heads' to see all heads) |
|
151 | 152 | [255] |
@@ -1,452 +1,454 | |||
|
1 | 1 | #require symlink execbit |
|
2 | 2 | |
|
3 | 3 | $ tellmeabout() { |
|
4 | 4 | > if [ -h $1 ]; then |
|
5 | 5 | > echo $1 is a symlink: |
|
6 | 6 | > $TESTDIR/readlink.py $1 |
|
7 | 7 | > elif [ -x $1 ]; then |
|
8 | 8 | > echo $1 is an executable file with content: |
|
9 | 9 | > cat $1 |
|
10 | 10 | > else |
|
11 | 11 | > echo $1 is a plain file with content: |
|
12 | 12 | > cat $1 |
|
13 | 13 | > fi |
|
14 | 14 | > } |
|
15 | 15 | |
|
16 | 16 | $ hg init test1 |
|
17 | 17 | $ cd test1 |
|
18 | 18 | |
|
19 | 19 | $ echo a > a |
|
20 | 20 | $ hg ci -Aqmadd |
|
21 | 21 | $ chmod +x a |
|
22 | 22 | $ hg ci -mexecutable |
|
23 | 23 | |
|
24 | 24 | $ hg up -q 0 |
|
25 | 25 | $ rm a |
|
26 | 26 | $ ln -s symlink a |
|
27 | 27 | $ hg ci -msymlink |
|
28 | 28 | created new head |
|
29 | 29 | |
|
30 | 30 | Symlink is local parent, executable is other: |
|
31 | 31 | |
|
32 | 32 | $ hg merge --debug |
|
33 | 33 | searching for copies back to rev 1 |
|
34 | 34 | resolving manifests |
|
35 | 35 | branchmerge: True, force: False, partial: False |
|
36 | 36 | ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c |
|
37 | 37 | preserving a for resolve of a |
|
38 | 38 | a: versions differ -> m (premerge) |
|
39 | 39 | picked tool ':merge' for a (binary False symlink True changedelete False) |
|
40 | 40 | merging a |
|
41 | 41 | my a@521a1e40188f+ other a@3574f3e69b1c ancestor a@c334dc3be0da |
|
42 | 42 | warning: internal :merge cannot merge symlinks for a |
|
43 | 43 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
44 | 44 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
45 | 45 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
46 | 46 | [1] |
|
47 | 47 | |
|
48 | 48 | $ tellmeabout a |
|
49 | 49 | a is a symlink: |
|
50 | 50 | a -> symlink |
|
51 | 51 | $ hg resolve a --tool internal:other |
|
52 | 52 | (no more unresolved files) |
|
53 | 53 | $ tellmeabout a |
|
54 | 54 | a is an executable file with content: |
|
55 | 55 | a |
|
56 | 56 | $ hg st |
|
57 | 57 | M a |
|
58 | 58 | ? a.orig |
|
59 | 59 | |
|
60 | 60 | Symlink is other parent, executable is local: |
|
61 | 61 | |
|
62 | 62 | $ hg update -C 1 |
|
63 | 63 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
64 | 64 | |
|
65 | 65 | $ hg merge --debug --tool :union |
|
66 | 66 | searching for copies back to rev 1 |
|
67 | 67 | resolving manifests |
|
68 | 68 | branchmerge: True, force: False, partial: False |
|
69 | 69 | ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f |
|
70 | 70 | preserving a for resolve of a |
|
71 | 71 | a: versions differ -> m (premerge) |
|
72 | 72 | picked tool ':union' for a (binary False symlink True changedelete False) |
|
73 | 73 | merging a |
|
74 | 74 | my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da |
|
75 | 75 | warning: internal :union cannot merge symlinks for a |
|
76 | 76 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
77 | 77 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
78 | 78 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
79 | 79 | [1] |
|
80 | 80 | |
|
81 | 81 | $ tellmeabout a |
|
82 | 82 | a is an executable file with content: |
|
83 | 83 | a |
|
84 | 84 | |
|
85 | 85 | $ hg update -C 1 |
|
86 | 86 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 | 87 | |
|
88 | 88 | $ hg merge --debug --tool :merge3 |
|
89 | 89 | searching for copies back to rev 1 |
|
90 | 90 | resolving manifests |
|
91 | 91 | branchmerge: True, force: False, partial: False |
|
92 | 92 | ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f |
|
93 | 93 | preserving a for resolve of a |
|
94 | 94 | a: versions differ -> m (premerge) |
|
95 | 95 | picked tool ':merge3' for a (binary False symlink True changedelete False) |
|
96 | 96 | merging a |
|
97 | 97 | my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da |
|
98 | 98 | warning: internal :merge3 cannot merge symlinks for a |
|
99 | 99 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
100 | 100 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
101 | 101 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
102 | 102 | [1] |
|
103 | 103 | |
|
104 | 104 | $ tellmeabout a |
|
105 | 105 | a is an executable file with content: |
|
106 | 106 | a |
|
107 | 107 | |
|
108 | 108 | $ hg update -C 1 |
|
109 | 109 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 110 | |
|
111 | 111 | $ hg merge --debug --tool :merge-local |
|
112 | 112 | searching for copies back to rev 1 |
|
113 | 113 | resolving manifests |
|
114 | 114 | branchmerge: True, force: False, partial: False |
|
115 | 115 | ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f |
|
116 | 116 | preserving a for resolve of a |
|
117 | 117 | a: versions differ -> m (premerge) |
|
118 | 118 | picked tool ':merge-local' for a (binary False symlink True changedelete False) |
|
119 | 119 | merging a |
|
120 | 120 | my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da |
|
121 | 121 | warning: internal :merge-local cannot merge symlinks for a |
|
122 | 122 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
123 | 123 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
124 | 124 | [1] |
|
125 | 125 | |
|
126 | 126 | $ tellmeabout a |
|
127 | 127 | a is an executable file with content: |
|
128 | 128 | a |
|
129 | 129 | |
|
130 | 130 | $ hg update -C 1 |
|
131 | 131 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
132 | 132 | |
|
133 | 133 | $ hg merge --debug --tool :merge-other |
|
134 | 134 | searching for copies back to rev 1 |
|
135 | 135 | resolving manifests |
|
136 | 136 | branchmerge: True, force: False, partial: False |
|
137 | 137 | ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f |
|
138 | 138 | preserving a for resolve of a |
|
139 | 139 | a: versions differ -> m (premerge) |
|
140 | 140 | picked tool ':merge-other' for a (binary False symlink True changedelete False) |
|
141 | 141 | merging a |
|
142 | 142 | my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da |
|
143 | 143 | warning: internal :merge-other cannot merge symlinks for a |
|
144 | 144 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
145 | 145 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
146 | 146 | [1] |
|
147 | 147 | |
|
148 | 148 | $ tellmeabout a |
|
149 | 149 | a is an executable file with content: |
|
150 | 150 | a |
|
151 | 151 | |
|
152 | 152 | Update to link without local change should get us a symlink (issue3316): |
|
153 | 153 | |
|
154 | 154 | $ hg up -C 0 |
|
155 | 155 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
156 | 156 | $ hg up |
|
157 | 157 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
158 | updated to "521a1e40188f: symlink" | |
|
158 | 159 | 1 other heads for branch "default" |
|
159 | 160 | $ hg st |
|
160 | 161 | ? a.orig |
|
161 | 162 | |
|
162 | 163 | Update to link with local change should cause a merge prompt (issue3200): |
|
163 | 164 | |
|
164 | 165 | $ hg up -Cq 0 |
|
165 | 166 | $ echo data > a |
|
166 | 167 | $ HGMERGE= hg up -y --debug |
|
167 | 168 | searching for copies back to rev 2 |
|
168 | 169 | resolving manifests |
|
169 | 170 | branchmerge: False, force: False, partial: False |
|
170 | 171 | ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f |
|
171 | 172 | preserving a for resolve of a |
|
172 | 173 | a: versions differ -> m (premerge) |
|
173 | 174 | (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re) |
|
174 | 175 | no tool found to merge a |
|
175 | 176 | picked tool ':prompt' for a (binary False symlink True changedelete False) |
|
176 | 177 | keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved for a? u |
|
177 | 178 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
178 | 179 | use 'hg resolve' to retry unresolved file merges |
|
180 | updated to "521a1e40188f: symlink" | |
|
179 | 181 | 1 other heads for branch "default" |
|
180 | 182 | [1] |
|
181 | 183 | $ hg diff --git |
|
182 | 184 | diff --git a/a b/a |
|
183 | 185 | old mode 120000 |
|
184 | 186 | new mode 100644 |
|
185 | 187 | --- a/a |
|
186 | 188 | +++ b/a |
|
187 | 189 | @@ -1,1 +1,1 @@ |
|
188 | 190 | -symlink |
|
189 | 191 | \ No newline at end of file |
|
190 | 192 | +data |
|
191 | 193 | |
|
192 | 194 | |
|
193 | 195 | Test only 'l' change - happens rarely, except when recovering from situations |
|
194 | 196 | where that was what happened. |
|
195 | 197 | |
|
196 | 198 | $ hg init test2 |
|
197 | 199 | $ cd test2 |
|
198 | 200 | $ printf base > f |
|
199 | 201 | $ hg ci -Aqm0 |
|
200 | 202 | $ echo file > f |
|
201 | 203 | $ echo content >> f |
|
202 | 204 | $ hg ci -qm1 |
|
203 | 205 | $ hg up -qr0 |
|
204 | 206 | $ rm f |
|
205 | 207 | $ ln -s base f |
|
206 | 208 | $ hg ci -qm2 |
|
207 | 209 | $ hg merge |
|
208 | 210 | merging f |
|
209 | 211 | warning: internal :merge cannot merge symlinks for f |
|
210 | 212 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
211 | 213 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
212 | 214 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
213 | 215 | [1] |
|
214 | 216 | $ tellmeabout f |
|
215 | 217 | f is a symlink: |
|
216 | 218 | f -> base |
|
217 | 219 | |
|
218 | 220 | $ hg up -Cqr1 |
|
219 | 221 | $ hg merge |
|
220 | 222 | merging f |
|
221 | 223 | warning: internal :merge cannot merge symlinks for f |
|
222 | 224 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
223 | 225 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
224 | 226 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
225 | 227 | [1] |
|
226 | 228 | $ tellmeabout f |
|
227 | 229 | f is a plain file with content: |
|
228 | 230 | file |
|
229 | 231 | content |
|
230 | 232 | |
|
231 | 233 | $ cd .. |
|
232 | 234 | |
|
233 | 235 | Test removed 'x' flag merged with change to symlink |
|
234 | 236 | |
|
235 | 237 | $ hg init test3 |
|
236 | 238 | $ cd test3 |
|
237 | 239 | $ echo f > f |
|
238 | 240 | $ chmod +x f |
|
239 | 241 | $ hg ci -Aqm0 |
|
240 | 242 | $ chmod -x f |
|
241 | 243 | $ hg ci -qm1 |
|
242 | 244 | $ hg up -qr0 |
|
243 | 245 | $ rm f |
|
244 | 246 | $ ln -s dangling f |
|
245 | 247 | $ hg ci -qm2 |
|
246 | 248 | $ hg merge |
|
247 | 249 | merging f |
|
248 | 250 | warning: internal :merge cannot merge symlinks for f |
|
249 | 251 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
250 | 252 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
251 | 253 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
252 | 254 | [1] |
|
253 | 255 | $ tellmeabout f |
|
254 | 256 | f is a symlink: |
|
255 | 257 | f -> dangling |
|
256 | 258 | |
|
257 | 259 | $ hg up -Cqr1 |
|
258 | 260 | $ hg merge |
|
259 | 261 | merging f |
|
260 | 262 | warning: internal :merge cannot merge symlinks for f |
|
261 | 263 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
262 | 264 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
263 | 265 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
264 | 266 | [1] |
|
265 | 267 | $ tellmeabout f |
|
266 | 268 | f is a plain file with content: |
|
267 | 269 | f |
|
268 | 270 | |
|
269 | 271 | Test removed 'x' flag merged with content change - both ways |
|
270 | 272 | |
|
271 | 273 | $ hg up -Cqr0 |
|
272 | 274 | $ echo change > f |
|
273 | 275 | $ hg ci -qm3 |
|
274 | 276 | $ hg merge -r1 |
|
275 | 277 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
276 | 278 | (branch merge, don't forget to commit) |
|
277 | 279 | $ tellmeabout f |
|
278 | 280 | f is a plain file with content: |
|
279 | 281 | change |
|
280 | 282 | |
|
281 | 283 | $ hg up -qCr1 |
|
282 | 284 | $ hg merge -r3 |
|
283 | 285 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
284 | 286 | (branch merge, don't forget to commit) |
|
285 | 287 | $ tellmeabout f |
|
286 | 288 | f is a plain file with content: |
|
287 | 289 | change |
|
288 | 290 | |
|
289 | 291 | $ cd .. |
|
290 | 292 | |
|
291 | 293 | Test merge with no common ancestor: |
|
292 | 294 | a: just different |
|
293 | 295 | b: x vs -, different (cannot calculate x, cannot ask merge tool) |
|
294 | 296 | c: x vs -, same (cannot calculate x, merge tool is no good) |
|
295 | 297 | d: x vs l, different |
|
296 | 298 | e: x vs l, same |
|
297 | 299 | f: - vs l, different |
|
298 | 300 | g: - vs l, same |
|
299 | 301 | h: l vs l, different |
|
300 | 302 | (where same means the filelog entry is shared and there thus is an ancestor!) |
|
301 | 303 | |
|
302 | 304 | $ hg init test4 |
|
303 | 305 | $ cd test4 |
|
304 | 306 | $ echo 0 > 0 |
|
305 | 307 | $ hg ci -Aqm0 |
|
306 | 308 | |
|
307 | 309 | $ echo 1 > a |
|
308 | 310 | $ echo 1 > b |
|
309 | 311 | $ chmod +x b |
|
310 | 312 | $ echo 1 > bx |
|
311 | 313 | $ chmod +x bx |
|
312 | 314 | $ echo x > c |
|
313 | 315 | $ chmod +x c |
|
314 | 316 | $ echo 1 > d |
|
315 | 317 | $ chmod +x d |
|
316 | 318 | $ printf x > e |
|
317 | 319 | $ chmod +x e |
|
318 | 320 | $ echo 1 > f |
|
319 | 321 | $ printf x > g |
|
320 | 322 | $ ln -s 1 h |
|
321 | 323 | $ hg ci -qAm1 |
|
322 | 324 | |
|
323 | 325 | $ hg up -qr0 |
|
324 | 326 | $ echo 2 > a |
|
325 | 327 | $ echo 2 > b |
|
326 | 328 | $ echo 2 > bx |
|
327 | 329 | $ chmod +x bx |
|
328 | 330 | $ echo x > c |
|
329 | 331 | $ ln -s 2 d |
|
330 | 332 | $ ln -s x e |
|
331 | 333 | $ ln -s 2 f |
|
332 | 334 | $ ln -s x g |
|
333 | 335 | $ ln -s 2 h |
|
334 | 336 | $ hg ci -Aqm2 |
|
335 | 337 | |
|
336 | 338 | $ hg merge |
|
337 | 339 | merging a |
|
338 | 340 | warning: cannot merge flags for b without common ancestor - keeping local flags |
|
339 | 341 | merging b |
|
340 | 342 | merging bx |
|
341 | 343 | warning: cannot merge flags for c without common ancestor - keeping local flags |
|
342 | 344 | merging d |
|
343 | 345 | warning: internal :merge cannot merge symlinks for d |
|
344 | 346 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
|
345 | 347 | merging f |
|
346 | 348 | warning: internal :merge cannot merge symlinks for f |
|
347 | 349 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
348 | 350 | merging h |
|
349 | 351 | warning: internal :merge cannot merge symlinks for h |
|
350 | 352 | warning: conflicts while merging h! (edit, then use 'hg resolve --mark') |
|
351 | 353 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
352 | 354 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
353 | 355 | warning: conflicts while merging bx! (edit, then use 'hg resolve --mark') |
|
354 | 356 | 3 files updated, 0 files merged, 0 files removed, 6 files unresolved |
|
355 | 357 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
356 | 358 | [1] |
|
357 | 359 | $ hg resolve -l |
|
358 | 360 | U a |
|
359 | 361 | U b |
|
360 | 362 | U bx |
|
361 | 363 | U d |
|
362 | 364 | U f |
|
363 | 365 | U h |
|
364 | 366 | $ tellmeabout a |
|
365 | 367 | a is a plain file with content: |
|
366 | 368 | <<<<<<< working copy: 0c617753b41b - test: 2 |
|
367 | 369 | 2 |
|
368 | 370 | ======= |
|
369 | 371 | 1 |
|
370 | 372 | >>>>>>> merge rev: 2e60aa20b912 - test: 1 |
|
371 | 373 | $ tellmeabout b |
|
372 | 374 | b is a plain file with content: |
|
373 | 375 | <<<<<<< working copy: 0c617753b41b - test: 2 |
|
374 | 376 | 2 |
|
375 | 377 | ======= |
|
376 | 378 | 1 |
|
377 | 379 | >>>>>>> merge rev: 2e60aa20b912 - test: 1 |
|
378 | 380 | $ tellmeabout c |
|
379 | 381 | c is a plain file with content: |
|
380 | 382 | x |
|
381 | 383 | $ tellmeabout d |
|
382 | 384 | d is a symlink: |
|
383 | 385 | d -> 2 |
|
384 | 386 | $ tellmeabout e |
|
385 | 387 | e is a symlink: |
|
386 | 388 | e -> x |
|
387 | 389 | $ tellmeabout f |
|
388 | 390 | f is a symlink: |
|
389 | 391 | f -> 2 |
|
390 | 392 | $ tellmeabout g |
|
391 | 393 | g is a symlink: |
|
392 | 394 | g -> x |
|
393 | 395 | $ tellmeabout h |
|
394 | 396 | h is a symlink: |
|
395 | 397 | h -> 2 |
|
396 | 398 | |
|
397 | 399 | $ hg up -Cqr1 |
|
398 | 400 | $ hg merge |
|
399 | 401 | merging a |
|
400 | 402 | warning: cannot merge flags for b without common ancestor - keeping local flags |
|
401 | 403 | merging b |
|
402 | 404 | merging bx |
|
403 | 405 | warning: cannot merge flags for c without common ancestor - keeping local flags |
|
404 | 406 | merging d |
|
405 | 407 | warning: internal :merge cannot merge symlinks for d |
|
406 | 408 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
|
407 | 409 | merging f |
|
408 | 410 | warning: internal :merge cannot merge symlinks for f |
|
409 | 411 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
410 | 412 | merging h |
|
411 | 413 | warning: internal :merge cannot merge symlinks for h |
|
412 | 414 | warning: conflicts while merging h! (edit, then use 'hg resolve --mark') |
|
413 | 415 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
414 | 416 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
415 | 417 | warning: conflicts while merging bx! (edit, then use 'hg resolve --mark') |
|
416 | 418 | 3 files updated, 0 files merged, 0 files removed, 6 files unresolved |
|
417 | 419 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
418 | 420 | [1] |
|
419 | 421 | $ tellmeabout a |
|
420 | 422 | a is a plain file with content: |
|
421 | 423 | <<<<<<< working copy: 2e60aa20b912 - test: 1 |
|
422 | 424 | 1 |
|
423 | 425 | ======= |
|
424 | 426 | 2 |
|
425 | 427 | >>>>>>> merge rev: 0c617753b41b - test: 2 |
|
426 | 428 | $ tellmeabout b |
|
427 | 429 | b is an executable file with content: |
|
428 | 430 | <<<<<<< working copy: 2e60aa20b912 - test: 1 |
|
429 | 431 | 1 |
|
430 | 432 | ======= |
|
431 | 433 | 2 |
|
432 | 434 | >>>>>>> merge rev: 0c617753b41b - test: 2 |
|
433 | 435 | $ tellmeabout c |
|
434 | 436 | c is an executable file with content: |
|
435 | 437 | x |
|
436 | 438 | $ tellmeabout d |
|
437 | 439 | d is an executable file with content: |
|
438 | 440 | 1 |
|
439 | 441 | $ tellmeabout e |
|
440 | 442 | e is an executable file with content: |
|
441 | 443 | x (no-eol) |
|
442 | 444 | $ tellmeabout f |
|
443 | 445 | f is a plain file with content: |
|
444 | 446 | 1 |
|
445 | 447 | $ tellmeabout g |
|
446 | 448 | g is a plain file with content: |
|
447 | 449 | x (no-eol) |
|
448 | 450 | $ tellmeabout h |
|
449 | 451 | h is a symlink: |
|
450 | 452 | h -> 1 |
|
451 | 453 | |
|
452 | 454 | $ cd .. |
@@ -1,215 +1,216 | |||
|
1 | 1 | $ hg init t |
|
2 | 2 | $ cd t |
|
3 | 3 | $ echo 1 > foo |
|
4 | 4 | $ hg ci -Am1 # 0 |
|
5 | 5 | adding foo |
|
6 | 6 | $ hg branch branchA |
|
7 | 7 | marked working directory as branch branchA |
|
8 | 8 | (branches are permanent and global, did you want a bookmark?) |
|
9 | 9 | $ echo a1 > foo |
|
10 | 10 | $ hg ci -ma1 # 1 |
|
11 | 11 | |
|
12 | 12 | $ cd .. |
|
13 | 13 | $ hg init tt |
|
14 | 14 | $ cd tt |
|
15 | 15 | $ hg pull ../t |
|
16 | 16 | pulling from ../t |
|
17 | 17 | requesting all changes |
|
18 | 18 | adding changesets |
|
19 | 19 | adding manifests |
|
20 | 20 | adding file changes |
|
21 | 21 | added 2 changesets with 2 changes to 1 files |
|
22 | 22 | (run 'hg update' to get a working copy) |
|
23 | 23 | $ hg up branchA |
|
24 | 24 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
25 | 25 | |
|
26 | 26 | $ cd ../t |
|
27 | 27 | $ echo a2 > foo |
|
28 | 28 | $ hg ci -ma2 # 2 |
|
29 | 29 | |
|
30 | 30 | Create branch B: |
|
31 | 31 | |
|
32 | 32 | $ hg up 0 |
|
33 | 33 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
34 | 34 | $ hg branch branchB |
|
35 | 35 | marked working directory as branch branchB |
|
36 | 36 | $ echo b1 > foo |
|
37 | 37 | $ hg ci -mb1 # 3 |
|
38 | 38 | |
|
39 | 39 | $ cd ../tt |
|
40 | 40 | |
|
41 | 41 | A new branch is there |
|
42 | 42 | |
|
43 | 43 | $ hg pull -u ../t |
|
44 | 44 | pulling from ../t |
|
45 | 45 | searching for changes |
|
46 | 46 | adding changesets |
|
47 | 47 | adding manifests |
|
48 | 48 | adding file changes |
|
49 | 49 | added 2 changesets with 2 changes to 1 files (+1 heads) |
|
50 | 50 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
51 | 51 | |
|
52 | 52 | Develop both branches: |
|
53 | 53 | |
|
54 | 54 | $ cd ../t |
|
55 | 55 | $ hg up branchA |
|
56 | 56 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
57 | 57 | $ echo a3 > foo |
|
58 | 58 | $ hg ci -ma3 # 4 |
|
59 | 59 | $ hg up branchB |
|
60 | 60 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
61 | 61 | $ echo b2 > foo |
|
62 | 62 | $ hg ci -mb2 # 5 |
|
63 | 63 | |
|
64 | 64 | $ cd ../tt |
|
65 | 65 | |
|
66 | 66 | Should succeed, no new heads: |
|
67 | 67 | |
|
68 | 68 | $ hg pull -u ../t |
|
69 | 69 | pulling from ../t |
|
70 | 70 | searching for changes |
|
71 | 71 | adding changesets |
|
72 | 72 | adding manifests |
|
73 | 73 | adding file changes |
|
74 | 74 | added 2 changesets with 2 changes to 1 files |
|
75 | 75 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
76 | 76 | |
|
77 | 77 | Add a head on other branch: |
|
78 | 78 | |
|
79 | 79 | $ cd ../t |
|
80 | 80 | $ hg up branchA |
|
81 | 81 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
82 | 82 | $ echo a4 > foo |
|
83 | 83 | $ hg ci -ma4 # 6 |
|
84 | 84 | $ hg up branchB |
|
85 | 85 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
86 | 86 | $ echo b3.1 > foo |
|
87 | 87 | $ hg ci -m b3.1 # 7 |
|
88 | 88 | $ hg up 5 |
|
89 | 89 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | 90 | $ echo b3.2 > foo |
|
91 | 91 | $ hg ci -m b3.2 # 8 |
|
92 | 92 | created new head |
|
93 | 93 | |
|
94 | 94 | $ cd ../tt |
|
95 | 95 | |
|
96 | 96 | Should succeed because there is only one head on our branch: |
|
97 | 97 | |
|
98 | 98 | $ hg pull -u ../t |
|
99 | 99 | pulling from ../t |
|
100 | 100 | searching for changes |
|
101 | 101 | adding changesets |
|
102 | 102 | adding manifests |
|
103 | 103 | adding file changes |
|
104 | 104 | added 3 changesets with 3 changes to 1 files (+1 heads) |
|
105 | 105 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
106 | 106 | |
|
107 | 107 | $ cd ../t |
|
108 | 108 | $ hg up -C branchA |
|
109 | 109 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 110 | $ echo a5.1 > foo |
|
111 | 111 | $ hg ci -ma5.1 # 9 |
|
112 | 112 | $ hg up 6 |
|
113 | 113 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
114 | 114 | $ echo a5.2 > foo |
|
115 | 115 | $ hg ci -ma5.2 # 10 |
|
116 | 116 | created new head |
|
117 | 117 | $ hg up 7 |
|
118 | 118 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
119 | 119 | $ echo b4.1 > foo |
|
120 | 120 | $ hg ci -m b4.1 # 11 |
|
121 | 121 | $ hg up -C 8 |
|
122 | 122 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
123 | 123 | $ echo b4.2 > foo |
|
124 | 124 | $ hg ci -m b4.2 # 12 |
|
125 | 125 | |
|
126 | 126 | $ cd ../tt |
|
127 | 127 | |
|
128 | 128 | $ hg pull -u ../t |
|
129 | 129 | pulling from ../t |
|
130 | 130 | searching for changes |
|
131 | 131 | adding changesets |
|
132 | 132 | adding manifests |
|
133 | 133 | adding file changes |
|
134 | 134 | added 4 changesets with 4 changes to 1 files (+1 heads) |
|
135 | 135 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
136 | updated to "d740e1a584e7: a5.2" | |
|
136 | 137 | 1 other heads for branch "branchA" |
|
137 | 138 | |
|
138 | 139 | Make changes on new branch on tt |
|
139 | 140 | |
|
140 | 141 | $ hg up 6 |
|
141 | 142 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
142 | 143 | $ hg branch branchC |
|
143 | 144 | marked working directory as branch branchC |
|
144 | 145 | $ echo b1 > bar |
|
145 | 146 | $ hg ci -Am "commit on branchC on tt" |
|
146 | 147 | adding bar |
|
147 | 148 | |
|
148 | 149 | Make changes on default branch on t |
|
149 | 150 | |
|
150 | 151 | $ cd ../t |
|
151 | 152 | $ hg up -C default |
|
152 | 153 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
153 | 154 | $ echo a1 > bar |
|
154 | 155 | $ hg ci -Am "commit on default on t" |
|
155 | 156 | adding bar |
|
156 | 157 | |
|
157 | 158 | Pull branchC from tt |
|
158 | 159 | |
|
159 | 160 | $ hg pull ../tt |
|
160 | 161 | pulling from ../tt |
|
161 | 162 | searching for changes |
|
162 | 163 | adding changesets |
|
163 | 164 | adding manifests |
|
164 | 165 | adding file changes |
|
165 | 166 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
166 | 167 | (run 'hg heads' to see heads) |
|
167 | 168 | |
|
168 | 169 | Make changes on default and branchC on tt |
|
169 | 170 | |
|
170 | 171 | $ cd ../tt |
|
171 | 172 | $ hg pull ../t |
|
172 | 173 | pulling from ../t |
|
173 | 174 | searching for changes |
|
174 | 175 | adding changesets |
|
175 | 176 | adding manifests |
|
176 | 177 | adding file changes |
|
177 | 178 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
178 | 179 | (run 'hg heads' to see heads) |
|
179 | 180 | $ hg up -C default |
|
180 | 181 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
181 | 182 | $ echo a1 > bar1 |
|
182 | 183 | $ hg ci -Am "commit on default on tt" |
|
183 | 184 | adding bar1 |
|
184 | 185 | $ hg up branchC |
|
185 | 186 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
186 | 187 | $ echo a1 > bar2 |
|
187 | 188 | $ hg ci -Am "commit on branchC on tt" |
|
188 | 189 | adding bar2 |
|
189 | 190 | |
|
190 | 191 | Make changes on default and branchC on t |
|
191 | 192 | |
|
192 | 193 | $ cd ../t |
|
193 | 194 | $ hg up default |
|
194 | 195 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
195 | 196 | $ echo a1 > bar3 |
|
196 | 197 | $ hg ci -Am "commit on default on t" |
|
197 | 198 | adding bar3 |
|
198 | 199 | $ hg up branchC |
|
199 | 200 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
200 | 201 | $ echo a1 > bar4 |
|
201 | 202 | $ hg ci -Am "commit on branchC on tt" |
|
202 | 203 | adding bar4 |
|
203 | 204 | |
|
204 | 205 | Pull from tt |
|
205 | 206 | |
|
206 | 207 | $ hg pull ../tt |
|
207 | 208 | pulling from ../tt |
|
208 | 209 | searching for changes |
|
209 | 210 | adding changesets |
|
210 | 211 | adding manifests |
|
211 | 212 | adding file changes |
|
212 | 213 | added 2 changesets with 2 changes to 2 files (+2 heads) |
|
213 | 214 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
214 | 215 | |
|
215 | 216 | $ cd .. |
@@ -1,229 +1,231 | |||
|
1 | 1 | $ hg init t |
|
2 | 2 | $ cd t |
|
3 | 3 | $ echo 1 > foo |
|
4 | 4 | $ hg ci -Am m |
|
5 | 5 | adding foo |
|
6 | 6 | |
|
7 | 7 | $ cd .. |
|
8 | 8 | $ hg clone t tt |
|
9 | 9 | updating to branch default |
|
10 | 10 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
11 | 11 | $ cd tt |
|
12 | 12 | $ echo 1.1 > foo |
|
13 | 13 | $ hg ci -Am m |
|
14 | 14 | |
|
15 | 15 | $ cd ../t |
|
16 | 16 | $ echo 1.2 > foo |
|
17 | 17 | $ hg ci -Am m |
|
18 | 18 | |
|
19 | 19 | Should respect config to disable dirty update |
|
20 | 20 | $ hg co -qC 0 |
|
21 | 21 | $ echo 2 > foo |
|
22 | 22 | $ hg --config experimental.updatecheck=abort pull -u ../tt |
|
23 | 23 | pulling from ../tt |
|
24 | 24 | searching for changes |
|
25 | 25 | adding changesets |
|
26 | 26 | adding manifests |
|
27 | 27 | adding file changes |
|
28 | 28 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
29 | 29 | abort: uncommitted changes |
|
30 | 30 | [255] |
|
31 | 31 | $ hg --config extensions.strip= strip --no-backup tip |
|
32 | 32 | $ hg co -qC tip |
|
33 | 33 | |
|
34 | 34 | Should not update to the other topological branch: |
|
35 | 35 | |
|
36 | 36 | $ hg pull -u ../tt |
|
37 | 37 | pulling from ../tt |
|
38 | 38 | searching for changes |
|
39 | 39 | adding changesets |
|
40 | 40 | adding manifests |
|
41 | 41 | adding file changes |
|
42 | 42 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
43 | 43 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
44 | updated to "800c91d5bfc1: m" | |
|
44 | 45 | 1 other heads for branch "default" |
|
45 | 46 | |
|
46 | 47 | $ cd ../tt |
|
47 | 48 | |
|
48 | 49 | Should not update to the other branch: |
|
49 | 50 | |
|
50 | 51 | $ hg pull -u ../t |
|
51 | 52 | pulling from ../t |
|
52 | 53 | searching for changes |
|
53 | 54 | adding changesets |
|
54 | 55 | adding manifests |
|
55 | 56 | adding file changes |
|
56 | 57 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
57 | 58 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
59 | updated to "107cefe13e42: m" | |
|
58 | 60 | 1 other heads for branch "default" |
|
59 | 61 | |
|
60 | 62 | $ HGMERGE=true hg merge |
|
61 | 63 | merging foo |
|
62 | 64 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
63 | 65 | (branch merge, don't forget to commit) |
|
64 | 66 | $ hg ci -mm |
|
65 | 67 | |
|
66 | 68 | $ cd ../t |
|
67 | 69 | |
|
68 | 70 | Should work: |
|
69 | 71 | |
|
70 | 72 | $ hg pull -u ../tt |
|
71 | 73 | pulling from ../tt |
|
72 | 74 | searching for changes |
|
73 | 75 | adding changesets |
|
74 | 76 | adding manifests |
|
75 | 77 | adding file changes |
|
76 | 78 | added 1 changesets with 1 changes to 1 files (-1 heads) |
|
77 | 79 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 80 | |
|
79 | 81 | Similarity between "hg update" and "hg pull -u" in handling bookmark |
|
80 | 82 | ==================================================================== |
|
81 | 83 | |
|
82 | 84 | Test that updating activates the bookmark, which matches with the |
|
83 | 85 | explicit destination of the update. |
|
84 | 86 | |
|
85 | 87 | $ echo 4 >> foo |
|
86 | 88 | $ hg commit -m "#4" |
|
87 | 89 | $ hg bookmark active-after-pull |
|
88 | 90 | $ cd ../tt |
|
89 | 91 | |
|
90 | 92 | (1) activating by --rev BOOKMARK |
|
91 | 93 | |
|
92 | 94 | $ hg bookmark -f active-before-pull |
|
93 | 95 | $ hg bookmarks |
|
94 | 96 | * active-before-pull 3:483b76ad4309 |
|
95 | 97 | |
|
96 | 98 | $ hg pull -u -r active-after-pull |
|
97 | 99 | pulling from $TESTTMP/t (glob) |
|
98 | 100 | searching for changes |
|
99 | 101 | adding changesets |
|
100 | 102 | adding manifests |
|
101 | 103 | adding file changes |
|
102 | 104 | added 1 changesets with 1 changes to 1 files |
|
103 | 105 | adding remote bookmark active-after-pull |
|
104 | 106 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
105 | 107 | (activating bookmark active-after-pull) |
|
106 | 108 | |
|
107 | 109 | $ hg parents -q |
|
108 | 110 | 4:f815b3da6163 |
|
109 | 111 | $ hg bookmarks |
|
110 | 112 | * active-after-pull 4:f815b3da6163 |
|
111 | 113 | active-before-pull 3:483b76ad4309 |
|
112 | 114 | |
|
113 | 115 | (discard pulled changes) |
|
114 | 116 | |
|
115 | 117 | $ hg update -q 483b76ad4309 |
|
116 | 118 | $ hg rollback -q |
|
117 | 119 | |
|
118 | 120 | (2) activating by URL#BOOKMARK |
|
119 | 121 | |
|
120 | 122 | $ hg bookmark -f active-before-pull |
|
121 | 123 | $ hg bookmarks |
|
122 | 124 | * active-before-pull 3:483b76ad4309 |
|
123 | 125 | |
|
124 | 126 | $ hg pull -u $TESTTMP/t#active-after-pull |
|
125 | 127 | pulling from $TESTTMP/t (glob) |
|
126 | 128 | searching for changes |
|
127 | 129 | adding changesets |
|
128 | 130 | adding manifests |
|
129 | 131 | adding file changes |
|
130 | 132 | added 1 changesets with 1 changes to 1 files |
|
131 | 133 | adding remote bookmark active-after-pull |
|
132 | 134 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
133 | 135 | (activating bookmark active-after-pull) |
|
134 | 136 | |
|
135 | 137 | $ hg parents -q |
|
136 | 138 | 4:f815b3da6163 |
|
137 | 139 | $ hg bookmarks |
|
138 | 140 | * active-after-pull 4:f815b3da6163 |
|
139 | 141 | active-before-pull 3:483b76ad4309 |
|
140 | 142 | |
|
141 | 143 | (discard pulled changes) |
|
142 | 144 | |
|
143 | 145 | $ hg update -q 483b76ad4309 |
|
144 | 146 | $ hg rollback -q |
|
145 | 147 | |
|
146 | 148 | Test that updating deactivates current active bookmark, if the |
|
147 | 149 | destination of the update is explicitly specified, and it doesn't |
|
148 | 150 | match with the name of any existing bookmarks. |
|
149 | 151 | |
|
150 | 152 | $ cd ../t |
|
151 | 153 | $ hg bookmark -d active-after-pull |
|
152 | 154 | $ hg branch bar -q |
|
153 | 155 | $ hg commit -m "#5 (bar #1)" |
|
154 | 156 | $ cd ../tt |
|
155 | 157 | |
|
156 | 158 | (1) deactivating by --rev REV |
|
157 | 159 | |
|
158 | 160 | $ hg bookmark -f active-before-pull |
|
159 | 161 | $ hg bookmarks |
|
160 | 162 | * active-before-pull 3:483b76ad4309 |
|
161 | 163 | |
|
162 | 164 | $ hg pull -u -r b5e4babfaaa7 |
|
163 | 165 | pulling from $TESTTMP/t (glob) |
|
164 | 166 | searching for changes |
|
165 | 167 | adding changesets |
|
166 | 168 | adding manifests |
|
167 | 169 | adding file changes |
|
168 | 170 | added 2 changesets with 1 changes to 1 files |
|
169 | 171 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
170 | 172 | (leaving bookmark active-before-pull) |
|
171 | 173 | |
|
172 | 174 | $ hg parents -q |
|
173 | 175 | 5:b5e4babfaaa7 |
|
174 | 176 | $ hg bookmarks |
|
175 | 177 | active-before-pull 3:483b76ad4309 |
|
176 | 178 | |
|
177 | 179 | (discard pulled changes) |
|
178 | 180 | |
|
179 | 181 | $ hg update -q 483b76ad4309 |
|
180 | 182 | $ hg rollback -q |
|
181 | 183 | |
|
182 | 184 | (2) deactivating by --branch BRANCH |
|
183 | 185 | |
|
184 | 186 | $ hg bookmark -f active-before-pull |
|
185 | 187 | $ hg bookmarks |
|
186 | 188 | * active-before-pull 3:483b76ad4309 |
|
187 | 189 | |
|
188 | 190 | $ hg pull -u -b bar |
|
189 | 191 | pulling from $TESTTMP/t (glob) |
|
190 | 192 | searching for changes |
|
191 | 193 | adding changesets |
|
192 | 194 | adding manifests |
|
193 | 195 | adding file changes |
|
194 | 196 | added 2 changesets with 1 changes to 1 files |
|
195 | 197 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
196 | 198 | (leaving bookmark active-before-pull) |
|
197 | 199 | |
|
198 | 200 | $ hg parents -q |
|
199 | 201 | 5:b5e4babfaaa7 |
|
200 | 202 | $ hg bookmarks |
|
201 | 203 | active-before-pull 3:483b76ad4309 |
|
202 | 204 | |
|
203 | 205 | (discard pulled changes) |
|
204 | 206 | |
|
205 | 207 | $ hg update -q 483b76ad4309 |
|
206 | 208 | $ hg rollback -q |
|
207 | 209 | |
|
208 | 210 | (3) deactivating by URL#ANOTHER-BRANCH |
|
209 | 211 | |
|
210 | 212 | $ hg bookmark -f active-before-pull |
|
211 | 213 | $ hg bookmarks |
|
212 | 214 | * active-before-pull 3:483b76ad4309 |
|
213 | 215 | |
|
214 | 216 | $ hg pull -u $TESTTMP/t#bar |
|
215 | 217 | pulling from $TESTTMP/t (glob) |
|
216 | 218 | searching for changes |
|
217 | 219 | adding changesets |
|
218 | 220 | adding manifests |
|
219 | 221 | adding file changes |
|
220 | 222 | added 2 changesets with 1 changes to 1 files |
|
221 | 223 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
222 | 224 | (leaving bookmark active-before-pull) |
|
223 | 225 | |
|
224 | 226 | $ hg parents -q |
|
225 | 227 | 5:b5e4babfaaa7 |
|
226 | 228 | $ hg bookmarks |
|
227 | 229 | active-before-pull 3:483b76ad4309 |
|
228 | 230 | |
|
229 | 231 | $ cd .. |
@@ -1,451 +1,452 | |||
|
1 | 1 | $ cat >> $HGRCPATH <<EOF |
|
2 | 2 | > [extensions] |
|
3 | 3 | > rebase= |
|
4 | 4 | > histedit= |
|
5 | 5 | > |
|
6 | 6 | > [alias] |
|
7 | 7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
8 | 8 | > EOF |
|
9 | 9 | |
|
10 | 10 | |
|
11 | 11 | $ hg init a |
|
12 | 12 | $ cd a |
|
13 | 13 | |
|
14 | 14 | $ echo C1 > C1 |
|
15 | 15 | $ hg ci -Am C1 |
|
16 | 16 | adding C1 |
|
17 | 17 | |
|
18 | 18 | $ echo C2 > C2 |
|
19 | 19 | $ hg ci -Am C2 |
|
20 | 20 | adding C2 |
|
21 | 21 | |
|
22 | 22 | $ cd .. |
|
23 | 23 | |
|
24 | 24 | $ hg clone a b |
|
25 | 25 | updating to branch default |
|
26 | 26 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
27 | 27 | |
|
28 | 28 | $ hg clone a c |
|
29 | 29 | updating to branch default |
|
30 | 30 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
31 | 31 | |
|
32 | 32 | $ cd b |
|
33 | 33 | |
|
34 | 34 | $ echo L1 > L1 |
|
35 | 35 | $ hg ci -Am L1 |
|
36 | 36 | adding L1 |
|
37 | 37 | |
|
38 | 38 | |
|
39 | 39 | $ cd ../a |
|
40 | 40 | |
|
41 | 41 | $ echo R1 > R1 |
|
42 | 42 | $ hg ci -Am R1 |
|
43 | 43 | adding R1 |
|
44 | 44 | |
|
45 | 45 | |
|
46 | 46 | $ cd ../b |
|
47 | 47 | |
|
48 | 48 | Now b has one revision to be pulled from a: |
|
49 | 49 | |
|
50 | 50 | $ hg pull --rebase |
|
51 | 51 | pulling from $TESTTMP/a (glob) |
|
52 | 52 | searching for changes |
|
53 | 53 | adding changesets |
|
54 | 54 | adding manifests |
|
55 | 55 | adding file changes |
|
56 | 56 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
57 | 57 | rebasing 2:ff8d69a621f9 "L1" |
|
58 | 58 | saved backup bundle to $TESTTMP/b/.hg/strip-backup/ff8d69a621f9-160fa373-backup.hg (glob) |
|
59 | 59 | |
|
60 | 60 | $ hg tglog |
|
61 | 61 | @ 3: 'L1' |
|
62 | 62 | | |
|
63 | 63 | o 2: 'R1' |
|
64 | 64 | | |
|
65 | 65 | o 1: 'C2' |
|
66 | 66 | | |
|
67 | 67 | o 0: 'C1' |
|
68 | 68 | |
|
69 | 69 | Re-run: |
|
70 | 70 | |
|
71 | 71 | $ hg pull --rebase |
|
72 | 72 | pulling from $TESTTMP/a (glob) |
|
73 | 73 | searching for changes |
|
74 | 74 | no changes found |
|
75 | 75 | |
|
76 | 76 | Abort pull early if working dir is not clean: |
|
77 | 77 | |
|
78 | 78 | $ echo L1-mod > L1 |
|
79 | 79 | $ hg pull --rebase |
|
80 | 80 | abort: uncommitted changes |
|
81 | 81 | (cannot pull with rebase: please commit or shelve your changes first) |
|
82 | 82 | [255] |
|
83 | 83 | $ hg update --clean --quiet |
|
84 | 84 | |
|
85 | 85 | Abort pull early if another operation (histedit) is in progress: |
|
86 | 86 | |
|
87 | 87 | $ hg histedit . -q --commands - << EOF |
|
88 | 88 | > edit d80cc2da061e histedit: generate unfinished state |
|
89 | 89 | > EOF |
|
90 | 90 | Editing (d80cc2da061e), you may commit or record as needed now. |
|
91 | 91 | (hg histedit --continue to resume) |
|
92 | 92 | [1] |
|
93 | 93 | $ hg pull --rebase |
|
94 | 94 | abort: histedit in progress |
|
95 | 95 | (use 'hg histedit --continue' or 'hg histedit --abort') |
|
96 | 96 | [255] |
|
97 | 97 | $ hg histedit --abort --quiet |
|
98 | 98 | |
|
99 | 99 | Abort pull early with pending uncommitted merge: |
|
100 | 100 | |
|
101 | 101 | $ cd .. |
|
102 | 102 | $ hg clone --noupdate c d |
|
103 | 103 | $ cd d |
|
104 | 104 | $ hg tglog |
|
105 | 105 | o 1: 'C2' |
|
106 | 106 | | |
|
107 | 107 | o 0: 'C1' |
|
108 | 108 | |
|
109 | 109 | $ hg update --quiet 0 |
|
110 | 110 | $ echo M1 > M1 |
|
111 | 111 | $ hg commit --quiet -Am M1 |
|
112 | 112 | $ hg update --quiet 1 |
|
113 | 113 | $ hg merge 2 |
|
114 | 114 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
115 | 115 | (branch merge, don't forget to commit) |
|
116 | 116 | $ hg pull --rebase |
|
117 | 117 | abort: outstanding uncommitted merge |
|
118 | 118 | (cannot pull with rebase: please commit or shelve your changes first) |
|
119 | 119 | [255] |
|
120 | 120 | $ hg update --clean --quiet |
|
121 | 121 | |
|
122 | 122 | Abort pull early with unclean subrepo: |
|
123 | 123 | $ echo s = s > .hgsub |
|
124 | 124 | $ hg add .hgsub |
|
125 | 125 | $ hg init s |
|
126 | 126 | $ hg commit -m "generated a subrepo" |
|
127 | 127 | $ echo a > s/a |
|
128 | 128 | $ hg -R s add s/a |
|
129 | 129 | $ hg pull --rebase |
|
130 | 130 | abort: uncommitted changes in subrepository 's' |
|
131 | 131 | (cannot pull with rebase: please commit or shelve your changes first) |
|
132 | 132 | [255] |
|
133 | 133 | |
|
134 | 134 | Invoke pull --rebase and nothing to rebase: |
|
135 | 135 | |
|
136 | 136 | $ cd ../c |
|
137 | 137 | |
|
138 | 138 | $ hg book norebase |
|
139 | 139 | $ hg pull --rebase |
|
140 | 140 | pulling from $TESTTMP/a (glob) |
|
141 | 141 | searching for changes |
|
142 | 142 | adding changesets |
|
143 | 143 | adding manifests |
|
144 | 144 | adding file changes |
|
145 | 145 | added 1 changesets with 1 changes to 1 files |
|
146 | 146 | nothing to rebase - updating instead |
|
147 | 147 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
148 | 148 | updating bookmark norebase |
|
149 | 149 | |
|
150 | 150 | $ hg tglog -l 1 |
|
151 | 151 | @ 2: 'R1' |
|
152 | 152 | | |
|
153 | 153 | ~ |
|
154 | 154 | |
|
155 | 155 | pull --rebase --update should ignore --update: |
|
156 | 156 | |
|
157 | 157 | $ hg pull --rebase --update |
|
158 | 158 | pulling from $TESTTMP/a (glob) |
|
159 | 159 | searching for changes |
|
160 | 160 | no changes found |
|
161 | 161 | |
|
162 | 162 | pull --rebase doesn't update if nothing has been pulled: |
|
163 | 163 | |
|
164 | 164 | $ hg up -q 1 |
|
165 | 165 | |
|
166 | 166 | $ hg pull --rebase |
|
167 | 167 | pulling from $TESTTMP/a (glob) |
|
168 | 168 | searching for changes |
|
169 | 169 | no changes found |
|
170 | 170 | |
|
171 | 171 | $ hg tglog -l 1 |
|
172 | 172 | o 2: 'R1' |
|
173 | 173 | | |
|
174 | 174 | ~ |
|
175 | 175 | |
|
176 | 176 | $ cd .. |
|
177 | 177 | |
|
178 | 178 | pull --rebase works when a specific revision is pulled (issue3619) |
|
179 | 179 | |
|
180 | 180 | $ cd a |
|
181 | 181 | $ hg tglog |
|
182 | 182 | @ 2: 'R1' |
|
183 | 183 | | |
|
184 | 184 | o 1: 'C2' |
|
185 | 185 | | |
|
186 | 186 | o 0: 'C1' |
|
187 | 187 | |
|
188 | 188 | $ echo R2 > R2 |
|
189 | 189 | $ hg ci -Am R2 |
|
190 | 190 | adding R2 |
|
191 | 191 | $ echo R3 > R3 |
|
192 | 192 | $ hg ci -Am R3 |
|
193 | 193 | adding R3 |
|
194 | 194 | $ cd ../c |
|
195 | 195 | $ hg tglog |
|
196 | 196 | o 2: 'R1' |
|
197 | 197 | | |
|
198 | 198 | @ 1: 'C2' |
|
199 | 199 | | |
|
200 | 200 | o 0: 'C1' |
|
201 | 201 | |
|
202 | 202 | $ echo L1 > L1 |
|
203 | 203 | $ hg ci -Am L1 |
|
204 | 204 | adding L1 |
|
205 | 205 | created new head |
|
206 | 206 | $ hg pull --rev tip --rebase |
|
207 | 207 | pulling from $TESTTMP/a (glob) |
|
208 | 208 | searching for changes |
|
209 | 209 | adding changesets |
|
210 | 210 | adding manifests |
|
211 | 211 | adding file changes |
|
212 | 212 | added 2 changesets with 2 changes to 2 files |
|
213 | 213 | rebasing 3:ff8d69a621f9 "L1" |
|
214 | 214 | saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-160fa373-backup.hg (glob) |
|
215 | 215 | $ hg tglog |
|
216 | 216 | @ 5: 'L1' |
|
217 | 217 | | |
|
218 | 218 | o 4: 'R3' |
|
219 | 219 | | |
|
220 | 220 | o 3: 'R2' |
|
221 | 221 | | |
|
222 | 222 | o 2: 'R1' |
|
223 | 223 | | |
|
224 | 224 | o 1: 'C2' |
|
225 | 225 | | |
|
226 | 226 | o 0: 'C1' |
|
227 | 227 | |
|
228 | 228 | pull --rebase works with bundle2 turned on |
|
229 | 229 | |
|
230 | 230 | $ cd ../a |
|
231 | 231 | $ echo R4 > R4 |
|
232 | 232 | $ hg ci -Am R4 |
|
233 | 233 | adding R4 |
|
234 | 234 | $ hg tglog |
|
235 | 235 | @ 5: 'R4' |
|
236 | 236 | | |
|
237 | 237 | o 4: 'R3' |
|
238 | 238 | | |
|
239 | 239 | o 3: 'R2' |
|
240 | 240 | | |
|
241 | 241 | o 2: 'R1' |
|
242 | 242 | | |
|
243 | 243 | o 1: 'C2' |
|
244 | 244 | | |
|
245 | 245 | o 0: 'C1' |
|
246 | 246 | |
|
247 | 247 | $ cd ../c |
|
248 | 248 | $ hg pull --rebase |
|
249 | 249 | pulling from $TESTTMP/a (glob) |
|
250 | 250 | searching for changes |
|
251 | 251 | adding changesets |
|
252 | 252 | adding manifests |
|
253 | 253 | adding file changes |
|
254 | 254 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
255 | 255 | rebasing 5:518d153c0ba3 "L1" |
|
256 | 256 | saved backup bundle to $TESTTMP/c/.hg/strip-backup/518d153c0ba3-73407f14-backup.hg (glob) |
|
257 | 257 | $ hg tglog |
|
258 | 258 | @ 6: 'L1' |
|
259 | 259 | | |
|
260 | 260 | o 5: 'R4' |
|
261 | 261 | | |
|
262 | 262 | o 4: 'R3' |
|
263 | 263 | | |
|
264 | 264 | o 3: 'R2' |
|
265 | 265 | | |
|
266 | 266 | o 2: 'R1' |
|
267 | 267 | | |
|
268 | 268 | o 1: 'C2' |
|
269 | 269 | | |
|
270 | 270 | o 0: 'C1' |
|
271 | 271 | |
|
272 | 272 | |
|
273 | 273 | pull --rebase only update if there is nothing to rebase |
|
274 | 274 | |
|
275 | 275 | $ cd ../a |
|
276 | 276 | $ echo R5 > R5 |
|
277 | 277 | $ hg ci -Am R5 |
|
278 | 278 | adding R5 |
|
279 | 279 | $ hg tglog |
|
280 | 280 | @ 6: 'R5' |
|
281 | 281 | | |
|
282 | 282 | o 5: 'R4' |
|
283 | 283 | | |
|
284 | 284 | o 4: 'R3' |
|
285 | 285 | | |
|
286 | 286 | o 3: 'R2' |
|
287 | 287 | | |
|
288 | 288 | o 2: 'R1' |
|
289 | 289 | | |
|
290 | 290 | o 1: 'C2' |
|
291 | 291 | | |
|
292 | 292 | o 0: 'C1' |
|
293 | 293 | |
|
294 | 294 | $ cd ../c |
|
295 | 295 | $ echo L2 > L2 |
|
296 | 296 | $ hg ci -Am L2 |
|
297 | 297 | adding L2 |
|
298 | 298 | $ hg up 'desc(L1)' |
|
299 | 299 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
300 | 300 | $ hg pull --rebase |
|
301 | 301 | pulling from $TESTTMP/a (glob) |
|
302 | 302 | searching for changes |
|
303 | 303 | adding changesets |
|
304 | 304 | adding manifests |
|
305 | 305 | adding file changes |
|
306 | 306 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
307 | 307 | rebasing 6:0d0727eb7ce0 "L1" |
|
308 | 308 | rebasing 7:c1f58876e3bf "L2" |
|
309 | 309 | saved backup bundle to $TESTTMP/c/.hg/strip-backup/0d0727eb7ce0-ef61ccb2-backup.hg (glob) |
|
310 | 310 | $ hg tglog |
|
311 | 311 | o 8: 'L2' |
|
312 | 312 | | |
|
313 | 313 | @ 7: 'L1' |
|
314 | 314 | | |
|
315 | 315 | o 6: 'R5' |
|
316 | 316 | | |
|
317 | 317 | o 5: 'R4' |
|
318 | 318 | | |
|
319 | 319 | o 4: 'R3' |
|
320 | 320 | | |
|
321 | 321 | o 3: 'R2' |
|
322 | 322 | | |
|
323 | 323 | o 2: 'R1' |
|
324 | 324 | | |
|
325 | 325 | o 1: 'C2' |
|
326 | 326 | | |
|
327 | 327 | o 0: 'C1' |
|
328 | 328 | |
|
329 | 329 | |
|
330 | 330 | pull --rebase update (no rebase) use proper update: |
|
331 | 331 | |
|
332 | 332 | - warn about other head. |
|
333 | 333 | |
|
334 | 334 | $ cd ../a |
|
335 | 335 | $ echo R6 > R6 |
|
336 | 336 | $ hg ci -Am R6 |
|
337 | 337 | adding R6 |
|
338 | 338 | $ cd ../c |
|
339 | 339 | $ hg up 'desc(R5)' |
|
340 | 340 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
341 | 341 | $ hg pull --rebase |
|
342 | 342 | pulling from $TESTTMP/a (glob) |
|
343 | 343 | searching for changes |
|
344 | 344 | adding changesets |
|
345 | 345 | adding manifests |
|
346 | 346 | adding file changes |
|
347 | 347 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
348 | 348 | nothing to rebase - updating instead |
|
349 | 349 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
350 | updated to "65bc164c1d9b: R6" | |
|
350 | 351 | 1 other heads for branch "default" |
|
351 | 352 | $ hg tglog |
|
352 | 353 | @ 9: 'R6' |
|
353 | 354 | | |
|
354 | 355 | | o 8: 'L2' |
|
355 | 356 | | | |
|
356 | 357 | | o 7: 'L1' |
|
357 | 358 | |/ |
|
358 | 359 | o 6: 'R5' |
|
359 | 360 | | |
|
360 | 361 | o 5: 'R4' |
|
361 | 362 | | |
|
362 | 363 | o 4: 'R3' |
|
363 | 364 | | |
|
364 | 365 | o 3: 'R2' |
|
365 | 366 | | |
|
366 | 367 | o 2: 'R1' |
|
367 | 368 | | |
|
368 | 369 | o 1: 'C2' |
|
369 | 370 | | |
|
370 | 371 | o 0: 'C1' |
|
371 | 372 | |
|
372 | 373 | |
|
373 | 374 | Multiple pre-existing heads on the branch |
|
374 | 375 | ----------------------------------------- |
|
375 | 376 | |
|
376 | 377 | Pull bring content, but nothing on the current branch, we should not consider |
|
377 | 378 | pre-existing heads. |
|
378 | 379 | |
|
379 | 380 | $ cd ../a |
|
380 | 381 | $ hg branch unrelatedbranch |
|
381 | 382 | marked working directory as branch unrelatedbranch |
|
382 | 383 | (branches are permanent and global, did you want a bookmark?) |
|
383 | 384 | $ echo B1 > B1 |
|
384 | 385 | $ hg commit -Am B1 |
|
385 | 386 | adding B1 |
|
386 | 387 | $ cd ../c |
|
387 | 388 | $ hg up 'desc(L2)' |
|
388 | 389 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
389 | 390 | $ hg pull --rebase |
|
390 | 391 | pulling from $TESTTMP/a (glob) |
|
391 | 392 | searching for changes |
|
392 | 393 | adding changesets |
|
393 | 394 | adding manifests |
|
394 | 395 | adding file changes |
|
395 | 396 | added 1 changesets with 1 changes to 1 files |
|
396 | 397 | nothing to rebase |
|
397 | 398 | |
|
398 | 399 | There is two local heads and we pull a third one. |
|
399 | 400 | The second local head should not confuse the `hg pull rebase`. |
|
400 | 401 | |
|
401 | 402 | $ hg up 'desc(R6)' |
|
402 | 403 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
403 | 404 | $ echo M1 > M1 |
|
404 | 405 | $ hg commit -Am M1 |
|
405 | 406 | adding M1 |
|
406 | 407 | $ cd ../a |
|
407 | 408 | $ hg up 'desc(R6)' |
|
408 | 409 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
409 | 410 | $ echo R7 > R7 |
|
410 | 411 | $ hg commit -Am R7 |
|
411 | 412 | adding R7 |
|
412 | 413 | $ cd ../c |
|
413 | 414 | $ hg up 'desc(L2)' |
|
414 | 415 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
415 | 416 | $ hg pull --rebase |
|
416 | 417 | pulling from $TESTTMP/a (glob) |
|
417 | 418 | searching for changes |
|
418 | 419 | adding changesets |
|
419 | 420 | adding manifests |
|
420 | 421 | adding file changes |
|
421 | 422 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
422 | 423 | rebasing 7:864e0a2d2614 "L1" |
|
423 | 424 | rebasing 8:6dc0ea5dcf55 "L2" |
|
424 | 425 | saved backup bundle to $TESTTMP/c/.hg/strip-backup/864e0a2d2614-2f72c89c-backup.hg (glob) |
|
425 | 426 | $ hg tglog |
|
426 | 427 | @ 12: 'L2' |
|
427 | 428 | | |
|
428 | 429 | o 11: 'L1' |
|
429 | 430 | | |
|
430 | 431 | o 10: 'R7' |
|
431 | 432 | | |
|
432 | 433 | | o 9: 'M1' |
|
433 | 434 | |/ |
|
434 | 435 | | o 8: 'B1' unrelatedbranch |
|
435 | 436 | |/ |
|
436 | 437 | o 7: 'R6' |
|
437 | 438 | | |
|
438 | 439 | o 6: 'R5' |
|
439 | 440 | | |
|
440 | 441 | o 5: 'R4' |
|
441 | 442 | | |
|
442 | 443 | o 4: 'R3' |
|
443 | 444 | | |
|
444 | 445 | o 3: 'R2' |
|
445 | 446 | | |
|
446 | 447 | o 2: 'R1' |
|
447 | 448 | | |
|
448 | 449 | o 1: 'C2' |
|
449 | 450 | | |
|
450 | 451 | o 0: 'C1' |
|
451 | 452 |
@@ -1,939 +1,940 | |||
|
1 | 1 | $ echo "[format]" >> $HGRCPATH |
|
2 | 2 | $ echo "usegeneraldelta=yes" >> $HGRCPATH |
|
3 | 3 | $ echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | $ echo "strip=" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | $ restore() { |
|
7 | 7 | > hg unbundle -q .hg/strip-backup/* |
|
8 | 8 | > rm .hg/strip-backup/* |
|
9 | 9 | > } |
|
10 | 10 | $ teststrip() { |
|
11 | 11 | > hg up -C $1 |
|
12 | 12 | > echo % before update $1, strip $2 |
|
13 | 13 | > hg parents |
|
14 | 14 | > hg --traceback strip $2 |
|
15 | 15 | > echo % after update $1, strip $2 |
|
16 | 16 | > hg parents |
|
17 | 17 | > restore |
|
18 | 18 | > } |
|
19 | 19 | |
|
20 | 20 | $ hg init test |
|
21 | 21 | $ cd test |
|
22 | 22 | |
|
23 | 23 | $ echo foo > bar |
|
24 | 24 | $ hg ci -Ama |
|
25 | 25 | adding bar |
|
26 | 26 | |
|
27 | 27 | $ echo more >> bar |
|
28 | 28 | $ hg ci -Amb |
|
29 | 29 | |
|
30 | 30 | $ echo blah >> bar |
|
31 | 31 | $ hg ci -Amc |
|
32 | 32 | |
|
33 | 33 | $ hg up 1 |
|
34 | 34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
35 | 35 | $ echo blah >> bar |
|
36 | 36 | $ hg ci -Amd |
|
37 | 37 | created new head |
|
38 | 38 | |
|
39 | 39 | $ echo final >> bar |
|
40 | 40 | $ hg ci -Ame |
|
41 | 41 | |
|
42 | 42 | $ hg log |
|
43 | 43 | changeset: 4:443431ffac4f |
|
44 | 44 | tag: tip |
|
45 | 45 | user: test |
|
46 | 46 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
47 | 47 | summary: e |
|
48 | 48 | |
|
49 | 49 | changeset: 3:65bd5f99a4a3 |
|
50 | 50 | parent: 1:ef3a871183d7 |
|
51 | 51 | user: test |
|
52 | 52 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
53 | 53 | summary: d |
|
54 | 54 | |
|
55 | 55 | changeset: 2:264128213d29 |
|
56 | 56 | user: test |
|
57 | 57 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
58 | 58 | summary: c |
|
59 | 59 | |
|
60 | 60 | changeset: 1:ef3a871183d7 |
|
61 | 61 | user: test |
|
62 | 62 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
63 | 63 | summary: b |
|
64 | 64 | |
|
65 | 65 | changeset: 0:9ab35a2d17cb |
|
66 | 66 | user: test |
|
67 | 67 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
68 | 68 | summary: a |
|
69 | 69 | |
|
70 | 70 | |
|
71 | 71 | $ teststrip 4 4 |
|
72 | 72 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
73 | 73 | % before update 4, strip 4 |
|
74 | 74 | changeset: 4:443431ffac4f |
|
75 | 75 | tag: tip |
|
76 | 76 | user: test |
|
77 | 77 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
78 | 78 | summary: e |
|
79 | 79 | |
|
80 | 80 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
81 | 81 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
82 | 82 | % after update 4, strip 4 |
|
83 | 83 | changeset: 3:65bd5f99a4a3 |
|
84 | 84 | tag: tip |
|
85 | 85 | parent: 1:ef3a871183d7 |
|
86 | 86 | user: test |
|
87 | 87 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
88 | 88 | summary: d |
|
89 | 89 | |
|
90 | 90 | $ teststrip 4 3 |
|
91 | 91 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
92 | 92 | % before update 4, strip 3 |
|
93 | 93 | changeset: 4:443431ffac4f |
|
94 | 94 | tag: tip |
|
95 | 95 | user: test |
|
96 | 96 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
97 | 97 | summary: e |
|
98 | 98 | |
|
99 | 99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 100 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
101 | 101 | % after update 4, strip 3 |
|
102 | 102 | changeset: 1:ef3a871183d7 |
|
103 | 103 | user: test |
|
104 | 104 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
105 | 105 | summary: b |
|
106 | 106 | |
|
107 | 107 | $ teststrip 1 4 |
|
108 | 108 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
109 | 109 | % before update 1, strip 4 |
|
110 | 110 | changeset: 1:ef3a871183d7 |
|
111 | 111 | user: test |
|
112 | 112 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
113 | 113 | summary: b |
|
114 | 114 | |
|
115 | 115 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
116 | 116 | % after update 1, strip 4 |
|
117 | 117 | changeset: 1:ef3a871183d7 |
|
118 | 118 | user: test |
|
119 | 119 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
120 | 120 | summary: b |
|
121 | 121 | |
|
122 | 122 | $ teststrip 4 2 |
|
123 | 123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
124 | 124 | % before update 4, strip 2 |
|
125 | 125 | changeset: 4:443431ffac4f |
|
126 | 126 | tag: tip |
|
127 | 127 | user: test |
|
128 | 128 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
129 | 129 | summary: e |
|
130 | 130 | |
|
131 | 131 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
132 | 132 | % after update 4, strip 2 |
|
133 | 133 | changeset: 3:443431ffac4f |
|
134 | 134 | tag: tip |
|
135 | 135 | user: test |
|
136 | 136 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
137 | 137 | summary: e |
|
138 | 138 | |
|
139 | 139 | $ teststrip 4 1 |
|
140 | 140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 141 | % before update 4, strip 1 |
|
142 | 142 | changeset: 4:264128213d29 |
|
143 | 143 | tag: tip |
|
144 | 144 | parent: 1:ef3a871183d7 |
|
145 | 145 | user: test |
|
146 | 146 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
147 | 147 | summary: c |
|
148 | 148 | |
|
149 | 149 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
150 | 150 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
151 | 151 | % after update 4, strip 1 |
|
152 | 152 | changeset: 0:9ab35a2d17cb |
|
153 | 153 | tag: tip |
|
154 | 154 | user: test |
|
155 | 155 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
156 | 156 | summary: a |
|
157 | 157 | |
|
158 | 158 | $ teststrip null 4 |
|
159 | 159 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
160 | 160 | % before update null, strip 4 |
|
161 | 161 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
162 | 162 | % after update null, strip 4 |
|
163 | 163 | |
|
164 | 164 | $ hg log |
|
165 | 165 | changeset: 4:264128213d29 |
|
166 | 166 | tag: tip |
|
167 | 167 | parent: 1:ef3a871183d7 |
|
168 | 168 | user: test |
|
169 | 169 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
170 | 170 | summary: c |
|
171 | 171 | |
|
172 | 172 | changeset: 3:443431ffac4f |
|
173 | 173 | user: test |
|
174 | 174 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
175 | 175 | summary: e |
|
176 | 176 | |
|
177 | 177 | changeset: 2:65bd5f99a4a3 |
|
178 | 178 | user: test |
|
179 | 179 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
180 | 180 | summary: d |
|
181 | 181 | |
|
182 | 182 | changeset: 1:ef3a871183d7 |
|
183 | 183 | user: test |
|
184 | 184 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
185 | 185 | summary: b |
|
186 | 186 | |
|
187 | 187 | changeset: 0:9ab35a2d17cb |
|
188 | 188 | user: test |
|
189 | 189 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
190 | 190 | summary: a |
|
191 | 191 | |
|
192 | 192 | $ hg up -C 4 |
|
193 | 193 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
194 | 194 | $ hg parents |
|
195 | 195 | changeset: 4:264128213d29 |
|
196 | 196 | tag: tip |
|
197 | 197 | parent: 1:ef3a871183d7 |
|
198 | 198 | user: test |
|
199 | 199 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
200 | 200 | summary: c |
|
201 | 201 | |
|
202 | 202 | |
|
203 | 203 | $ hg --traceback strip 4 |
|
204 | 204 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
205 | 205 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob) |
|
206 | 206 | $ hg parents |
|
207 | 207 | changeset: 1:ef3a871183d7 |
|
208 | 208 | user: test |
|
209 | 209 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
210 | 210 | summary: b |
|
211 | 211 | |
|
212 | 212 | $ hg debugbundle .hg/strip-backup/* |
|
213 | 213 | Stream params: sortdict([('Compression', 'BZ')]) |
|
214 | 214 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])" |
|
215 | 215 | 264128213d290d868c54642d13aeaa3675551a78 |
|
216 | 216 | $ hg pull .hg/strip-backup/* |
|
217 | 217 | pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg |
|
218 | 218 | searching for changes |
|
219 | 219 | adding changesets |
|
220 | 220 | adding manifests |
|
221 | 221 | adding file changes |
|
222 | 222 | added 1 changesets with 0 changes to 0 files (+1 heads) |
|
223 | 223 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
224 | 224 | $ rm .hg/strip-backup/* |
|
225 | 225 | $ hg log --graph |
|
226 | 226 | o changeset: 4:264128213d29 |
|
227 | 227 | | tag: tip |
|
228 | 228 | | parent: 1:ef3a871183d7 |
|
229 | 229 | | user: test |
|
230 | 230 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
231 | 231 | | summary: c |
|
232 | 232 | | |
|
233 | 233 | | o changeset: 3:443431ffac4f |
|
234 | 234 | | | user: test |
|
235 | 235 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
236 | 236 | | | summary: e |
|
237 | 237 | | | |
|
238 | 238 | | o changeset: 2:65bd5f99a4a3 |
|
239 | 239 | |/ user: test |
|
240 | 240 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
241 | 241 | | summary: d |
|
242 | 242 | | |
|
243 | 243 | @ changeset: 1:ef3a871183d7 |
|
244 | 244 | | user: test |
|
245 | 245 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
246 | 246 | | summary: b |
|
247 | 247 | | |
|
248 | 248 | o changeset: 0:9ab35a2d17cb |
|
249 | 249 | user: test |
|
250 | 250 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
251 | 251 | summary: a |
|
252 | 252 | |
|
253 | 253 | $ hg up -C 2 |
|
254 | 254 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
255 | 255 | $ hg merge 4 |
|
256 | 256 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
257 | 257 | (branch merge, don't forget to commit) |
|
258 | 258 | |
|
259 | 259 | before strip of merge parent |
|
260 | 260 | |
|
261 | 261 | $ hg parents |
|
262 | 262 | changeset: 2:65bd5f99a4a3 |
|
263 | 263 | user: test |
|
264 | 264 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
265 | 265 | summary: d |
|
266 | 266 | |
|
267 | 267 | changeset: 4:264128213d29 |
|
268 | 268 | tag: tip |
|
269 | 269 | parent: 1:ef3a871183d7 |
|
270 | 270 | user: test |
|
271 | 271 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
272 | 272 | summary: c |
|
273 | 273 | |
|
274 | 274 | $ hg strip 4 |
|
275 | 275 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
276 | 276 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
277 | 277 | |
|
278 | 278 | after strip of merge parent |
|
279 | 279 | |
|
280 | 280 | $ hg parents |
|
281 | 281 | changeset: 1:ef3a871183d7 |
|
282 | 282 | user: test |
|
283 | 283 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
284 | 284 | summary: b |
|
285 | 285 | |
|
286 | 286 | $ restore |
|
287 | 287 | |
|
288 | 288 | $ hg up |
|
289 | 289 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
290 | updated to "264128213d29: c" | |
|
290 | 291 | 1 other heads for branch "default" |
|
291 | 292 | $ hg log -G |
|
292 | 293 | @ changeset: 4:264128213d29 |
|
293 | 294 | | tag: tip |
|
294 | 295 | | parent: 1:ef3a871183d7 |
|
295 | 296 | | user: test |
|
296 | 297 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
297 | 298 | | summary: c |
|
298 | 299 | | |
|
299 | 300 | | o changeset: 3:443431ffac4f |
|
300 | 301 | | | user: test |
|
301 | 302 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
302 | 303 | | | summary: e |
|
303 | 304 | | | |
|
304 | 305 | | o changeset: 2:65bd5f99a4a3 |
|
305 | 306 | |/ user: test |
|
306 | 307 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
307 | 308 | | summary: d |
|
308 | 309 | | |
|
309 | 310 | o changeset: 1:ef3a871183d7 |
|
310 | 311 | | user: test |
|
311 | 312 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
312 | 313 | | summary: b |
|
313 | 314 | | |
|
314 | 315 | o changeset: 0:9ab35a2d17cb |
|
315 | 316 | user: test |
|
316 | 317 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
317 | 318 | summary: a |
|
318 | 319 | |
|
319 | 320 | |
|
320 | 321 | 2 is parent of 3, only one strip should happen |
|
321 | 322 | |
|
322 | 323 | $ hg strip "roots(2)" 3 |
|
323 | 324 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
324 | 325 | $ hg log -G |
|
325 | 326 | @ changeset: 2:264128213d29 |
|
326 | 327 | | tag: tip |
|
327 | 328 | | user: test |
|
328 | 329 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
329 | 330 | | summary: c |
|
330 | 331 | | |
|
331 | 332 | o changeset: 1:ef3a871183d7 |
|
332 | 333 | | user: test |
|
333 | 334 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
334 | 335 | | summary: b |
|
335 | 336 | | |
|
336 | 337 | o changeset: 0:9ab35a2d17cb |
|
337 | 338 | user: test |
|
338 | 339 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
339 | 340 | summary: a |
|
340 | 341 | |
|
341 | 342 | $ restore |
|
342 | 343 | $ hg log -G |
|
343 | 344 | o changeset: 4:443431ffac4f |
|
344 | 345 | | tag: tip |
|
345 | 346 | | user: test |
|
346 | 347 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
347 | 348 | | summary: e |
|
348 | 349 | | |
|
349 | 350 | o changeset: 3:65bd5f99a4a3 |
|
350 | 351 | | parent: 1:ef3a871183d7 |
|
351 | 352 | | user: test |
|
352 | 353 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
353 | 354 | | summary: d |
|
354 | 355 | | |
|
355 | 356 | | @ changeset: 2:264128213d29 |
|
356 | 357 | |/ user: test |
|
357 | 358 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
358 | 359 | | summary: c |
|
359 | 360 | | |
|
360 | 361 | o changeset: 1:ef3a871183d7 |
|
361 | 362 | | user: test |
|
362 | 363 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
363 | 364 | | summary: b |
|
364 | 365 | | |
|
365 | 366 | o changeset: 0:9ab35a2d17cb |
|
366 | 367 | user: test |
|
367 | 368 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
368 | 369 | summary: a |
|
369 | 370 | |
|
370 | 371 | Failed hook while applying "saveheads" bundle. |
|
371 | 372 | |
|
372 | 373 | $ hg strip 2 --config hooks.pretxnchangegroup.bad=false |
|
373 | 374 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
374 | 375 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
375 | 376 | transaction abort! |
|
376 | 377 | rollback completed |
|
377 | 378 | strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob) |
|
378 | 379 | strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob) |
|
379 | 380 | (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob) |
|
380 | 381 | abort: pretxnchangegroup.bad hook exited with status 1 |
|
381 | 382 | [255] |
|
382 | 383 | $ restore |
|
383 | 384 | $ hg log -G |
|
384 | 385 | o changeset: 4:443431ffac4f |
|
385 | 386 | | tag: tip |
|
386 | 387 | | user: test |
|
387 | 388 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
388 | 389 | | summary: e |
|
389 | 390 | | |
|
390 | 391 | o changeset: 3:65bd5f99a4a3 |
|
391 | 392 | | parent: 1:ef3a871183d7 |
|
392 | 393 | | user: test |
|
393 | 394 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
394 | 395 | | summary: d |
|
395 | 396 | | |
|
396 | 397 | | o changeset: 2:264128213d29 |
|
397 | 398 | |/ user: test |
|
398 | 399 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
399 | 400 | | summary: c |
|
400 | 401 | | |
|
401 | 402 | @ changeset: 1:ef3a871183d7 |
|
402 | 403 | | user: test |
|
403 | 404 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
404 | 405 | | summary: b |
|
405 | 406 | | |
|
406 | 407 | o changeset: 0:9ab35a2d17cb |
|
407 | 408 | user: test |
|
408 | 409 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
409 | 410 | summary: a |
|
410 | 411 | |
|
411 | 412 | |
|
412 | 413 | 2 different branches: 2 strips |
|
413 | 414 | |
|
414 | 415 | $ hg strip 2 4 |
|
415 | 416 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
416 | 417 | $ hg log -G |
|
417 | 418 | o changeset: 2:65bd5f99a4a3 |
|
418 | 419 | | tag: tip |
|
419 | 420 | | user: test |
|
420 | 421 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
421 | 422 | | summary: d |
|
422 | 423 | | |
|
423 | 424 | @ changeset: 1:ef3a871183d7 |
|
424 | 425 | | user: test |
|
425 | 426 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
426 | 427 | | summary: b |
|
427 | 428 | | |
|
428 | 429 | o changeset: 0:9ab35a2d17cb |
|
429 | 430 | user: test |
|
430 | 431 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
431 | 432 | summary: a |
|
432 | 433 | |
|
433 | 434 | $ restore |
|
434 | 435 | |
|
435 | 436 | 2 different branches and a common ancestor: 1 strip |
|
436 | 437 | |
|
437 | 438 | $ hg strip 1 "2|4" |
|
438 | 439 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
439 | 440 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
440 | 441 | $ restore |
|
441 | 442 | |
|
442 | 443 | verify fncache is kept up-to-date |
|
443 | 444 | |
|
444 | 445 | $ touch a |
|
445 | 446 | $ hg ci -qAm a |
|
446 | 447 | $ cat .hg/store/fncache | sort |
|
447 | 448 | data/a.i |
|
448 | 449 | data/bar.i |
|
449 | 450 | $ hg strip tip |
|
450 | 451 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
451 | 452 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
452 | 453 | $ cat .hg/store/fncache |
|
453 | 454 | data/bar.i |
|
454 | 455 | |
|
455 | 456 | stripping an empty revset |
|
456 | 457 | |
|
457 | 458 | $ hg strip "1 and not 1" |
|
458 | 459 | abort: empty revision set |
|
459 | 460 | [255] |
|
460 | 461 | |
|
461 | 462 | remove branchy history for qimport tests |
|
462 | 463 | |
|
463 | 464 | $ hg strip 3 |
|
464 | 465 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
465 | 466 | |
|
466 | 467 | |
|
467 | 468 | strip of applied mq should cleanup status file |
|
468 | 469 | |
|
469 | 470 | $ echo "mq=" >> $HGRCPATH |
|
470 | 471 | $ hg up -C 3 |
|
471 | 472 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
472 | 473 | $ echo fooagain >> bar |
|
473 | 474 | $ hg ci -mf |
|
474 | 475 | $ hg qimport -r tip:2 |
|
475 | 476 | |
|
476 | 477 | applied patches before strip |
|
477 | 478 | |
|
478 | 479 | $ hg qapplied |
|
479 | 480 | d |
|
480 | 481 | e |
|
481 | 482 | f |
|
482 | 483 | |
|
483 | 484 | stripping revision in queue |
|
484 | 485 | |
|
485 | 486 | $ hg strip 3 |
|
486 | 487 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
487 | 488 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
488 | 489 | |
|
489 | 490 | applied patches after stripping rev in queue |
|
490 | 491 | |
|
491 | 492 | $ hg qapplied |
|
492 | 493 | d |
|
493 | 494 | |
|
494 | 495 | stripping ancestor of queue |
|
495 | 496 | |
|
496 | 497 | $ hg strip 1 |
|
497 | 498 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
498 | 499 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
499 | 500 | |
|
500 | 501 | applied patches after stripping ancestor of queue |
|
501 | 502 | |
|
502 | 503 | $ hg qapplied |
|
503 | 504 | |
|
504 | 505 | Verify strip protects against stripping wc parent when there are uncommitted mods |
|
505 | 506 | |
|
506 | 507 | $ echo b > b |
|
507 | 508 | $ echo bb > bar |
|
508 | 509 | $ hg add b |
|
509 | 510 | $ hg ci -m 'b' |
|
510 | 511 | $ hg log --graph |
|
511 | 512 | @ changeset: 1:76dcf9fab855 |
|
512 | 513 | | tag: tip |
|
513 | 514 | | user: test |
|
514 | 515 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
515 | 516 | | summary: b |
|
516 | 517 | | |
|
517 | 518 | o changeset: 0:9ab35a2d17cb |
|
518 | 519 | user: test |
|
519 | 520 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
520 | 521 | summary: a |
|
521 | 522 | |
|
522 | 523 | $ hg up 0 |
|
523 | 524 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
524 | 525 | $ echo c > bar |
|
525 | 526 | $ hg up -t false |
|
526 | 527 | merging bar |
|
527 | 528 | merging bar failed! |
|
528 | 529 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
529 | 530 | use 'hg resolve' to retry unresolved file merges |
|
530 | 531 | [1] |
|
531 | 532 | $ hg sum |
|
532 | 533 | parent: 1:76dcf9fab855 tip |
|
533 | 534 | b |
|
534 | 535 | branch: default |
|
535 | 536 | commit: 1 modified, 1 unknown, 1 unresolved |
|
536 | 537 | update: (current) |
|
537 | 538 | phases: 2 draft |
|
538 | 539 | mq: 3 unapplied |
|
539 | 540 | |
|
540 | 541 | $ echo c > b |
|
541 | 542 | $ hg strip tip |
|
542 | 543 | abort: local changes found |
|
543 | 544 | [255] |
|
544 | 545 | $ hg strip tip --keep |
|
545 | 546 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
546 | 547 | $ hg log --graph |
|
547 | 548 | @ changeset: 0:9ab35a2d17cb |
|
548 | 549 | tag: tip |
|
549 | 550 | user: test |
|
550 | 551 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
551 | 552 | summary: a |
|
552 | 553 | |
|
553 | 554 | $ hg status |
|
554 | 555 | M bar |
|
555 | 556 | ? b |
|
556 | 557 | ? bar.orig |
|
557 | 558 | |
|
558 | 559 | $ rm bar.orig |
|
559 | 560 | $ hg sum |
|
560 | 561 | parent: 0:9ab35a2d17cb tip |
|
561 | 562 | a |
|
562 | 563 | branch: default |
|
563 | 564 | commit: 1 modified, 1 unknown |
|
564 | 565 | update: (current) |
|
565 | 566 | phases: 1 draft |
|
566 | 567 | mq: 3 unapplied |
|
567 | 568 | |
|
568 | 569 | Strip adds, removes, modifies with --keep |
|
569 | 570 | |
|
570 | 571 | $ touch b |
|
571 | 572 | $ hg add b |
|
572 | 573 | $ hg commit -mb |
|
573 | 574 | $ touch c |
|
574 | 575 | |
|
575 | 576 | ... with a clean working dir |
|
576 | 577 | |
|
577 | 578 | $ hg add c |
|
578 | 579 | $ hg rm bar |
|
579 | 580 | $ hg commit -mc |
|
580 | 581 | $ hg status |
|
581 | 582 | $ hg strip --keep tip |
|
582 | 583 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
583 | 584 | $ hg status |
|
584 | 585 | ! bar |
|
585 | 586 | ? c |
|
586 | 587 | |
|
587 | 588 | ... with a dirty working dir |
|
588 | 589 | |
|
589 | 590 | $ hg add c |
|
590 | 591 | $ hg rm bar |
|
591 | 592 | $ hg commit -mc |
|
592 | 593 | $ hg status |
|
593 | 594 | $ echo b > b |
|
594 | 595 | $ echo d > d |
|
595 | 596 | $ hg strip --keep tip |
|
596 | 597 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
597 | 598 | $ hg status |
|
598 | 599 | M b |
|
599 | 600 | ! bar |
|
600 | 601 | ? c |
|
601 | 602 | ? d |
|
602 | 603 | |
|
603 | 604 | ... after updating the dirstate |
|
604 | 605 | $ hg add c |
|
605 | 606 | $ hg commit -mc |
|
606 | 607 | $ hg rm c |
|
607 | 608 | $ hg commit -mc |
|
608 | 609 | $ hg strip --keep '.^' -q |
|
609 | 610 | $ cd .. |
|
610 | 611 | |
|
611 | 612 | stripping many nodes on a complex graph (issue3299) |
|
612 | 613 | |
|
613 | 614 | $ hg init issue3299 |
|
614 | 615 | $ cd issue3299 |
|
615 | 616 | $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a' |
|
616 | 617 | $ hg strip 'not ancestors(x)' |
|
617 | 618 | saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob) |
|
618 | 619 | |
|
619 | 620 | test hg strip -B bookmark |
|
620 | 621 | |
|
621 | 622 | $ cd .. |
|
622 | 623 | $ hg init bookmarks |
|
623 | 624 | $ cd bookmarks |
|
624 | 625 | $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f' |
|
625 | 626 | $ hg bookmark -r 'a' 'todelete' |
|
626 | 627 | $ hg bookmark -r 'b' 'B' |
|
627 | 628 | $ hg bookmark -r 'b' 'nostrip' |
|
628 | 629 | $ hg bookmark -r 'c' 'delete' |
|
629 | 630 | $ hg bookmark -r 'd' 'multipledelete1' |
|
630 | 631 | $ hg bookmark -r 'e' 'multipledelete2' |
|
631 | 632 | $ hg bookmark -r 'f' 'singlenode1' |
|
632 | 633 | $ hg bookmark -r 'f' 'singlenode2' |
|
633 | 634 | $ hg up -C todelete |
|
634 | 635 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
635 | 636 | (activating bookmark todelete) |
|
636 | 637 | $ hg strip -B nostrip |
|
637 | 638 | bookmark 'nostrip' deleted |
|
638 | 639 | abort: empty revision set |
|
639 | 640 | [255] |
|
640 | 641 | $ hg strip -B todelete |
|
641 | 642 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
642 | 643 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
643 | 644 | bookmark 'todelete' deleted |
|
644 | 645 | $ hg id -ir dcbb326fdec2 |
|
645 | 646 | abort: unknown revision 'dcbb326fdec2'! |
|
646 | 647 | [255] |
|
647 | 648 | $ hg id -ir d62d843c9a01 |
|
648 | 649 | d62d843c9a01 |
|
649 | 650 | $ hg bookmarks |
|
650 | 651 | B 9:ff43616e5d0f |
|
651 | 652 | delete 6:2702dd0c91e7 |
|
652 | 653 | multipledelete1 11:e46a4836065c |
|
653 | 654 | multipledelete2 12:b4594d867745 |
|
654 | 655 | singlenode1 13:43227190fef8 |
|
655 | 656 | singlenode2 13:43227190fef8 |
|
656 | 657 | $ hg strip -B multipledelete1 -B multipledelete2 |
|
657 | 658 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg (glob) |
|
658 | 659 | bookmark 'multipledelete1' deleted |
|
659 | 660 | bookmark 'multipledelete2' deleted |
|
660 | 661 | $ hg id -ir e46a4836065c |
|
661 | 662 | abort: unknown revision 'e46a4836065c'! |
|
662 | 663 | [255] |
|
663 | 664 | $ hg id -ir b4594d867745 |
|
664 | 665 | abort: unknown revision 'b4594d867745'! |
|
665 | 666 | [255] |
|
666 | 667 | $ hg strip -B singlenode1 -B singlenode2 |
|
667 | 668 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg (glob) |
|
668 | 669 | bookmark 'singlenode1' deleted |
|
669 | 670 | bookmark 'singlenode2' deleted |
|
670 | 671 | $ hg id -ir 43227190fef8 |
|
671 | 672 | abort: unknown revision '43227190fef8'! |
|
672 | 673 | [255] |
|
673 | 674 | $ hg strip -B unknownbookmark |
|
674 | 675 | abort: bookmark 'unknownbookmark' not found |
|
675 | 676 | [255] |
|
676 | 677 | $ hg strip -B unknownbookmark1 -B unknownbookmark2 |
|
677 | 678 | abort: bookmark 'unknownbookmark1,unknownbookmark2' not found |
|
678 | 679 | [255] |
|
679 | 680 | $ hg strip -B delete -B unknownbookmark |
|
680 | 681 | abort: bookmark 'unknownbookmark' not found |
|
681 | 682 | [255] |
|
682 | 683 | $ hg strip -B delete |
|
683 | 684 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
684 | 685 | bookmark 'delete' deleted |
|
685 | 686 | $ hg id -ir 6:2702dd0c91e7 |
|
686 | 687 | abort: unknown revision '2702dd0c91e7'! |
|
687 | 688 | [255] |
|
688 | 689 | $ hg update B |
|
689 | 690 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
690 | 691 | (activating bookmark B) |
|
691 | 692 | $ echo a > a |
|
692 | 693 | $ hg add a |
|
693 | 694 | $ hg strip -B B |
|
694 | 695 | abort: local changes found |
|
695 | 696 | [255] |
|
696 | 697 | $ hg bookmarks |
|
697 | 698 | * B 6:ff43616e5d0f |
|
698 | 699 | |
|
699 | 700 | Make sure no one adds back a -b option: |
|
700 | 701 | |
|
701 | 702 | $ hg strip -b tip |
|
702 | 703 | hg strip: option -b not recognized |
|
703 | 704 | hg strip [-k] [-f] [-B bookmark] [-r] REV... |
|
704 | 705 | |
|
705 | 706 | strip changesets and all their descendants from the repository |
|
706 | 707 | |
|
707 | 708 | (use 'hg help -e strip' to show help for the strip extension) |
|
708 | 709 | |
|
709 | 710 | options ([+] can be repeated): |
|
710 | 711 | |
|
711 | 712 | -r --rev REV [+] strip specified revision (optional, can specify |
|
712 | 713 | revisions without this option) |
|
713 | 714 | -f --force force removal of changesets, discard uncommitted |
|
714 | 715 | changes (no backup) |
|
715 | 716 | --no-backup no backups |
|
716 | 717 | -k --keep do not modify working directory during strip |
|
717 | 718 | -B --bookmark VALUE [+] remove revs only reachable from given bookmark |
|
718 | 719 | --mq operate on patch repository |
|
719 | 720 | |
|
720 | 721 | (use 'hg strip -h' to show more help) |
|
721 | 722 | [255] |
|
722 | 723 | |
|
723 | 724 | $ cd .. |
|
724 | 725 | |
|
725 | 726 | Verify bundles don't get overwritten: |
|
726 | 727 | |
|
727 | 728 | $ hg init doublebundle |
|
728 | 729 | $ cd doublebundle |
|
729 | 730 | $ touch a |
|
730 | 731 | $ hg commit -Aqm a |
|
731 | 732 | $ touch b |
|
732 | 733 | $ hg commit -Aqm b |
|
733 | 734 | $ hg strip -r 0 |
|
734 | 735 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
735 | 736 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob) |
|
736 | 737 | $ ls .hg/strip-backup |
|
737 | 738 | 3903775176ed-e68910bd-backup.hg |
|
738 | 739 | $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg |
|
739 | 740 | $ hg strip -r 0 |
|
740 | 741 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob) |
|
741 | 742 | $ ls .hg/strip-backup |
|
742 | 743 | 3903775176ed-54390173-backup.hg |
|
743 | 744 | 3903775176ed-e68910bd-backup.hg |
|
744 | 745 | $ cd .. |
|
745 | 746 | |
|
746 | 747 | Test that we only bundle the stripped changesets (issue4736) |
|
747 | 748 | ------------------------------------------------------------ |
|
748 | 749 | |
|
749 | 750 | initialization (previous repo is empty anyway) |
|
750 | 751 | |
|
751 | 752 | $ hg init issue4736 |
|
752 | 753 | $ cd issue4736 |
|
753 | 754 | $ echo a > a |
|
754 | 755 | $ hg add a |
|
755 | 756 | $ hg commit -m commitA |
|
756 | 757 | $ echo b > b |
|
757 | 758 | $ hg add b |
|
758 | 759 | $ hg commit -m commitB |
|
759 | 760 | $ echo c > c |
|
760 | 761 | $ hg add c |
|
761 | 762 | $ hg commit -m commitC |
|
762 | 763 | $ hg up 'desc(commitB)' |
|
763 | 764 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
764 | 765 | $ echo d > d |
|
765 | 766 | $ hg add d |
|
766 | 767 | $ hg commit -m commitD |
|
767 | 768 | created new head |
|
768 | 769 | $ hg up 'desc(commitC)' |
|
769 | 770 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
770 | 771 | $ hg merge 'desc(commitD)' |
|
771 | 772 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
772 | 773 | (branch merge, don't forget to commit) |
|
773 | 774 | $ hg ci -m 'mergeCD' |
|
774 | 775 | $ hg log -G |
|
775 | 776 | @ changeset: 4:d8db9d137221 |
|
776 | 777 | |\ tag: tip |
|
777 | 778 | | | parent: 2:5c51d8d6557d |
|
778 | 779 | | | parent: 3:6625a5168474 |
|
779 | 780 | | | user: test |
|
780 | 781 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
781 | 782 | | | summary: mergeCD |
|
782 | 783 | | | |
|
783 | 784 | | o changeset: 3:6625a5168474 |
|
784 | 785 | | | parent: 1:eca11cf91c71 |
|
785 | 786 | | | user: test |
|
786 | 787 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
787 | 788 | | | summary: commitD |
|
788 | 789 | | | |
|
789 | 790 | o | changeset: 2:5c51d8d6557d |
|
790 | 791 | |/ user: test |
|
791 | 792 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
792 | 793 | | summary: commitC |
|
793 | 794 | | |
|
794 | 795 | o changeset: 1:eca11cf91c71 |
|
795 | 796 | | user: test |
|
796 | 797 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
797 | 798 | | summary: commitB |
|
798 | 799 | | |
|
799 | 800 | o changeset: 0:105141ef12d0 |
|
800 | 801 | user: test |
|
801 | 802 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
802 | 803 | summary: commitA |
|
803 | 804 | |
|
804 | 805 | |
|
805 | 806 | Check bundle behavior: |
|
806 | 807 | |
|
807 | 808 | $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg |
|
808 | 809 | 2 changesets found |
|
809 | 810 | $ hg log -r 'bundle()' -R ../issue4736.hg |
|
810 | 811 | changeset: 3:6625a5168474 |
|
811 | 812 | parent: 1:eca11cf91c71 |
|
812 | 813 | user: test |
|
813 | 814 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
814 | 815 | summary: commitD |
|
815 | 816 | |
|
816 | 817 | changeset: 4:d8db9d137221 |
|
817 | 818 | tag: tip |
|
818 | 819 | parent: 2:5c51d8d6557d |
|
819 | 820 | parent: 3:6625a5168474 |
|
820 | 821 | user: test |
|
821 | 822 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
822 | 823 | summary: mergeCD |
|
823 | 824 | |
|
824 | 825 | |
|
825 | 826 | check strip behavior |
|
826 | 827 | |
|
827 | 828 | $ hg --config extensions.strip= strip 'desc(commitD)' --debug |
|
828 | 829 | resolving manifests |
|
829 | 830 | branchmerge: False, force: True, partial: False |
|
830 | 831 | ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71 |
|
831 | 832 | c: other deleted -> r |
|
832 | 833 | removing c |
|
833 | 834 | d: other deleted -> r |
|
834 | 835 | removing d |
|
835 | 836 | starting 4 threads for background file closing (?) |
|
836 | 837 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
837 | 838 | 2 changesets found |
|
838 | 839 | list of changesets: |
|
839 | 840 | 6625a516847449b6f0fa3737b9ba56e9f0f3032c |
|
840 | 841 | d8db9d1372214336d2b5570f20ee468d2c72fa8b |
|
841 | 842 | bundle2-output-bundle: "HG20", (1 params) 1 parts total |
|
842 | 843 | bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
|
843 | 844 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob) |
|
844 | 845 | updating the branch cache |
|
845 | 846 | invalid branchheads cache (served): tip differs |
|
846 | 847 | truncating cache/rbc-revs-v1 to 24 |
|
847 | 848 | $ hg log -G |
|
848 | 849 | o changeset: 2:5c51d8d6557d |
|
849 | 850 | | tag: tip |
|
850 | 851 | | user: test |
|
851 | 852 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
852 | 853 | | summary: commitC |
|
853 | 854 | | |
|
854 | 855 | @ changeset: 1:eca11cf91c71 |
|
855 | 856 | | user: test |
|
856 | 857 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
857 | 858 | | summary: commitB |
|
858 | 859 | | |
|
859 | 860 | o changeset: 0:105141ef12d0 |
|
860 | 861 | user: test |
|
861 | 862 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
862 | 863 | summary: commitA |
|
863 | 864 | |
|
864 | 865 | |
|
865 | 866 | strip backup content |
|
866 | 867 | |
|
867 | 868 | $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg |
|
868 | 869 | changeset: 3:6625a5168474 |
|
869 | 870 | parent: 1:eca11cf91c71 |
|
870 | 871 | user: test |
|
871 | 872 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
872 | 873 | summary: commitD |
|
873 | 874 | |
|
874 | 875 | changeset: 4:d8db9d137221 |
|
875 | 876 | tag: tip |
|
876 | 877 | parent: 2:5c51d8d6557d |
|
877 | 878 | parent: 3:6625a5168474 |
|
878 | 879 | user: test |
|
879 | 880 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
880 | 881 | summary: mergeCD |
|
881 | 882 | |
|
882 | 883 | Check that the phase cache is properly invalidated after a strip with bookmark. |
|
883 | 884 | |
|
884 | 885 | $ cat > ../stripstalephasecache.py << EOF |
|
885 | 886 | > from mercurial import extensions, localrepo |
|
886 | 887 | > def transactioncallback(orig, repo, desc, *args, **kwargs): |
|
887 | 888 | > def test(transaction): |
|
888 | 889 | > # observe cache inconsistency |
|
889 | 890 | > try: |
|
890 | 891 | > [repo.changelog.node(r) for r in repo.revs("not public()")] |
|
891 | 892 | > except IndexError: |
|
892 | 893 | > repo.ui.status("Index error!\n") |
|
893 | 894 | > transaction = orig(repo, desc, *args, **kwargs) |
|
894 | 895 | > # warm up the phase cache |
|
895 | 896 | > list(repo.revs("not public()")) |
|
896 | 897 | > if desc != 'strip': |
|
897 | 898 | > transaction.addpostclose("phase invalidation test", test) |
|
898 | 899 | > return transaction |
|
899 | 900 | > def extsetup(ui): |
|
900 | 901 | > extensions.wrapfunction(localrepo.localrepository, "transaction", |
|
901 | 902 | > transactioncallback) |
|
902 | 903 | > EOF |
|
903 | 904 | $ hg up -C 2 |
|
904 | 905 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
905 | 906 | $ echo k > k |
|
906 | 907 | $ hg add k |
|
907 | 908 | $ hg commit -m commitK |
|
908 | 909 | $ echo l > l |
|
909 | 910 | $ hg add l |
|
910 | 911 | $ hg commit -m commitL |
|
911 | 912 | $ hg book -r tip blah |
|
912 | 913 | $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py |
|
913 | 914 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
914 | 915 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob) |
|
915 | 916 | $ hg up -C 1 |
|
916 | 917 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
917 | 918 | |
|
918 | 919 | Error during post-close callback of the strip transaction |
|
919 | 920 | (They should be gracefully handled and reported) |
|
920 | 921 | |
|
921 | 922 | $ cat > ../crashstrip.py << EOF |
|
922 | 923 | > from mercurial import error |
|
923 | 924 | > def reposetup(ui, repo): |
|
924 | 925 | > class crashstriprepo(repo.__class__): |
|
925 | 926 | > def transaction(self, desc, *args, **kwargs): |
|
926 | 927 | > tr = super(crashstriprepo, self).transaction(self, desc, *args, **kwargs) |
|
927 | 928 | > if desc == 'strip': |
|
928 | 929 | > def crash(tra): raise error.Abort('boom') |
|
929 | 930 | > tr.addpostclose('crash', crash) |
|
930 | 931 | > return tr |
|
931 | 932 | > repo.__class__ = crashstriprepo |
|
932 | 933 | > EOF |
|
933 | 934 | $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py |
|
934 | 935 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob) |
|
935 | 936 | strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob) |
|
936 | 937 | abort: boom |
|
937 | 938 | [255] |
|
938 | 939 | |
|
939 | 940 |
@@ -1,1787 +1,1791 | |||
|
1 | 1 | Let commit recurse into subrepos by default to match pre-2.0 behavior: |
|
2 | 2 | |
|
3 | 3 | $ echo "[ui]" >> $HGRCPATH |
|
4 | 4 | $ echo "commitsubrepos = Yes" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | $ hg init t |
|
7 | 7 | $ cd t |
|
8 | 8 | |
|
9 | 9 | first revision, no sub |
|
10 | 10 | |
|
11 | 11 | $ echo a > a |
|
12 | 12 | $ hg ci -Am0 |
|
13 | 13 | adding a |
|
14 | 14 | |
|
15 | 15 | add first sub |
|
16 | 16 | |
|
17 | 17 | $ echo s = s > .hgsub |
|
18 | 18 | $ hg add .hgsub |
|
19 | 19 | $ hg init s |
|
20 | 20 | $ echo a > s/a |
|
21 | 21 | |
|
22 | 22 | Issue2232: committing a subrepo without .hgsub |
|
23 | 23 | |
|
24 | 24 | $ hg ci -mbad s |
|
25 | 25 | abort: can't commit subrepos without .hgsub |
|
26 | 26 | [255] |
|
27 | 27 | |
|
28 | 28 | $ hg -R s add s/a |
|
29 | 29 | $ hg files -S |
|
30 | 30 | .hgsub |
|
31 | 31 | a |
|
32 | 32 | s/a (glob) |
|
33 | 33 | |
|
34 | 34 | $ hg -R s ci -Ams0 |
|
35 | 35 | $ hg sum |
|
36 | 36 | parent: 0:f7b1eb17ad24 tip |
|
37 | 37 | 0 |
|
38 | 38 | branch: default |
|
39 | 39 | commit: 1 added, 1 subrepos |
|
40 | 40 | update: (current) |
|
41 | 41 | phases: 1 draft |
|
42 | 42 | $ hg ci -m1 |
|
43 | 43 | |
|
44 | 44 | test handling .hgsubstate "added" explicitly. |
|
45 | 45 | |
|
46 | 46 | $ hg parents --template '{node}\n{files}\n' |
|
47 | 47 | 7cf8cfea66e410e8e3336508dfeec07b3192de51 |
|
48 | 48 | .hgsub .hgsubstate |
|
49 | 49 | $ hg rollback -q |
|
50 | 50 | $ hg add .hgsubstate |
|
51 | 51 | $ hg ci -m1 |
|
52 | 52 | $ hg parents --template '{node}\n{files}\n' |
|
53 | 53 | 7cf8cfea66e410e8e3336508dfeec07b3192de51 |
|
54 | 54 | .hgsub .hgsubstate |
|
55 | 55 | |
|
56 | 56 | Subrepopath which overlaps with filepath, does not change warnings in remove() |
|
57 | 57 | |
|
58 | 58 | $ mkdir snot |
|
59 | 59 | $ touch snot/file |
|
60 | 60 | $ hg remove -S snot/file |
|
61 | 61 | not removing snot/file: file is untracked (glob) |
|
62 | 62 | [1] |
|
63 | 63 | $ hg cat snot/filenot |
|
64 | 64 | snot/filenot: no such file in rev 7cf8cfea66e4 (glob) |
|
65 | 65 | [1] |
|
66 | 66 | $ rm -r snot |
|
67 | 67 | |
|
68 | 68 | Revert subrepo and test subrepo fileset keyword: |
|
69 | 69 | |
|
70 | 70 | $ echo b > s/a |
|
71 | 71 | $ hg revert --dry-run "set:subrepo('glob:s*')" |
|
72 | 72 | reverting subrepo s |
|
73 | 73 | reverting s/a (glob) |
|
74 | 74 | $ cat s/a |
|
75 | 75 | b |
|
76 | 76 | $ hg revert "set:subrepo('glob:s*')" |
|
77 | 77 | reverting subrepo s |
|
78 | 78 | reverting s/a (glob) |
|
79 | 79 | $ cat s/a |
|
80 | 80 | a |
|
81 | 81 | $ rm s/a.orig |
|
82 | 82 | |
|
83 | 83 | Revert subrepo with no backup. The "reverting s/a" line is gone since |
|
84 | 84 | we're really running 'hg update' in the subrepo: |
|
85 | 85 | |
|
86 | 86 | $ echo b > s/a |
|
87 | 87 | $ hg revert --no-backup s |
|
88 | 88 | reverting subrepo s |
|
89 | 89 | |
|
90 | 90 | Issue2022: update -C |
|
91 | 91 | |
|
92 | 92 | $ echo b > s/a |
|
93 | 93 | $ hg sum |
|
94 | 94 | parent: 1:7cf8cfea66e4 tip |
|
95 | 95 | 1 |
|
96 | 96 | branch: default |
|
97 | 97 | commit: 1 subrepos |
|
98 | 98 | update: (current) |
|
99 | 99 | phases: 2 draft |
|
100 | 100 | $ hg co -C 1 |
|
101 | 101 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 | 102 | $ hg sum |
|
103 | 103 | parent: 1:7cf8cfea66e4 tip |
|
104 | 104 | 1 |
|
105 | 105 | branch: default |
|
106 | 106 | commit: (clean) |
|
107 | 107 | update: (current) |
|
108 | 108 | phases: 2 draft |
|
109 | 109 | |
|
110 | 110 | commands that require a clean repo should respect subrepos |
|
111 | 111 | |
|
112 | 112 | $ echo b >> s/a |
|
113 | 113 | $ hg backout tip |
|
114 | 114 | abort: uncommitted changes in subrepository 's' |
|
115 | 115 | [255] |
|
116 | 116 | $ hg revert -C -R s s/a |
|
117 | 117 | |
|
118 | 118 | add sub sub |
|
119 | 119 | |
|
120 | 120 | $ echo ss = ss > s/.hgsub |
|
121 | 121 | $ hg init s/ss |
|
122 | 122 | $ echo a > s/ss/a |
|
123 | 123 | $ hg -R s add s/.hgsub |
|
124 | 124 | $ hg -R s/ss add s/ss/a |
|
125 | 125 | $ hg sum |
|
126 | 126 | parent: 1:7cf8cfea66e4 tip |
|
127 | 127 | 1 |
|
128 | 128 | branch: default |
|
129 | 129 | commit: 1 subrepos |
|
130 | 130 | update: (current) |
|
131 | 131 | phases: 2 draft |
|
132 | 132 | $ hg ci -m2 |
|
133 | 133 | committing subrepository s |
|
134 | 134 | committing subrepository s/ss (glob) |
|
135 | 135 | $ hg sum |
|
136 | 136 | parent: 2:df30734270ae tip |
|
137 | 137 | 2 |
|
138 | 138 | branch: default |
|
139 | 139 | commit: (clean) |
|
140 | 140 | update: (current) |
|
141 | 141 | phases: 3 draft |
|
142 | 142 | |
|
143 | 143 | test handling .hgsubstate "modified" explicitly. |
|
144 | 144 | |
|
145 | 145 | $ hg parents --template '{node}\n{files}\n' |
|
146 | 146 | df30734270ae757feb35e643b7018e818e78a9aa |
|
147 | 147 | .hgsubstate |
|
148 | 148 | $ hg rollback -q |
|
149 | 149 | $ hg status -A .hgsubstate |
|
150 | 150 | M .hgsubstate |
|
151 | 151 | $ hg ci -m2 |
|
152 | 152 | $ hg parents --template '{node}\n{files}\n' |
|
153 | 153 | df30734270ae757feb35e643b7018e818e78a9aa |
|
154 | 154 | .hgsubstate |
|
155 | 155 | |
|
156 | 156 | bump sub rev (and check it is ignored by ui.commitsubrepos) |
|
157 | 157 | |
|
158 | 158 | $ echo b > s/a |
|
159 | 159 | $ hg -R s ci -ms1 |
|
160 | 160 | $ hg --config ui.commitsubrepos=no ci -m3 |
|
161 | 161 | |
|
162 | 162 | leave sub dirty (and check ui.commitsubrepos=no aborts the commit) |
|
163 | 163 | |
|
164 | 164 | $ echo c > s/a |
|
165 | 165 | $ hg --config ui.commitsubrepos=no ci -m4 |
|
166 | 166 | abort: uncommitted changes in subrepository 's' |
|
167 | 167 | (use --subrepos for recursive commit) |
|
168 | 168 | [255] |
|
169 | 169 | $ hg id |
|
170 | 170 | f6affe3fbfaa+ tip |
|
171 | 171 | $ hg -R s ci -mc |
|
172 | 172 | $ hg id |
|
173 | 173 | f6affe3fbfaa+ tip |
|
174 | 174 | $ echo d > s/a |
|
175 | 175 | $ hg ci -m4 |
|
176 | 176 | committing subrepository s |
|
177 | 177 | $ hg tip -R s |
|
178 | 178 | changeset: 4:02dcf1d70411 |
|
179 | 179 | tag: tip |
|
180 | 180 | user: test |
|
181 | 181 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
182 | 182 | summary: 4 |
|
183 | 183 | |
|
184 | 184 | |
|
185 | 185 | check caching |
|
186 | 186 | |
|
187 | 187 | $ hg co 0 |
|
188 | 188 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
189 | 189 | $ hg debugsub |
|
190 | 190 | |
|
191 | 191 | restore |
|
192 | 192 | |
|
193 | 193 | $ hg co |
|
194 | 194 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
195 | 195 | $ hg debugsub |
|
196 | 196 | path s |
|
197 | 197 | source s |
|
198 | 198 | revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef |
|
199 | 199 | |
|
200 | 200 | new branch for merge tests |
|
201 | 201 | |
|
202 | 202 | $ hg co 1 |
|
203 | 203 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
204 | 204 | $ echo t = t >> .hgsub |
|
205 | 205 | $ hg init t |
|
206 | 206 | $ echo t > t/t |
|
207 | 207 | $ hg -R t add t |
|
208 | 208 | adding t/t (glob) |
|
209 | 209 | |
|
210 | 210 | 5 |
|
211 | 211 | |
|
212 | 212 | $ hg ci -m5 # add sub |
|
213 | 213 | committing subrepository t |
|
214 | 214 | created new head |
|
215 | 215 | $ echo t2 > t/t |
|
216 | 216 | |
|
217 | 217 | 6 |
|
218 | 218 | |
|
219 | 219 | $ hg st -R s |
|
220 | 220 | $ hg ci -m6 # change sub |
|
221 | 221 | committing subrepository t |
|
222 | 222 | $ hg debugsub |
|
223 | 223 | path s |
|
224 | 224 | source s |
|
225 | 225 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
226 | 226 | path t |
|
227 | 227 | source t |
|
228 | 228 | revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad |
|
229 | 229 | $ echo t3 > t/t |
|
230 | 230 | |
|
231 | 231 | 7 |
|
232 | 232 | |
|
233 | 233 | $ hg ci -m7 # change sub again for conflict test |
|
234 | 234 | committing subrepository t |
|
235 | 235 | $ hg rm .hgsub |
|
236 | 236 | |
|
237 | 237 | 8 |
|
238 | 238 | |
|
239 | 239 | $ hg ci -m8 # remove sub |
|
240 | 240 | |
|
241 | 241 | test handling .hgsubstate "removed" explicitly. |
|
242 | 242 | |
|
243 | 243 | $ hg parents --template '{node}\n{files}\n' |
|
244 | 244 | 96615c1dad2dc8e3796d7332c77ce69156f7b78e |
|
245 | 245 | .hgsub .hgsubstate |
|
246 | 246 | $ hg rollback -q |
|
247 | 247 | $ hg remove .hgsubstate |
|
248 | 248 | $ hg ci -m8 |
|
249 | 249 | $ hg parents --template '{node}\n{files}\n' |
|
250 | 250 | 96615c1dad2dc8e3796d7332c77ce69156f7b78e |
|
251 | 251 | .hgsub .hgsubstate |
|
252 | 252 | |
|
253 | 253 | merge tests |
|
254 | 254 | |
|
255 | 255 | $ hg co -C 3 |
|
256 | 256 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
257 | 257 | $ hg merge 5 # test adding |
|
258 | 258 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
259 | 259 | (branch merge, don't forget to commit) |
|
260 | 260 | $ hg debugsub |
|
261 | 261 | path s |
|
262 | 262 | source s |
|
263 | 263 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 |
|
264 | 264 | path t |
|
265 | 265 | source t |
|
266 | 266 | revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 |
|
267 | 267 | $ hg ci -m9 |
|
268 | 268 | created new head |
|
269 | 269 | $ hg merge 6 --debug # test change |
|
270 | 270 | searching for copies back to rev 2 |
|
271 | 271 | resolving manifests |
|
272 | 272 | branchmerge: True, force: False, partial: False |
|
273 | 273 | ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4 |
|
274 | 274 | starting 4 threads for background file closing (?) |
|
275 | 275 | .hgsubstate: versions differ -> m (premerge) |
|
276 | 276 | subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec |
|
277 | 277 | subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg |
|
278 | 278 | getting subrepo t |
|
279 | 279 | resolving manifests |
|
280 | 280 | branchmerge: False, force: False, partial: False |
|
281 | 281 | ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a |
|
282 | 282 | t: remote is newer -> g |
|
283 | 283 | getting t |
|
284 | 284 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
285 | 285 | (branch merge, don't forget to commit) |
|
286 | 286 | $ hg debugsub |
|
287 | 287 | path s |
|
288 | 288 | source s |
|
289 | 289 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 |
|
290 | 290 | path t |
|
291 | 291 | source t |
|
292 | 292 | revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad |
|
293 | 293 | $ echo conflict > t/t |
|
294 | 294 | $ hg ci -m10 |
|
295 | 295 | committing subrepository t |
|
296 | 296 | $ HGMERGE=internal:merge hg merge --debug 7 # test conflict |
|
297 | 297 | searching for copies back to rev 2 |
|
298 | 298 | resolving manifests |
|
299 | 299 | branchmerge: True, force: False, partial: False |
|
300 | 300 | ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf |
|
301 | 301 | starting 4 threads for background file closing (?) |
|
302 | 302 | .hgsubstate: versions differ -> m (premerge) |
|
303 | 303 | subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4 |
|
304 | 304 | subrepo t: both sides changed |
|
305 | 305 | subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198) |
|
306 | 306 | starting 4 threads for background file closing (?) |
|
307 | 307 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m |
|
308 | 308 | merging subrepo t |
|
309 | 309 | searching for copies back to rev 2 |
|
310 | 310 | resolving manifests |
|
311 | 311 | branchmerge: True, force: False, partial: False |
|
312 | 312 | ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198 |
|
313 | 313 | preserving t for resolve of t |
|
314 | 314 | starting 4 threads for background file closing (?) |
|
315 | 315 | t: versions differ -> m (premerge) |
|
316 | 316 | picked tool ':merge' for t (binary False symlink False changedelete False) |
|
317 | 317 | merging t |
|
318 | 318 | my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a |
|
319 | 319 | t: versions differ -> m (merge) |
|
320 | 320 | picked tool ':merge' for t (binary False symlink False changedelete False) |
|
321 | 321 | my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a |
|
322 | 322 | warning: conflicts while merging t! (edit, then use 'hg resolve --mark') |
|
323 | 323 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
324 | 324 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
325 | 325 | subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg |
|
326 | 326 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
327 | 327 | (branch merge, don't forget to commit) |
|
328 | 328 | |
|
329 | 329 | should conflict |
|
330 | 330 | |
|
331 | 331 | $ cat t/t |
|
332 | 332 | <<<<<<< local: 20a0db6fbf6c - test: 10 |
|
333 | 333 | conflict |
|
334 | 334 | ======= |
|
335 | 335 | t3 |
|
336 | 336 | >>>>>>> other: 7af322bc1198 - test: 7 |
|
337 | 337 | |
|
338 | 338 | 11: remove subrepo t |
|
339 | 339 | |
|
340 | 340 | $ hg co -C 5 |
|
341 | 341 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
342 | 342 | $ hg revert -r 4 .hgsub # remove t |
|
343 | 343 | $ hg ci -m11 |
|
344 | 344 | created new head |
|
345 | 345 | $ hg debugsub |
|
346 | 346 | path s |
|
347 | 347 | source s |
|
348 | 348 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
349 | 349 | |
|
350 | 350 | local removed, remote changed, keep changed |
|
351 | 351 | |
|
352 | 352 | $ hg merge 6 |
|
353 | 353 | remote [merge rev] changed subrepository t which local [working copy] removed |
|
354 | 354 | use (c)hanged version or (d)elete? c |
|
355 | 355 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
356 | 356 | (branch merge, don't forget to commit) |
|
357 | 357 | BROKEN: should include subrepo t |
|
358 | 358 | $ hg debugsub |
|
359 | 359 | path s |
|
360 | 360 | source s |
|
361 | 361 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
362 | 362 | $ cat .hgsubstate |
|
363 | 363 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
364 | 364 | 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t |
|
365 | 365 | $ hg ci -m 'local removed, remote changed, keep changed' |
|
366 | 366 | BROKEN: should include subrepo t |
|
367 | 367 | $ hg debugsub |
|
368 | 368 | path s |
|
369 | 369 | source s |
|
370 | 370 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
371 | 371 | BROKEN: should include subrepo t |
|
372 | 372 | $ cat .hgsubstate |
|
373 | 373 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
374 | 374 | $ cat t/t |
|
375 | 375 | t2 |
|
376 | 376 | |
|
377 | 377 | local removed, remote changed, keep removed |
|
378 | 378 | |
|
379 | 379 | $ hg co -C 11 |
|
380 | 380 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
381 | 381 | $ hg merge --config ui.interactive=true 6 <<EOF |
|
382 | 382 | > d |
|
383 | 383 | > EOF |
|
384 | 384 | remote [merge rev] changed subrepository t which local [working copy] removed |
|
385 | 385 | use (c)hanged version or (d)elete? d |
|
386 | 386 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
387 | 387 | (branch merge, don't forget to commit) |
|
388 | 388 | $ hg debugsub |
|
389 | 389 | path s |
|
390 | 390 | source s |
|
391 | 391 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
392 | 392 | $ cat .hgsubstate |
|
393 | 393 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
394 | 394 | $ hg ci -m 'local removed, remote changed, keep removed' |
|
395 | 395 | created new head |
|
396 | 396 | $ hg debugsub |
|
397 | 397 | path s |
|
398 | 398 | source s |
|
399 | 399 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
400 | 400 | $ cat .hgsubstate |
|
401 | 401 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
402 | 402 | |
|
403 | 403 | local changed, remote removed, keep changed |
|
404 | 404 | |
|
405 | 405 | $ hg co -C 6 |
|
406 | 406 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
407 | 407 | $ hg merge 11 |
|
408 | 408 | local [working copy] changed subrepository t which remote [merge rev] removed |
|
409 | 409 | use (c)hanged version or (d)elete? c |
|
410 | 410 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
411 | 411 | (branch merge, don't forget to commit) |
|
412 | 412 | BROKEN: should include subrepo t |
|
413 | 413 | $ hg debugsub |
|
414 | 414 | path s |
|
415 | 415 | source s |
|
416 | 416 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
417 | 417 | BROKEN: should include subrepo t |
|
418 | 418 | $ cat .hgsubstate |
|
419 | 419 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
420 | 420 | $ hg ci -m 'local changed, remote removed, keep changed' |
|
421 | 421 | created new head |
|
422 | 422 | BROKEN: should include subrepo t |
|
423 | 423 | $ hg debugsub |
|
424 | 424 | path s |
|
425 | 425 | source s |
|
426 | 426 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
427 | 427 | BROKEN: should include subrepo t |
|
428 | 428 | $ cat .hgsubstate |
|
429 | 429 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
430 | 430 | $ cat t/t |
|
431 | 431 | t2 |
|
432 | 432 | |
|
433 | 433 | local changed, remote removed, keep removed |
|
434 | 434 | |
|
435 | 435 | $ hg co -C 6 |
|
436 | 436 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
437 | 437 | $ hg merge --config ui.interactive=true 11 <<EOF |
|
438 | 438 | > d |
|
439 | 439 | > EOF |
|
440 | 440 | local [working copy] changed subrepository t which remote [merge rev] removed |
|
441 | 441 | use (c)hanged version or (d)elete? d |
|
442 | 442 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
443 | 443 | (branch merge, don't forget to commit) |
|
444 | 444 | $ hg debugsub |
|
445 | 445 | path s |
|
446 | 446 | source s |
|
447 | 447 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
448 | 448 | $ cat .hgsubstate |
|
449 | 449 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
450 | 450 | $ hg ci -m 'local changed, remote removed, keep removed' |
|
451 | 451 | created new head |
|
452 | 452 | $ hg debugsub |
|
453 | 453 | path s |
|
454 | 454 | source s |
|
455 | 455 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
456 | 456 | $ cat .hgsubstate |
|
457 | 457 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
458 | 458 | |
|
459 | 459 | clean up to avoid having to fix up the tests below |
|
460 | 460 | |
|
461 | 461 | $ hg co -C 10 |
|
462 | 462 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
463 | 463 | $ cat >> $HGRCPATH <<EOF |
|
464 | 464 | > [extensions] |
|
465 | 465 | > strip= |
|
466 | 466 | > EOF |
|
467 | 467 | $ hg strip -r 11:15 |
|
468 | 468 | saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob) |
|
469 | 469 | |
|
470 | 470 | clone |
|
471 | 471 | |
|
472 | 472 | $ cd .. |
|
473 | 473 | $ hg clone t tc |
|
474 | 474 | updating to branch default |
|
475 | 475 | cloning subrepo s from $TESTTMP/t/s |
|
476 | 476 | cloning subrepo s/ss from $TESTTMP/t/s/ss (glob) |
|
477 | 477 | cloning subrepo t from $TESTTMP/t/t |
|
478 | 478 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
479 | 479 | $ cd tc |
|
480 | 480 | $ hg debugsub |
|
481 | 481 | path s |
|
482 | 482 | source s |
|
483 | 483 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 |
|
484 | 484 | path t |
|
485 | 485 | source t |
|
486 | 486 | revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e |
|
487 | 487 | |
|
488 | 488 | push |
|
489 | 489 | |
|
490 | 490 | $ echo bah > t/t |
|
491 | 491 | $ hg ci -m11 |
|
492 | 492 | committing subrepository t |
|
493 | 493 | $ hg push |
|
494 | 494 | pushing to $TESTTMP/t (glob) |
|
495 | 495 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
496 | 496 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
497 | 497 | pushing subrepo t to $TESTTMP/t/t |
|
498 | 498 | searching for changes |
|
499 | 499 | adding changesets |
|
500 | 500 | adding manifests |
|
501 | 501 | adding file changes |
|
502 | 502 | added 1 changesets with 1 changes to 1 files |
|
503 | 503 | searching for changes |
|
504 | 504 | adding changesets |
|
505 | 505 | adding manifests |
|
506 | 506 | adding file changes |
|
507 | 507 | added 1 changesets with 1 changes to 1 files |
|
508 | 508 | |
|
509 | 509 | push -f |
|
510 | 510 | |
|
511 | 511 | $ echo bah > s/a |
|
512 | 512 | $ hg ci -m12 |
|
513 | 513 | committing subrepository s |
|
514 | 514 | $ hg push |
|
515 | 515 | pushing to $TESTTMP/t (glob) |
|
516 | 516 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
517 | 517 | pushing subrepo s to $TESTTMP/t/s |
|
518 | 518 | searching for changes |
|
519 | 519 | abort: push creates new remote head 12a213df6fa9! (in subrepo s) |
|
520 | 520 | (merge or see 'hg help push' for details about pushing new heads) |
|
521 | 521 | [255] |
|
522 | 522 | $ hg push -f |
|
523 | 523 | pushing to $TESTTMP/t (glob) |
|
524 | 524 | pushing subrepo s/ss to $TESTTMP/t/s/ss (glob) |
|
525 | 525 | searching for changes |
|
526 | 526 | no changes found |
|
527 | 527 | pushing subrepo s to $TESTTMP/t/s |
|
528 | 528 | searching for changes |
|
529 | 529 | adding changesets |
|
530 | 530 | adding manifests |
|
531 | 531 | adding file changes |
|
532 | 532 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
533 | 533 | pushing subrepo t to $TESTTMP/t/t |
|
534 | 534 | searching for changes |
|
535 | 535 | no changes found |
|
536 | 536 | searching for changes |
|
537 | 537 | adding changesets |
|
538 | 538 | adding manifests |
|
539 | 539 | adding file changes |
|
540 | 540 | added 1 changesets with 1 changes to 1 files |
|
541 | 541 | |
|
542 | 542 | check that unmodified subrepos are not pushed |
|
543 | 543 | |
|
544 | 544 | $ hg clone . ../tcc |
|
545 | 545 | updating to branch default |
|
546 | 546 | cloning subrepo s from $TESTTMP/tc/s |
|
547 | 547 | cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob) |
|
548 | 548 | cloning subrepo t from $TESTTMP/tc/t |
|
549 | 549 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
550 | 550 | |
|
551 | 551 | the subrepos on the new clone have nothing to push to its source |
|
552 | 552 | |
|
553 | 553 | $ hg push -R ../tcc . |
|
554 | 554 | pushing to . |
|
555 | 555 | no changes made to subrepo s/ss since last push to s/ss (glob) |
|
556 | 556 | no changes made to subrepo s since last push to s |
|
557 | 557 | no changes made to subrepo t since last push to t |
|
558 | 558 | searching for changes |
|
559 | 559 | no changes found |
|
560 | 560 | [1] |
|
561 | 561 | |
|
562 | 562 | the subrepos on the source do not have a clean store versus the clone target |
|
563 | 563 | because they were never explicitly pushed to the source |
|
564 | 564 | |
|
565 | 565 | $ hg push ../tcc |
|
566 | 566 | pushing to ../tcc |
|
567 | 567 | pushing subrepo s/ss to ../tcc/s/ss (glob) |
|
568 | 568 | searching for changes |
|
569 | 569 | no changes found |
|
570 | 570 | pushing subrepo s to ../tcc/s |
|
571 | 571 | searching for changes |
|
572 | 572 | no changes found |
|
573 | 573 | pushing subrepo t to ../tcc/t |
|
574 | 574 | searching for changes |
|
575 | 575 | no changes found |
|
576 | 576 | searching for changes |
|
577 | 577 | no changes found |
|
578 | 578 | [1] |
|
579 | 579 | |
|
580 | 580 | after push their stores become clean |
|
581 | 581 | |
|
582 | 582 | $ hg push ../tcc |
|
583 | 583 | pushing to ../tcc |
|
584 | 584 | no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob) |
|
585 | 585 | no changes made to subrepo s since last push to ../tcc/s |
|
586 | 586 | no changes made to subrepo t since last push to ../tcc/t |
|
587 | 587 | searching for changes |
|
588 | 588 | no changes found |
|
589 | 589 | [1] |
|
590 | 590 | |
|
591 | 591 | updating a subrepo to a different revision or changing |
|
592 | 592 | its working directory does not make its store dirty |
|
593 | 593 | |
|
594 | 594 | $ hg -R s update '.^' |
|
595 | 595 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
596 | 596 | $ hg push |
|
597 | 597 | pushing to $TESTTMP/t (glob) |
|
598 | 598 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
599 | 599 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
600 | 600 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
601 | 601 | searching for changes |
|
602 | 602 | no changes found |
|
603 | 603 | [1] |
|
604 | 604 | $ echo foo >> s/a |
|
605 | 605 | $ hg push |
|
606 | 606 | pushing to $TESTTMP/t (glob) |
|
607 | 607 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
608 | 608 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
609 | 609 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
610 | 610 | searching for changes |
|
611 | 611 | no changes found |
|
612 | 612 | [1] |
|
613 | 613 | $ hg -R s update -C tip |
|
614 | 614 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
615 | 615 | |
|
616 | 616 | committing into a subrepo makes its store (but not its parent's store) dirty |
|
617 | 617 | |
|
618 | 618 | $ echo foo >> s/ss/a |
|
619 | 619 | $ hg -R s/ss commit -m 'test dirty store detection' |
|
620 | 620 | |
|
621 | 621 | $ hg out -S -r `hg log -r tip -T "{node|short}"` |
|
622 | 622 | comparing with $TESTTMP/t (glob) |
|
623 | 623 | searching for changes |
|
624 | 624 | no changes found |
|
625 | 625 | comparing with $TESTTMP/t/s |
|
626 | 626 | searching for changes |
|
627 | 627 | no changes found |
|
628 | 628 | comparing with $TESTTMP/t/s/ss |
|
629 | 629 | searching for changes |
|
630 | 630 | changeset: 1:79ea5566a333 |
|
631 | 631 | tag: tip |
|
632 | 632 | user: test |
|
633 | 633 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
634 | 634 | summary: test dirty store detection |
|
635 | 635 | |
|
636 | 636 | comparing with $TESTTMP/t/t |
|
637 | 637 | searching for changes |
|
638 | 638 | no changes found |
|
639 | 639 | |
|
640 | 640 | $ hg push |
|
641 | 641 | pushing to $TESTTMP/t (glob) |
|
642 | 642 | pushing subrepo s/ss to $TESTTMP/t/s/ss (glob) |
|
643 | 643 | searching for changes |
|
644 | 644 | adding changesets |
|
645 | 645 | adding manifests |
|
646 | 646 | adding file changes |
|
647 | 647 | added 1 changesets with 1 changes to 1 files |
|
648 | 648 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
649 | 649 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
650 | 650 | searching for changes |
|
651 | 651 | no changes found |
|
652 | 652 | [1] |
|
653 | 653 | |
|
654 | 654 | a subrepo store may be clean versus one repo but not versus another |
|
655 | 655 | |
|
656 | 656 | $ hg push |
|
657 | 657 | pushing to $TESTTMP/t (glob) |
|
658 | 658 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
659 | 659 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
660 | 660 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
661 | 661 | searching for changes |
|
662 | 662 | no changes found |
|
663 | 663 | [1] |
|
664 | 664 | $ hg push ../tcc |
|
665 | 665 | pushing to ../tcc |
|
666 | 666 | pushing subrepo s/ss to ../tcc/s/ss (glob) |
|
667 | 667 | searching for changes |
|
668 | 668 | adding changesets |
|
669 | 669 | adding manifests |
|
670 | 670 | adding file changes |
|
671 | 671 | added 1 changesets with 1 changes to 1 files |
|
672 | 672 | no changes made to subrepo s since last push to ../tcc/s |
|
673 | 673 | no changes made to subrepo t since last push to ../tcc/t |
|
674 | 674 | searching for changes |
|
675 | 675 | no changes found |
|
676 | 676 | [1] |
|
677 | 677 | |
|
678 | 678 | update |
|
679 | 679 | |
|
680 | 680 | $ cd ../t |
|
681 | 681 | $ hg up -C # discard our earlier merge |
|
682 | 682 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
683 | updated to "c373c8102e68: 12" | |
|
683 | 684 | 2 other heads for branch "default" |
|
684 | 685 | $ echo blah > t/t |
|
685 | 686 | $ hg ci -m13 |
|
686 | 687 | committing subrepository t |
|
687 | 688 | |
|
688 | 689 | backout calls revert internally with minimal opts, which should not raise |
|
689 | 690 | KeyError |
|
690 | 691 | |
|
691 | 692 | $ hg backout ".^" --no-commit |
|
692 | 693 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
693 | 694 | changeset c373c8102e68 backed out, don't forget to commit. |
|
694 | 695 | |
|
695 | 696 | $ hg up -C # discard changes |
|
696 | 697 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
698 | updated to "925c17564ef8: 13" | |
|
697 | 699 | 2 other heads for branch "default" |
|
698 | 700 | |
|
699 | 701 | pull |
|
700 | 702 | |
|
701 | 703 | $ cd ../tc |
|
702 | 704 | $ hg pull |
|
703 | 705 | pulling from $TESTTMP/t (glob) |
|
704 | 706 | searching for changes |
|
705 | 707 | adding changesets |
|
706 | 708 | adding manifests |
|
707 | 709 | adding file changes |
|
708 | 710 | added 1 changesets with 1 changes to 1 files |
|
709 | 711 | (run 'hg update' to get a working copy) |
|
710 | 712 | |
|
711 | 713 | should pull t |
|
712 | 714 | |
|
713 | 715 | $ hg incoming -S -r `hg log -r tip -T "{node|short}"` |
|
714 | 716 | comparing with $TESTTMP/t (glob) |
|
715 | 717 | no changes found |
|
716 | 718 | comparing with $TESTTMP/t/s |
|
717 | 719 | searching for changes |
|
718 | 720 | no changes found |
|
719 | 721 | comparing with $TESTTMP/t/s/ss |
|
720 | 722 | searching for changes |
|
721 | 723 | no changes found |
|
722 | 724 | comparing with $TESTTMP/t/t |
|
723 | 725 | searching for changes |
|
724 | 726 | changeset: 5:52c0adc0515a |
|
725 | 727 | tag: tip |
|
726 | 728 | user: test |
|
727 | 729 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
728 | 730 | summary: 13 |
|
729 | 731 | |
|
730 | 732 | |
|
731 | 733 | $ hg up |
|
732 | 734 | pulling subrepo t from $TESTTMP/t/t |
|
733 | 735 | searching for changes |
|
734 | 736 | adding changesets |
|
735 | 737 | adding manifests |
|
736 | 738 | adding file changes |
|
737 | 739 | added 1 changesets with 1 changes to 1 files |
|
738 | 740 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
741 | updated to "925c17564ef8: 13" | |
|
739 | 742 | 2 other heads for branch "default" |
|
740 | 743 | $ cat t/t |
|
741 | 744 | blah |
|
742 | 745 | |
|
743 | 746 | bogus subrepo path aborts |
|
744 | 747 | |
|
745 | 748 | $ echo 'bogus=[boguspath' >> .hgsub |
|
746 | 749 | $ hg ci -m 'bogus subrepo path' |
|
747 | 750 | abort: missing ] in subrepo source |
|
748 | 751 | [255] |
|
749 | 752 | |
|
750 | 753 | Issue1986: merge aborts when trying to merge a subrepo that |
|
751 | 754 | shouldn't need merging |
|
752 | 755 | |
|
753 | 756 | # subrepo layout |
|
754 | 757 | # |
|
755 | 758 | # o 5 br |
|
756 | 759 | # /| |
|
757 | 760 | # o | 4 default |
|
758 | 761 | # | | |
|
759 | 762 | # | o 3 br |
|
760 | 763 | # |/| |
|
761 | 764 | # o | 2 default |
|
762 | 765 | # | | |
|
763 | 766 | # | o 1 br |
|
764 | 767 | # |/ |
|
765 | 768 | # o 0 default |
|
766 | 769 | |
|
767 | 770 | $ cd .. |
|
768 | 771 | $ rm -rf sub |
|
769 | 772 | $ hg init main |
|
770 | 773 | $ cd main |
|
771 | 774 | $ hg init s |
|
772 | 775 | $ cd s |
|
773 | 776 | $ echo a > a |
|
774 | 777 | $ hg ci -Am1 |
|
775 | 778 | adding a |
|
776 | 779 | $ hg branch br |
|
777 | 780 | marked working directory as branch br |
|
778 | 781 | (branches are permanent and global, did you want a bookmark?) |
|
779 | 782 | $ echo a >> a |
|
780 | 783 | $ hg ci -m1 |
|
781 | 784 | $ hg up default |
|
782 | 785 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
783 | 786 | $ echo b > b |
|
784 | 787 | $ hg ci -Am1 |
|
785 | 788 | adding b |
|
786 | 789 | $ hg up br |
|
787 | 790 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
788 | 791 | $ hg merge tip |
|
789 | 792 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
790 | 793 | (branch merge, don't forget to commit) |
|
791 | 794 | $ hg ci -m1 |
|
792 | 795 | $ hg up 2 |
|
793 | 796 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
794 | 797 | $ echo c > c |
|
795 | 798 | $ hg ci -Am1 |
|
796 | 799 | adding c |
|
797 | 800 | $ hg up 3 |
|
798 | 801 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
799 | 802 | $ hg merge 4 |
|
800 | 803 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
801 | 804 | (branch merge, don't forget to commit) |
|
802 | 805 | $ hg ci -m1 |
|
803 | 806 | |
|
804 | 807 | # main repo layout: |
|
805 | 808 | # |
|
806 | 809 | # * <-- try to merge default into br again |
|
807 | 810 | # .`| |
|
808 | 811 | # . o 5 br --> substate = 5 |
|
809 | 812 | # . | |
|
810 | 813 | # o | 4 default --> substate = 4 |
|
811 | 814 | # | | |
|
812 | 815 | # | o 3 br --> substate = 2 |
|
813 | 816 | # |/| |
|
814 | 817 | # o | 2 default --> substate = 2 |
|
815 | 818 | # | | |
|
816 | 819 | # | o 1 br --> substate = 3 |
|
817 | 820 | # |/ |
|
818 | 821 | # o 0 default --> substate = 2 |
|
819 | 822 | |
|
820 | 823 | $ cd .. |
|
821 | 824 | $ echo 's = s' > .hgsub |
|
822 | 825 | $ hg -R s up 2 |
|
823 | 826 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
824 | 827 | $ hg ci -Am1 |
|
825 | 828 | adding .hgsub |
|
826 | 829 | $ hg branch br |
|
827 | 830 | marked working directory as branch br |
|
828 | 831 | (branches are permanent and global, did you want a bookmark?) |
|
829 | 832 | $ echo b > b |
|
830 | 833 | $ hg -R s up 3 |
|
831 | 834 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
832 | 835 | $ hg ci -Am1 |
|
833 | 836 | adding b |
|
834 | 837 | $ hg up default |
|
835 | 838 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
836 | 839 | $ echo c > c |
|
837 | 840 | $ hg ci -Am1 |
|
838 | 841 | adding c |
|
839 | 842 | $ hg up 1 |
|
840 | 843 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
841 | 844 | $ hg merge 2 |
|
842 | 845 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
843 | 846 | (branch merge, don't forget to commit) |
|
844 | 847 | $ hg ci -m1 |
|
845 | 848 | $ hg up 2 |
|
846 | 849 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
847 | 850 | $ hg -R s up 4 |
|
848 | 851 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
849 | 852 | $ echo d > d |
|
850 | 853 | $ hg ci -Am1 |
|
851 | 854 | adding d |
|
852 | 855 | $ hg up 3 |
|
853 | 856 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
854 | 857 | $ hg -R s up 5 |
|
855 | 858 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
856 | 859 | $ echo e > e |
|
857 | 860 | $ hg ci -Am1 |
|
858 | 861 | adding e |
|
859 | 862 | |
|
860 | 863 | $ hg up 5 |
|
861 | 864 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
862 | 865 | $ hg merge 4 # try to merge default into br again |
|
863 | 866 | subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88) |
|
864 | 867 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m |
|
865 | 868 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
866 | 869 | (branch merge, don't forget to commit) |
|
867 | 870 | $ cd .. |
|
868 | 871 | |
|
869 | 872 | test subrepo delete from .hgsubstate |
|
870 | 873 | |
|
871 | 874 | $ hg init testdelete |
|
872 | 875 | $ mkdir testdelete/nested testdelete/nested2 |
|
873 | 876 | $ hg init testdelete/nested |
|
874 | 877 | $ hg init testdelete/nested2 |
|
875 | 878 | $ echo test > testdelete/nested/foo |
|
876 | 879 | $ echo test > testdelete/nested2/foo |
|
877 | 880 | $ hg -R testdelete/nested add |
|
878 | 881 | adding testdelete/nested/foo (glob) |
|
879 | 882 | $ hg -R testdelete/nested2 add |
|
880 | 883 | adding testdelete/nested2/foo (glob) |
|
881 | 884 | $ hg -R testdelete/nested ci -m test |
|
882 | 885 | $ hg -R testdelete/nested2 ci -m test |
|
883 | 886 | $ echo nested = nested > testdelete/.hgsub |
|
884 | 887 | $ echo nested2 = nested2 >> testdelete/.hgsub |
|
885 | 888 | $ hg -R testdelete add |
|
886 | 889 | adding testdelete/.hgsub (glob) |
|
887 | 890 | $ hg -R testdelete ci -m "nested 1 & 2 added" |
|
888 | 891 | $ echo nested = nested > testdelete/.hgsub |
|
889 | 892 | $ hg -R testdelete ci -m "nested 2 deleted" |
|
890 | 893 | $ cat testdelete/.hgsubstate |
|
891 | 894 | bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested |
|
892 | 895 | $ hg -R testdelete remove testdelete/.hgsub |
|
893 | 896 | $ hg -R testdelete ci -m ".hgsub deleted" |
|
894 | 897 | $ cat testdelete/.hgsubstate |
|
895 | 898 | bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested |
|
896 | 899 | |
|
897 | 900 | test repository cloning |
|
898 | 901 | |
|
899 | 902 | $ mkdir mercurial mercurial2 |
|
900 | 903 | $ hg init nested_absolute |
|
901 | 904 | $ echo test > nested_absolute/foo |
|
902 | 905 | $ hg -R nested_absolute add |
|
903 | 906 | adding nested_absolute/foo (glob) |
|
904 | 907 | $ hg -R nested_absolute ci -mtest |
|
905 | 908 | $ cd mercurial |
|
906 | 909 | $ hg init nested_relative |
|
907 | 910 | $ echo test2 > nested_relative/foo2 |
|
908 | 911 | $ hg -R nested_relative add |
|
909 | 912 | adding nested_relative/foo2 (glob) |
|
910 | 913 | $ hg -R nested_relative ci -mtest2 |
|
911 | 914 | $ hg init main |
|
912 | 915 | $ echo "nested_relative = ../nested_relative" > main/.hgsub |
|
913 | 916 | $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub |
|
914 | 917 | $ hg -R main add |
|
915 | 918 | adding main/.hgsub (glob) |
|
916 | 919 | $ hg -R main ci -m "add subrepos" |
|
917 | 920 | $ cd .. |
|
918 | 921 | $ hg clone mercurial/main mercurial2/main |
|
919 | 922 | updating to branch default |
|
920 | 923 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
921 | 924 | $ cat mercurial2/main/nested_absolute/.hg/hgrc \ |
|
922 | 925 | > mercurial2/main/nested_relative/.hg/hgrc |
|
923 | 926 | [paths] |
|
924 | 927 | default = $TESTTMP/mercurial/nested_absolute |
|
925 | 928 | [paths] |
|
926 | 929 | default = $TESTTMP/mercurial/nested_relative |
|
927 | 930 | $ rm -rf mercurial mercurial2 |
|
928 | 931 | |
|
929 | 932 | Issue1977: multirepo push should fail if subrepo push fails |
|
930 | 933 | |
|
931 | 934 | $ hg init repo |
|
932 | 935 | $ hg init repo/s |
|
933 | 936 | $ echo a > repo/s/a |
|
934 | 937 | $ hg -R repo/s ci -Am0 |
|
935 | 938 | adding a |
|
936 | 939 | $ echo s = s > repo/.hgsub |
|
937 | 940 | $ hg -R repo ci -Am1 |
|
938 | 941 | adding .hgsub |
|
939 | 942 | $ hg clone repo repo2 |
|
940 | 943 | updating to branch default |
|
941 | 944 | cloning subrepo s from $TESTTMP/repo/s |
|
942 | 945 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
943 | 946 | $ hg -q -R repo2 pull -u |
|
944 | 947 | $ echo 1 > repo2/s/a |
|
945 | 948 | $ hg -R repo2/s ci -m2 |
|
946 | 949 | $ hg -q -R repo2/s push |
|
947 | 950 | $ hg -R repo2/s up -C 0 |
|
948 | 951 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
949 | 952 | $ echo 2 > repo2/s/b |
|
950 | 953 | $ hg -R repo2/s ci -m3 -A |
|
951 | 954 | adding b |
|
952 | 955 | created new head |
|
953 | 956 | $ hg -R repo2 ci -m3 |
|
954 | 957 | $ hg -q -R repo2 push |
|
955 | 958 | abort: push creates new remote head cc505f09a8b2! (in subrepo s) |
|
956 | 959 | (merge or see 'hg help push' for details about pushing new heads) |
|
957 | 960 | [255] |
|
958 | 961 | $ hg -R repo update |
|
959 | 962 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
960 | 963 | |
|
961 | 964 | test if untracked file is not overwritten |
|
962 | 965 | |
|
963 | 966 | (this also tests that updated .hgsubstate is treated as "modified", |
|
964 | 967 | when 'merge.update()' is aborted before 'merge.recordupdates()', even |
|
965 | 968 | if none of mode, size and timestamp of it isn't changed on the |
|
966 | 969 | filesystem (see also issue4583)) |
|
967 | 970 | |
|
968 | 971 | $ echo issue3276_ok > repo/s/b |
|
969 | 972 | $ hg -R repo2 push -f -q |
|
970 | 973 | $ touch -t 200001010000 repo/.hgsubstate |
|
971 | 974 | |
|
972 | 975 | $ cat >> repo/.hg/hgrc <<EOF |
|
973 | 976 | > [fakedirstatewritetime] |
|
974 | 977 | > # emulate invoking dirstate.write() via repo.status() |
|
975 | 978 | > # at 2000-01-01 00:00 |
|
976 | 979 | > fakenow = 200001010000 |
|
977 | 980 | > |
|
978 | 981 | > [extensions] |
|
979 | 982 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
980 | 983 | > EOF |
|
981 | 984 | $ hg -R repo update |
|
982 | 985 | b: untracked file differs |
|
983 | 986 | abort: untracked files in working directory differ from files in requested revision (in subrepo s) |
|
984 | 987 | [255] |
|
985 | 988 | $ cat >> repo/.hg/hgrc <<EOF |
|
986 | 989 | > [extensions] |
|
987 | 990 | > fakedirstatewritetime = ! |
|
988 | 991 | > EOF |
|
989 | 992 | |
|
990 | 993 | $ cat repo/s/b |
|
991 | 994 | issue3276_ok |
|
992 | 995 | $ rm repo/s/b |
|
993 | 996 | $ touch -t 200001010000 repo/.hgsubstate |
|
994 | 997 | $ hg -R repo revert --all |
|
995 | 998 | reverting repo/.hgsubstate (glob) |
|
996 | 999 | reverting subrepo s |
|
997 | 1000 | $ hg -R repo update |
|
998 | 1001 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
999 | 1002 | $ cat repo/s/b |
|
1000 | 1003 | 2 |
|
1001 | 1004 | $ rm -rf repo2 repo |
|
1002 | 1005 | |
|
1003 | 1006 | |
|
1004 | 1007 | Issue1852 subrepos with relative paths always push/pull relative to default |
|
1005 | 1008 | |
|
1006 | 1009 | Prepare a repo with subrepo |
|
1007 | 1010 | |
|
1008 | 1011 | $ hg init issue1852a |
|
1009 | 1012 | $ cd issue1852a |
|
1010 | 1013 | $ hg init sub/repo |
|
1011 | 1014 | $ echo test > sub/repo/foo |
|
1012 | 1015 | $ hg -R sub/repo add sub/repo/foo |
|
1013 | 1016 | $ echo sub/repo = sub/repo > .hgsub |
|
1014 | 1017 | $ hg add .hgsub |
|
1015 | 1018 | $ hg ci -mtest |
|
1016 | 1019 | committing subrepository sub/repo (glob) |
|
1017 | 1020 | $ echo test >> sub/repo/foo |
|
1018 | 1021 | $ hg ci -mtest |
|
1019 | 1022 | committing subrepository sub/repo (glob) |
|
1020 | 1023 | $ hg cat sub/repo/foo |
|
1021 | 1024 | test |
|
1022 | 1025 | test |
|
1023 | 1026 | $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g' |
|
1024 | 1027 | [ |
|
1025 | 1028 | { |
|
1026 | 1029 | "abspath": "foo", |
|
1027 | 1030 | "data": "test\ntest\n", |
|
1028 | 1031 | "path": "sub/repo/foo" |
|
1029 | 1032 | } |
|
1030 | 1033 | ] |
|
1031 | 1034 | $ mkdir -p tmp/sub/repo |
|
1032 | 1035 | $ hg cat -r 0 --output tmp/%p_p sub/repo/foo |
|
1033 | 1036 | $ cat tmp/sub/repo/foo_p |
|
1034 | 1037 | test |
|
1035 | 1038 | $ mv sub/repo sub_ |
|
1036 | 1039 | $ hg cat sub/repo/baz |
|
1037 | 1040 | skipping missing subrepository: sub/repo |
|
1038 | 1041 | [1] |
|
1039 | 1042 | $ rm -rf sub/repo |
|
1040 | 1043 | $ mv sub_ sub/repo |
|
1041 | 1044 | $ cd .. |
|
1042 | 1045 | |
|
1043 | 1046 | Create repo without default path, pull top repo, and see what happens on update |
|
1044 | 1047 | |
|
1045 | 1048 | $ hg init issue1852b |
|
1046 | 1049 | $ hg -R issue1852b pull issue1852a |
|
1047 | 1050 | pulling from issue1852a |
|
1048 | 1051 | requesting all changes |
|
1049 | 1052 | adding changesets |
|
1050 | 1053 | adding manifests |
|
1051 | 1054 | adding file changes |
|
1052 | 1055 | added 2 changesets with 3 changes to 2 files |
|
1053 | 1056 | (run 'hg update' to get a working copy) |
|
1054 | 1057 | $ hg -R issue1852b update |
|
1055 | 1058 | abort: default path for subrepository not found (in subrepo sub/repo) (glob) |
|
1056 | 1059 | [255] |
|
1057 | 1060 | |
|
1058 | 1061 | Ensure a full traceback, not just the SubrepoAbort part |
|
1059 | 1062 | |
|
1060 | 1063 | $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort' |
|
1061 | 1064 | raise error.Abort(_("default path for subrepository not found")) |
|
1062 | 1065 | |
|
1063 | 1066 | Pull -u now doesn't help |
|
1064 | 1067 | |
|
1065 | 1068 | $ hg -R issue1852b pull -u issue1852a |
|
1066 | 1069 | pulling from issue1852a |
|
1067 | 1070 | searching for changes |
|
1068 | 1071 | no changes found |
|
1069 | 1072 | |
|
1070 | 1073 | Try the same, but with pull -u |
|
1071 | 1074 | |
|
1072 | 1075 | $ hg init issue1852c |
|
1073 | 1076 | $ hg -R issue1852c pull -r0 -u issue1852a |
|
1074 | 1077 | pulling from issue1852a |
|
1075 | 1078 | adding changesets |
|
1076 | 1079 | adding manifests |
|
1077 | 1080 | adding file changes |
|
1078 | 1081 | added 1 changesets with 2 changes to 2 files |
|
1079 | 1082 | cloning subrepo sub/repo from issue1852a/sub/repo (glob) |
|
1080 | 1083 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1081 | 1084 | |
|
1082 | 1085 | Try to push from the other side |
|
1083 | 1086 | |
|
1084 | 1087 | $ hg -R issue1852a push `pwd`/issue1852c |
|
1085 | 1088 | pushing to $TESTTMP/issue1852c (glob) |
|
1086 | 1089 | pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob) |
|
1087 | 1090 | searching for changes |
|
1088 | 1091 | no changes found |
|
1089 | 1092 | searching for changes |
|
1090 | 1093 | adding changesets |
|
1091 | 1094 | adding manifests |
|
1092 | 1095 | adding file changes |
|
1093 | 1096 | added 1 changesets with 1 changes to 1 files |
|
1094 | 1097 | |
|
1095 | 1098 | Incoming and outgoing should not use the default path: |
|
1096 | 1099 | |
|
1097 | 1100 | $ hg clone -q issue1852a issue1852d |
|
1098 | 1101 | $ hg -R issue1852d outgoing --subrepos issue1852c |
|
1099 | 1102 | comparing with issue1852c |
|
1100 | 1103 | searching for changes |
|
1101 | 1104 | no changes found |
|
1102 | 1105 | comparing with issue1852c/sub/repo |
|
1103 | 1106 | searching for changes |
|
1104 | 1107 | no changes found |
|
1105 | 1108 | [1] |
|
1106 | 1109 | $ hg -R issue1852d incoming --subrepos issue1852c |
|
1107 | 1110 | comparing with issue1852c |
|
1108 | 1111 | searching for changes |
|
1109 | 1112 | no changes found |
|
1110 | 1113 | comparing with issue1852c/sub/repo |
|
1111 | 1114 | searching for changes |
|
1112 | 1115 | no changes found |
|
1113 | 1116 | [1] |
|
1114 | 1117 | |
|
1115 | 1118 | Check that merge of a new subrepo doesn't write the uncommitted state to |
|
1116 | 1119 | .hgsubstate (issue4622) |
|
1117 | 1120 | |
|
1118 | 1121 | $ hg init issue1852a/addedsub |
|
1119 | 1122 | $ echo zzz > issue1852a/addedsub/zz.txt |
|
1120 | 1123 | $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ" |
|
1121 | 1124 | |
|
1122 | 1125 | $ hg clone issue1852a/addedsub issue1852d/addedsub |
|
1123 | 1126 | updating to branch default |
|
1124 | 1127 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1125 | 1128 | |
|
1126 | 1129 | $ echo def > issue1852a/sub/repo/foo |
|
1127 | 1130 | $ hg -R issue1852a ci -SAm 'tweaked subrepo' |
|
1128 | 1131 | adding tmp/sub/repo/foo_p |
|
1129 | 1132 | committing subrepository sub/repo (glob) |
|
1130 | 1133 | |
|
1131 | 1134 | $ echo 'addedsub = addedsub' >> issue1852d/.hgsub |
|
1132 | 1135 | $ echo xyz > issue1852d/sub/repo/foo |
|
1133 | 1136 | $ hg -R issue1852d pull -u |
|
1134 | 1137 | pulling from $TESTTMP/issue1852a (glob) |
|
1135 | 1138 | searching for changes |
|
1136 | 1139 | adding changesets |
|
1137 | 1140 | adding manifests |
|
1138 | 1141 | adding file changes |
|
1139 | 1142 | added 1 changesets with 2 changes to 2 files |
|
1140 | 1143 | subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c) |
|
1141 | 1144 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1142 | 1145 | pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob) |
|
1143 | 1146 | searching for changes |
|
1144 | 1147 | adding changesets |
|
1145 | 1148 | adding manifests |
|
1146 | 1149 | adding file changes |
|
1147 | 1150 | added 1 changesets with 1 changes to 1 files |
|
1148 | 1151 | subrepository sources for sub/repo differ (glob) |
|
1149 | 1152 | use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l |
|
1150 | 1153 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1151 | 1154 | $ cat issue1852d/.hgsubstate |
|
1152 | 1155 | f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo |
|
1153 | 1156 | |
|
1154 | 1157 | Check status of files when none of them belong to the first |
|
1155 | 1158 | subrepository: |
|
1156 | 1159 | |
|
1157 | 1160 | $ hg init subrepo-status |
|
1158 | 1161 | $ cd subrepo-status |
|
1159 | 1162 | $ hg init subrepo-1 |
|
1160 | 1163 | $ hg init subrepo-2 |
|
1161 | 1164 | $ cd subrepo-2 |
|
1162 | 1165 | $ touch file |
|
1163 | 1166 | $ hg add file |
|
1164 | 1167 | $ cd .. |
|
1165 | 1168 | $ echo subrepo-1 = subrepo-1 > .hgsub |
|
1166 | 1169 | $ echo subrepo-2 = subrepo-2 >> .hgsub |
|
1167 | 1170 | $ hg add .hgsub |
|
1168 | 1171 | $ hg ci -m 'Added subrepos' |
|
1169 | 1172 | committing subrepository subrepo-2 |
|
1170 | 1173 | $ hg st subrepo-2/file |
|
1171 | 1174 | |
|
1172 | 1175 | Check that share works with subrepo |
|
1173 | 1176 | $ hg --config extensions.share= share . ../shared |
|
1174 | 1177 | updating working directory |
|
1175 | 1178 | cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2 |
|
1176 | 1179 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1177 | 1180 | $ test -f ../shared/subrepo-1/.hg/sharedpath |
|
1178 | 1181 | [1] |
|
1179 | 1182 | $ hg -R ../shared in |
|
1180 | 1183 | abort: repository default not found! |
|
1181 | 1184 | [255] |
|
1182 | 1185 | $ hg -R ../shared/subrepo-2 showconfig paths |
|
1183 | 1186 | paths.default=$TESTTMP/subrepo-status/subrepo-2 |
|
1184 | 1187 | $ hg -R ../shared/subrepo-1 sum --remote |
|
1185 | 1188 | parent: -1:000000000000 tip (empty repository) |
|
1186 | 1189 | branch: default |
|
1187 | 1190 | commit: (clean) |
|
1188 | 1191 | update: (current) |
|
1189 | 1192 | remote: (synced) |
|
1190 | 1193 | |
|
1191 | 1194 | Check hg update --clean |
|
1192 | 1195 | $ cd $TESTTMP/t |
|
1193 | 1196 | $ rm -r t/t.orig |
|
1194 | 1197 | $ hg status -S --all |
|
1195 | 1198 | C .hgsub |
|
1196 | 1199 | C .hgsubstate |
|
1197 | 1200 | C a |
|
1198 | 1201 | C s/.hgsub |
|
1199 | 1202 | C s/.hgsubstate |
|
1200 | 1203 | C s/a |
|
1201 | 1204 | C s/ss/a |
|
1202 | 1205 | C t/t |
|
1203 | 1206 | $ echo c1 > s/a |
|
1204 | 1207 | $ cd s |
|
1205 | 1208 | $ echo c1 > b |
|
1206 | 1209 | $ echo c1 > c |
|
1207 | 1210 | $ hg add b |
|
1208 | 1211 | $ cd .. |
|
1209 | 1212 | $ hg status -S |
|
1210 | 1213 | M s/a |
|
1211 | 1214 | A s/b |
|
1212 | 1215 | ? s/c |
|
1213 | 1216 | $ hg update -C |
|
1214 | 1217 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1218 | updated to "925c17564ef8: 13" | |
|
1215 | 1219 | 2 other heads for branch "default" |
|
1216 | 1220 | $ hg status -S |
|
1217 | 1221 | ? s/b |
|
1218 | 1222 | ? s/c |
|
1219 | 1223 | |
|
1220 | 1224 | Sticky subrepositories, no changes |
|
1221 | 1225 | $ cd $TESTTMP/t |
|
1222 | 1226 | $ hg id |
|
1223 | 1227 | 925c17564ef8 tip |
|
1224 | 1228 | $ hg -R s id |
|
1225 | 1229 | 12a213df6fa9 tip |
|
1226 | 1230 | $ hg -R t id |
|
1227 | 1231 | 52c0adc0515a tip |
|
1228 | 1232 | $ hg update 11 |
|
1229 | 1233 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1230 | 1234 | $ hg id |
|
1231 | 1235 | 365661e5936a |
|
1232 | 1236 | $ hg -R s id |
|
1233 | 1237 | fc627a69481f |
|
1234 | 1238 | $ hg -R t id |
|
1235 | 1239 | e95bcfa18a35 |
|
1236 | 1240 | |
|
1237 | 1241 | Sticky subrepositories, file changes |
|
1238 | 1242 | $ touch s/f1 |
|
1239 | 1243 | $ touch t/f1 |
|
1240 | 1244 | $ hg add -S s/f1 |
|
1241 | 1245 | $ hg add -S t/f1 |
|
1242 | 1246 | $ hg id |
|
1243 | 1247 | 365661e5936a+ |
|
1244 | 1248 | $ hg -R s id |
|
1245 | 1249 | fc627a69481f+ |
|
1246 | 1250 | $ hg -R t id |
|
1247 | 1251 | e95bcfa18a35+ |
|
1248 | 1252 | $ hg update tip |
|
1249 | 1253 | subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9) |
|
1250 | 1254 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1251 | 1255 | subrepository sources for s differ |
|
1252 | 1256 | use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l |
|
1253 | 1257 | subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a) |
|
1254 | 1258 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1255 | 1259 | subrepository sources for t differ |
|
1256 | 1260 | use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l |
|
1257 | 1261 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1258 | 1262 | $ hg id |
|
1259 | 1263 | 925c17564ef8+ tip |
|
1260 | 1264 | $ hg -R s id |
|
1261 | 1265 | fc627a69481f+ |
|
1262 | 1266 | $ hg -R t id |
|
1263 | 1267 | e95bcfa18a35+ |
|
1264 | 1268 | $ hg update --clean tip |
|
1265 | 1269 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1266 | 1270 | |
|
1267 | 1271 | Sticky subrepository, revision updates |
|
1268 | 1272 | $ hg id |
|
1269 | 1273 | 925c17564ef8 tip |
|
1270 | 1274 | $ hg -R s id |
|
1271 | 1275 | 12a213df6fa9 tip |
|
1272 | 1276 | $ hg -R t id |
|
1273 | 1277 | 52c0adc0515a tip |
|
1274 | 1278 | $ cd s |
|
1275 | 1279 | $ hg update -r -2 |
|
1276 | 1280 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1277 | 1281 | $ cd ../t |
|
1278 | 1282 | $ hg update -r 2 |
|
1279 | 1283 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1280 | 1284 | $ cd .. |
|
1281 | 1285 | $ hg update 10 |
|
1282 | 1286 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) |
|
1283 | 1287 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1284 | 1288 | subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c) |
|
1285 | 1289 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1286 | 1290 | subrepository sources for t differ (in checked out version) |
|
1287 | 1291 | use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l |
|
1288 | 1292 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1289 | 1293 | $ hg id |
|
1290 | 1294 | e45c8b14af55+ |
|
1291 | 1295 | $ hg -R s id |
|
1292 | 1296 | 02dcf1d70411 |
|
1293 | 1297 | $ hg -R t id |
|
1294 | 1298 | 7af322bc1198 |
|
1295 | 1299 | |
|
1296 | 1300 | Sticky subrepository, file changes and revision updates |
|
1297 | 1301 | $ touch s/f1 |
|
1298 | 1302 | $ touch t/f1 |
|
1299 | 1303 | $ hg add -S s/f1 |
|
1300 | 1304 | $ hg add -S t/f1 |
|
1301 | 1305 | $ hg id |
|
1302 | 1306 | e45c8b14af55+ |
|
1303 | 1307 | $ hg -R s id |
|
1304 | 1308 | 02dcf1d70411+ |
|
1305 | 1309 | $ hg -R t id |
|
1306 | 1310 | 7af322bc1198+ |
|
1307 | 1311 | $ hg update tip |
|
1308 | 1312 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9) |
|
1309 | 1313 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1310 | 1314 | subrepository sources for s differ |
|
1311 | 1315 | use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l |
|
1312 | 1316 | subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a) |
|
1313 | 1317 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1314 | 1318 | subrepository sources for t differ |
|
1315 | 1319 | use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l |
|
1316 | 1320 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1317 | 1321 | $ hg id |
|
1318 | 1322 | 925c17564ef8+ tip |
|
1319 | 1323 | $ hg -R s id |
|
1320 | 1324 | 02dcf1d70411+ |
|
1321 | 1325 | $ hg -R t id |
|
1322 | 1326 | 7af322bc1198+ |
|
1323 | 1327 | |
|
1324 | 1328 | Sticky repository, update --clean |
|
1325 | 1329 | $ hg update --clean tip |
|
1326 | 1330 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1327 | 1331 | $ hg id |
|
1328 | 1332 | 925c17564ef8 tip |
|
1329 | 1333 | $ hg -R s id |
|
1330 | 1334 | 12a213df6fa9 tip |
|
1331 | 1335 | $ hg -R t id |
|
1332 | 1336 | 52c0adc0515a tip |
|
1333 | 1337 | |
|
1334 | 1338 | Test subrepo already at intended revision: |
|
1335 | 1339 | $ cd s |
|
1336 | 1340 | $ hg update fc627a69481f |
|
1337 | 1341 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1338 | 1342 | $ cd .. |
|
1339 | 1343 | $ hg update 11 |
|
1340 | 1344 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) |
|
1341 | 1345 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
1342 | 1346 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1343 | 1347 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1344 | 1348 | $ hg id -n |
|
1345 | 1349 | 11+ |
|
1346 | 1350 | $ hg -R s id |
|
1347 | 1351 | fc627a69481f |
|
1348 | 1352 | $ hg -R t id |
|
1349 | 1353 | e95bcfa18a35 |
|
1350 | 1354 | |
|
1351 | 1355 | Test that removing .hgsubstate doesn't break anything: |
|
1352 | 1356 | |
|
1353 | 1357 | $ hg rm -f .hgsubstate |
|
1354 | 1358 | $ hg ci -mrm |
|
1355 | 1359 | nothing changed |
|
1356 | 1360 | [1] |
|
1357 | 1361 | $ hg log -vr tip |
|
1358 | 1362 | changeset: 13:925c17564ef8 |
|
1359 | 1363 | tag: tip |
|
1360 | 1364 | user: test |
|
1361 | 1365 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1362 | 1366 | files: .hgsubstate |
|
1363 | 1367 | description: |
|
1364 | 1368 | 13 |
|
1365 | 1369 | |
|
1366 | 1370 | |
|
1367 | 1371 | |
|
1368 | 1372 | Test that removing .hgsub removes .hgsubstate: |
|
1369 | 1373 | |
|
1370 | 1374 | $ hg rm .hgsub |
|
1371 | 1375 | $ hg ci -mrm2 |
|
1372 | 1376 | created new head |
|
1373 | 1377 | $ hg log -vr tip |
|
1374 | 1378 | changeset: 14:2400bccd50af |
|
1375 | 1379 | tag: tip |
|
1376 | 1380 | parent: 11:365661e5936a |
|
1377 | 1381 | user: test |
|
1378 | 1382 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1379 | 1383 | files: .hgsub .hgsubstate |
|
1380 | 1384 | description: |
|
1381 | 1385 | rm2 |
|
1382 | 1386 | |
|
1383 | 1387 | |
|
1384 | 1388 | Test issue3153: diff -S with deleted subrepos |
|
1385 | 1389 | |
|
1386 | 1390 | $ hg diff --nodates -S -c . |
|
1387 | 1391 | diff -r 365661e5936a -r 2400bccd50af .hgsub |
|
1388 | 1392 | --- a/.hgsub |
|
1389 | 1393 | +++ /dev/null |
|
1390 | 1394 | @@ -1,2 +0,0 @@ |
|
1391 | 1395 | -s = s |
|
1392 | 1396 | -t = t |
|
1393 | 1397 | diff -r 365661e5936a -r 2400bccd50af .hgsubstate |
|
1394 | 1398 | --- a/.hgsubstate |
|
1395 | 1399 | +++ /dev/null |
|
1396 | 1400 | @@ -1,2 +0,0 @@ |
|
1397 | 1401 | -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s |
|
1398 | 1402 | -e95bcfa18a358dc4936da981ebf4147b4cad1362 t |
|
1399 | 1403 | |
|
1400 | 1404 | Test behavior of add for explicit path in subrepo: |
|
1401 | 1405 | $ cd .. |
|
1402 | 1406 | $ hg init explicit |
|
1403 | 1407 | $ cd explicit |
|
1404 | 1408 | $ echo s = s > .hgsub |
|
1405 | 1409 | $ hg add .hgsub |
|
1406 | 1410 | $ hg init s |
|
1407 | 1411 | $ hg ci -m0 |
|
1408 | 1412 | Adding with an explicit path in a subrepo adds the file |
|
1409 | 1413 | $ echo c1 > f1 |
|
1410 | 1414 | $ echo c2 > s/f2 |
|
1411 | 1415 | $ hg st -S |
|
1412 | 1416 | ? f1 |
|
1413 | 1417 | ? s/f2 |
|
1414 | 1418 | $ hg add s/f2 |
|
1415 | 1419 | $ hg st -S |
|
1416 | 1420 | A s/f2 |
|
1417 | 1421 | ? f1 |
|
1418 | 1422 | $ hg ci -R s -m0 |
|
1419 | 1423 | $ hg ci -Am1 |
|
1420 | 1424 | adding f1 |
|
1421 | 1425 | Adding with an explicit path in a subrepo with -S has the same behavior |
|
1422 | 1426 | $ echo c3 > f3 |
|
1423 | 1427 | $ echo c4 > s/f4 |
|
1424 | 1428 | $ hg st -S |
|
1425 | 1429 | ? f3 |
|
1426 | 1430 | ? s/f4 |
|
1427 | 1431 | $ hg add -S s/f4 |
|
1428 | 1432 | $ hg st -S |
|
1429 | 1433 | A s/f4 |
|
1430 | 1434 | ? f3 |
|
1431 | 1435 | $ hg ci -R s -m1 |
|
1432 | 1436 | $ hg ci -Ama2 |
|
1433 | 1437 | adding f3 |
|
1434 | 1438 | Adding without a path or pattern silently ignores subrepos |
|
1435 | 1439 | $ echo c5 > f5 |
|
1436 | 1440 | $ echo c6 > s/f6 |
|
1437 | 1441 | $ echo c7 > s/f7 |
|
1438 | 1442 | $ hg st -S |
|
1439 | 1443 | ? f5 |
|
1440 | 1444 | ? s/f6 |
|
1441 | 1445 | ? s/f7 |
|
1442 | 1446 | $ hg add |
|
1443 | 1447 | adding f5 |
|
1444 | 1448 | $ hg st -S |
|
1445 | 1449 | A f5 |
|
1446 | 1450 | ? s/f6 |
|
1447 | 1451 | ? s/f7 |
|
1448 | 1452 | $ hg ci -R s -Am2 |
|
1449 | 1453 | adding f6 |
|
1450 | 1454 | adding f7 |
|
1451 | 1455 | $ hg ci -m3 |
|
1452 | 1456 | Adding without a path or pattern with -S also adds files in subrepos |
|
1453 | 1457 | $ echo c8 > f8 |
|
1454 | 1458 | $ echo c9 > s/f9 |
|
1455 | 1459 | $ echo c10 > s/f10 |
|
1456 | 1460 | $ hg st -S |
|
1457 | 1461 | ? f8 |
|
1458 | 1462 | ? s/f10 |
|
1459 | 1463 | ? s/f9 |
|
1460 | 1464 | $ hg add -S |
|
1461 | 1465 | adding f8 |
|
1462 | 1466 | adding s/f10 (glob) |
|
1463 | 1467 | adding s/f9 (glob) |
|
1464 | 1468 | $ hg st -S |
|
1465 | 1469 | A f8 |
|
1466 | 1470 | A s/f10 |
|
1467 | 1471 | A s/f9 |
|
1468 | 1472 | $ hg ci -R s -m3 |
|
1469 | 1473 | $ hg ci -m4 |
|
1470 | 1474 | Adding with a pattern silently ignores subrepos |
|
1471 | 1475 | $ echo c11 > fm11 |
|
1472 | 1476 | $ echo c12 > fn12 |
|
1473 | 1477 | $ echo c13 > s/fm13 |
|
1474 | 1478 | $ echo c14 > s/fn14 |
|
1475 | 1479 | $ hg st -S |
|
1476 | 1480 | ? fm11 |
|
1477 | 1481 | ? fn12 |
|
1478 | 1482 | ? s/fm13 |
|
1479 | 1483 | ? s/fn14 |
|
1480 | 1484 | $ hg add 'glob:**fm*' |
|
1481 | 1485 | adding fm11 |
|
1482 | 1486 | $ hg st -S |
|
1483 | 1487 | A fm11 |
|
1484 | 1488 | ? fn12 |
|
1485 | 1489 | ? s/fm13 |
|
1486 | 1490 | ? s/fn14 |
|
1487 | 1491 | $ hg ci -R s -Am4 |
|
1488 | 1492 | adding fm13 |
|
1489 | 1493 | adding fn14 |
|
1490 | 1494 | $ hg ci -Am5 |
|
1491 | 1495 | adding fn12 |
|
1492 | 1496 | Adding with a pattern with -S also adds matches in subrepos |
|
1493 | 1497 | $ echo c15 > fm15 |
|
1494 | 1498 | $ echo c16 > fn16 |
|
1495 | 1499 | $ echo c17 > s/fm17 |
|
1496 | 1500 | $ echo c18 > s/fn18 |
|
1497 | 1501 | $ hg st -S |
|
1498 | 1502 | ? fm15 |
|
1499 | 1503 | ? fn16 |
|
1500 | 1504 | ? s/fm17 |
|
1501 | 1505 | ? s/fn18 |
|
1502 | 1506 | $ hg add -S 'glob:**fm*' |
|
1503 | 1507 | adding fm15 |
|
1504 | 1508 | adding s/fm17 (glob) |
|
1505 | 1509 | $ hg st -S |
|
1506 | 1510 | A fm15 |
|
1507 | 1511 | A s/fm17 |
|
1508 | 1512 | ? fn16 |
|
1509 | 1513 | ? s/fn18 |
|
1510 | 1514 | $ hg ci -R s -Am5 |
|
1511 | 1515 | adding fn18 |
|
1512 | 1516 | $ hg ci -Am6 |
|
1513 | 1517 | adding fn16 |
|
1514 | 1518 | |
|
1515 | 1519 | Test behavior of forget for explicit path in subrepo: |
|
1516 | 1520 | Forgetting an explicit path in a subrepo untracks the file |
|
1517 | 1521 | $ echo c19 > s/f19 |
|
1518 | 1522 | $ hg add s/f19 |
|
1519 | 1523 | $ hg st -S |
|
1520 | 1524 | A s/f19 |
|
1521 | 1525 | $ hg forget s/f19 |
|
1522 | 1526 | $ hg st -S |
|
1523 | 1527 | ? s/f19 |
|
1524 | 1528 | $ rm s/f19 |
|
1525 | 1529 | $ cd .. |
|
1526 | 1530 | |
|
1527 | 1531 | Courtesy phases synchronisation to publishing server does not block the push |
|
1528 | 1532 | (issue3781) |
|
1529 | 1533 | |
|
1530 | 1534 | $ cp -R main issue3781 |
|
1531 | 1535 | $ cp -R main issue3781-dest |
|
1532 | 1536 | $ cd issue3781-dest/s |
|
1533 | 1537 | $ hg phase tip # show we have draft changeset |
|
1534 | 1538 | 5: draft |
|
1535 | 1539 | $ chmod a-w .hg/store/phaseroots # prevent phase push |
|
1536 | 1540 | $ cd ../../issue3781 |
|
1537 | 1541 | $ cat >> .hg/hgrc << EOF |
|
1538 | 1542 | > [paths] |
|
1539 | 1543 | > default=../issue3781-dest/ |
|
1540 | 1544 | > EOF |
|
1541 | 1545 | $ hg push --config devel.legacy.exchange=bundle1 |
|
1542 | 1546 | pushing to $TESTTMP/issue3781-dest (glob) |
|
1543 | 1547 | pushing subrepo s to $TESTTMP/issue3781-dest/s |
|
1544 | 1548 | searching for changes |
|
1545 | 1549 | no changes found |
|
1546 | 1550 | searching for changes |
|
1547 | 1551 | no changes found |
|
1548 | 1552 | [1] |
|
1549 | 1553 | # clean the push cache |
|
1550 | 1554 | $ rm s/.hg/cache/storehash/* |
|
1551 | 1555 | $ hg push # bundle2+ |
|
1552 | 1556 | pushing to $TESTTMP/issue3781-dest (glob) |
|
1553 | 1557 | pushing subrepo s to $TESTTMP/issue3781-dest/s |
|
1554 | 1558 | searching for changes |
|
1555 | 1559 | no changes found |
|
1556 | 1560 | searching for changes |
|
1557 | 1561 | no changes found |
|
1558 | 1562 | [1] |
|
1559 | 1563 | $ cd .. |
|
1560 | 1564 | |
|
1561 | 1565 | Test phase choice for newly created commit with "phases.subrepochecks" |
|
1562 | 1566 | configuration |
|
1563 | 1567 | |
|
1564 | 1568 | $ cd t |
|
1565 | 1569 | $ hg update -q -r 12 |
|
1566 | 1570 | |
|
1567 | 1571 | $ cat >> s/ss/.hg/hgrc <<EOF |
|
1568 | 1572 | > [phases] |
|
1569 | 1573 | > new-commit = secret |
|
1570 | 1574 | > EOF |
|
1571 | 1575 | $ cat >> s/.hg/hgrc <<EOF |
|
1572 | 1576 | > [phases] |
|
1573 | 1577 | > new-commit = draft |
|
1574 | 1578 | > EOF |
|
1575 | 1579 | $ echo phasecheck1 >> s/ss/a |
|
1576 | 1580 | $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1 |
|
1577 | 1581 | committing subrepository ss |
|
1578 | 1582 | transaction abort! |
|
1579 | 1583 | rollback completed |
|
1580 | 1584 | abort: can't commit in draft phase conflicting secret from subrepository ss |
|
1581 | 1585 | [255] |
|
1582 | 1586 | $ echo phasecheck2 >> s/ss/a |
|
1583 | 1587 | $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2 |
|
1584 | 1588 | committing subrepository ss |
|
1585 | 1589 | $ hg -R s/ss phase tip |
|
1586 | 1590 | 3: secret |
|
1587 | 1591 | $ hg -R s phase tip |
|
1588 | 1592 | 6: draft |
|
1589 | 1593 | $ echo phasecheck3 >> s/ss/a |
|
1590 | 1594 | $ hg -R s commit -S -m phasecheck3 |
|
1591 | 1595 | committing subrepository ss |
|
1592 | 1596 | warning: changes are committed in secret phase from subrepository ss |
|
1593 | 1597 | $ hg -R s/ss phase tip |
|
1594 | 1598 | 4: secret |
|
1595 | 1599 | $ hg -R s phase tip |
|
1596 | 1600 | 7: secret |
|
1597 | 1601 | |
|
1598 | 1602 | $ cat >> t/.hg/hgrc <<EOF |
|
1599 | 1603 | > [phases] |
|
1600 | 1604 | > new-commit = draft |
|
1601 | 1605 | > EOF |
|
1602 | 1606 | $ cat >> .hg/hgrc <<EOF |
|
1603 | 1607 | > [phases] |
|
1604 | 1608 | > new-commit = public |
|
1605 | 1609 | > EOF |
|
1606 | 1610 | $ echo phasecheck4 >> s/ss/a |
|
1607 | 1611 | $ echo phasecheck4 >> t/t |
|
1608 | 1612 | $ hg commit -S -m phasecheck4 |
|
1609 | 1613 | committing subrepository s |
|
1610 | 1614 | committing subrepository s/ss (glob) |
|
1611 | 1615 | warning: changes are committed in secret phase from subrepository ss |
|
1612 | 1616 | committing subrepository t |
|
1613 | 1617 | warning: changes are committed in secret phase from subrepository s |
|
1614 | 1618 | created new head |
|
1615 | 1619 | $ hg -R s/ss phase tip |
|
1616 | 1620 | 5: secret |
|
1617 | 1621 | $ hg -R s phase tip |
|
1618 | 1622 | 8: secret |
|
1619 | 1623 | $ hg -R t phase tip |
|
1620 | 1624 | 6: draft |
|
1621 | 1625 | $ hg phase tip |
|
1622 | 1626 | 15: secret |
|
1623 | 1627 | |
|
1624 | 1628 | $ cd .. |
|
1625 | 1629 | |
|
1626 | 1630 | |
|
1627 | 1631 | Test that commit --secret works on both repo and subrepo (issue4182) |
|
1628 | 1632 | |
|
1629 | 1633 | $ cd main |
|
1630 | 1634 | $ echo secret >> b |
|
1631 | 1635 | $ echo secret >> s/b |
|
1632 | 1636 | $ hg commit --secret --subrepo -m "secret" |
|
1633 | 1637 | committing subrepository s |
|
1634 | 1638 | $ hg phase -r . |
|
1635 | 1639 | 6: secret |
|
1636 | 1640 | $ cd s |
|
1637 | 1641 | $ hg phase -r . |
|
1638 | 1642 | 6: secret |
|
1639 | 1643 | $ cd ../../ |
|
1640 | 1644 | |
|
1641 | 1645 | Test "subrepos" template keyword |
|
1642 | 1646 | |
|
1643 | 1647 | $ cd t |
|
1644 | 1648 | $ hg update -q 15 |
|
1645 | 1649 | $ cat > .hgsub <<EOF |
|
1646 | 1650 | > s = s |
|
1647 | 1651 | > EOF |
|
1648 | 1652 | $ hg commit -m "16" |
|
1649 | 1653 | warning: changes are committed in secret phase from subrepository s |
|
1650 | 1654 | |
|
1651 | 1655 | (addition of ".hgsub" itself) |
|
1652 | 1656 | |
|
1653 | 1657 | $ hg diff --nodates -c 1 .hgsubstate |
|
1654 | 1658 | diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate |
|
1655 | 1659 | --- /dev/null |
|
1656 | 1660 | +++ b/.hgsubstate |
|
1657 | 1661 | @@ -0,0 +1,1 @@ |
|
1658 | 1662 | +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
1659 | 1663 | $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" |
|
1660 | 1664 | f7b1eb17ad24 000000000000 |
|
1661 | 1665 | s |
|
1662 | 1666 | |
|
1663 | 1667 | (modification of existing entry) |
|
1664 | 1668 | |
|
1665 | 1669 | $ hg diff --nodates -c 2 .hgsubstate |
|
1666 | 1670 | diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate |
|
1667 | 1671 | --- a/.hgsubstate |
|
1668 | 1672 | +++ b/.hgsubstate |
|
1669 | 1673 | @@ -1,1 +1,1 @@ |
|
1670 | 1674 | -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
1671 | 1675 | +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s |
|
1672 | 1676 | $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" |
|
1673 | 1677 | 7cf8cfea66e4 000000000000 |
|
1674 | 1678 | s |
|
1675 | 1679 | |
|
1676 | 1680 | (addition of entry) |
|
1677 | 1681 | |
|
1678 | 1682 | $ hg diff --nodates -c 5 .hgsubstate |
|
1679 | 1683 | diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate |
|
1680 | 1684 | --- a/.hgsubstate |
|
1681 | 1685 | +++ b/.hgsubstate |
|
1682 | 1686 | @@ -1,1 +1,2 @@ |
|
1683 | 1687 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
1684 | 1688 | +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t |
|
1685 | 1689 | $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" |
|
1686 | 1690 | 7cf8cfea66e4 000000000000 |
|
1687 | 1691 | t |
|
1688 | 1692 | |
|
1689 | 1693 | (removal of existing entry) |
|
1690 | 1694 | |
|
1691 | 1695 | $ hg diff --nodates -c 16 .hgsubstate |
|
1692 | 1696 | diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate |
|
1693 | 1697 | --- a/.hgsubstate |
|
1694 | 1698 | +++ b/.hgsubstate |
|
1695 | 1699 | @@ -1,2 +1,1 @@ |
|
1696 | 1700 | 0731af8ca9423976d3743119d0865097c07bdc1b s |
|
1697 | 1701 | -e202dc79b04c88a636ea8913d9182a1346d9b3dc t |
|
1698 | 1702 | $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" |
|
1699 | 1703 | 8bec38d2bd0b 000000000000 |
|
1700 | 1704 | t |
|
1701 | 1705 | |
|
1702 | 1706 | (merging) |
|
1703 | 1707 | |
|
1704 | 1708 | $ hg diff --nodates -c 9 .hgsubstate |
|
1705 | 1709 | diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate |
|
1706 | 1710 | --- a/.hgsubstate |
|
1707 | 1711 | +++ b/.hgsubstate |
|
1708 | 1712 | @@ -1,1 +1,2 @@ |
|
1709 | 1713 | fc627a69481fcbe5f1135069e8a3881c023e4cf5 s |
|
1710 | 1714 | +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t |
|
1711 | 1715 | $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" |
|
1712 | 1716 | f6affe3fbfaa 1f14a2e2d3ec |
|
1713 | 1717 | t |
|
1714 | 1718 | |
|
1715 | 1719 | (removal of ".hgsub" itself) |
|
1716 | 1720 | |
|
1717 | 1721 | $ hg diff --nodates -c 8 .hgsubstate |
|
1718 | 1722 | diff -r f94576341bcf -r 96615c1dad2d .hgsubstate |
|
1719 | 1723 | --- a/.hgsubstate |
|
1720 | 1724 | +++ /dev/null |
|
1721 | 1725 | @@ -1,2 +0,0 @@ |
|
1722 | 1726 | -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s |
|
1723 | 1727 | -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t |
|
1724 | 1728 | $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" |
|
1725 | 1729 | f94576341bcf 000000000000 |
|
1726 | 1730 | |
|
1727 | 1731 | Test that '[paths]' is configured correctly at subrepo creation |
|
1728 | 1732 | |
|
1729 | 1733 | $ cd $TESTTMP/tc |
|
1730 | 1734 | $ cat > .hgsub <<EOF |
|
1731 | 1735 | > # to clear bogus subrepo path 'bogus=[boguspath' |
|
1732 | 1736 | > s = s |
|
1733 | 1737 | > t = t |
|
1734 | 1738 | > EOF |
|
1735 | 1739 | $ hg update -q --clean null |
|
1736 | 1740 | $ rm -rf s t |
|
1737 | 1741 | $ cat >> .hg/hgrc <<EOF |
|
1738 | 1742 | > [paths] |
|
1739 | 1743 | > default-push = /foo/bar |
|
1740 | 1744 | > EOF |
|
1741 | 1745 | $ hg update -q |
|
1742 | 1746 | $ cat s/.hg/hgrc |
|
1743 | 1747 | [paths] |
|
1744 | 1748 | default = $TESTTMP/t/s |
|
1745 | 1749 | default-push = /foo/bar/s |
|
1746 | 1750 | $ cat s/ss/.hg/hgrc |
|
1747 | 1751 | [paths] |
|
1748 | 1752 | default = $TESTTMP/t/s/ss |
|
1749 | 1753 | default-push = /foo/bar/s/ss |
|
1750 | 1754 | $ cat t/.hg/hgrc |
|
1751 | 1755 | [paths] |
|
1752 | 1756 | default = $TESTTMP/t/t |
|
1753 | 1757 | default-push = /foo/bar/t |
|
1754 | 1758 | |
|
1755 | 1759 | $ cd $TESTTMP/t |
|
1756 | 1760 | $ hg up -qC 0 |
|
1757 | 1761 | $ echo 'bar' > bar.txt |
|
1758 | 1762 | $ hg ci -Am 'branch before subrepo add' |
|
1759 | 1763 | adding bar.txt |
|
1760 | 1764 | created new head |
|
1761 | 1765 | $ hg merge -r "first(subrepo('s'))" |
|
1762 | 1766 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1763 | 1767 | (branch merge, don't forget to commit) |
|
1764 | 1768 | $ hg status -S -X '.hgsub*' |
|
1765 | 1769 | A s/a |
|
1766 | 1770 | ? s/b |
|
1767 | 1771 | ? s/c |
|
1768 | 1772 | ? s/f1 |
|
1769 | 1773 | $ hg status -S --rev 'p2()' |
|
1770 | 1774 | A bar.txt |
|
1771 | 1775 | ? s/b |
|
1772 | 1776 | ? s/c |
|
1773 | 1777 | ? s/f1 |
|
1774 | 1778 | $ hg diff -S -X '.hgsub*' --nodates |
|
1775 | 1779 | diff -r 000000000000 s/a |
|
1776 | 1780 | --- /dev/null |
|
1777 | 1781 | +++ b/s/a |
|
1778 | 1782 | @@ -0,0 +1,1 @@ |
|
1779 | 1783 | +a |
|
1780 | 1784 | $ hg diff -S --rev 'p2()' --nodates |
|
1781 | 1785 | diff -r 7cf8cfea66e4 bar.txt |
|
1782 | 1786 | --- /dev/null |
|
1783 | 1787 | +++ b/bar.txt |
|
1784 | 1788 | @@ -0,0 +1,1 @@ |
|
1785 | 1789 | +bar |
|
1786 | 1790 | |
|
1787 | 1791 | $ cd .. |
@@ -1,1002 +1,1003 | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | $ cat <<EOF >> $HGRCPATH |
|
4 | 4 | > [extensions] |
|
5 | 5 | > transplant= |
|
6 | 6 | > EOF |
|
7 | 7 | |
|
8 | 8 | $ hg init t |
|
9 | 9 | $ cd t |
|
10 | 10 | $ hg transplant |
|
11 | 11 | abort: no source URL, branch revision, or revision list provided |
|
12 | 12 | [255] |
|
13 | 13 | $ hg transplant --continue --all |
|
14 | 14 | abort: --continue is incompatible with --branch, --all and --merge |
|
15 | 15 | [255] |
|
16 | 16 | $ hg transplant --all tip |
|
17 | 17 | abort: --all requires a branch revision |
|
18 | 18 | [255] |
|
19 | 19 | $ hg transplant --all --branch default tip |
|
20 | 20 | abort: --all is incompatible with a revision list |
|
21 | 21 | [255] |
|
22 | 22 | $ echo r1 > r1 |
|
23 | 23 | $ hg ci -Amr1 -d'0 0' |
|
24 | 24 | adding r1 |
|
25 | 25 | $ hg co -q null |
|
26 | 26 | $ hg transplant tip |
|
27 | 27 | abort: no revision checked out |
|
28 | 28 | [255] |
|
29 | 29 | $ hg up -q |
|
30 | 30 | $ echo r2 > r2 |
|
31 | 31 | $ hg ci -Amr2 -d'1 0' |
|
32 | 32 | adding r2 |
|
33 | 33 | $ hg up 0 |
|
34 | 34 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
35 | 35 | |
|
36 | 36 | $ echo b1 > b1 |
|
37 | 37 | $ hg ci -Amb1 -d '0 0' |
|
38 | 38 | adding b1 |
|
39 | 39 | created new head |
|
40 | 40 | $ hg merge 1 |
|
41 | 41 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 | 42 | (branch merge, don't forget to commit) |
|
43 | 43 | $ hg transplant 1 |
|
44 | 44 | abort: outstanding uncommitted merges |
|
45 | 45 | [255] |
|
46 | 46 | $ hg up -qC tip |
|
47 | 47 | $ echo b0 > b1 |
|
48 | 48 | $ hg transplant 1 |
|
49 | 49 | abort: outstanding local changes |
|
50 | 50 | [255] |
|
51 | 51 | $ hg up -qC tip |
|
52 | 52 | $ echo b2 > b2 |
|
53 | 53 | $ hg ci -Amb2 -d '1 0' |
|
54 | 54 | adding b2 |
|
55 | 55 | $ echo b3 > b3 |
|
56 | 56 | $ hg ci -Amb3 -d '2 0' |
|
57 | 57 | adding b3 |
|
58 | 58 | |
|
59 | 59 | $ hg log --template '{rev} {parents} {desc}\n' |
|
60 | 60 | 4 b3 |
|
61 | 61 | 3 b2 |
|
62 | 62 | 2 0:17ab29e464c6 b1 |
|
63 | 63 | 1 r2 |
|
64 | 64 | 0 r1 |
|
65 | 65 | |
|
66 | 66 | $ hg clone . ../rebase |
|
67 | 67 | updating to branch default |
|
68 | 68 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 69 | $ hg init ../emptydest |
|
70 | 70 | $ cd ../emptydest |
|
71 | 71 | $ hg transplant --source=../t > /dev/null |
|
72 | 72 | $ cd ../rebase |
|
73 | 73 | |
|
74 | 74 | $ hg up -C 1 |
|
75 | 75 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
76 | 76 | |
|
77 | 77 | rebase b onto r1 |
|
78 | 78 | (this also tests that editor is not invoked if '--edit' is not specified) |
|
79 | 79 | |
|
80 | 80 | $ HGEDITOR=cat hg transplant -a -b tip |
|
81 | 81 | applying 37a1297eb21b |
|
82 | 82 | 37a1297eb21b transplanted to e234d668f844 |
|
83 | 83 | applying 722f4667af76 |
|
84 | 84 | 722f4667af76 transplanted to 539f377d78df |
|
85 | 85 | applying a53251cdf717 |
|
86 | 86 | a53251cdf717 transplanted to ffd6818a3975 |
|
87 | 87 | $ hg log --template '{rev} {parents} {desc}\n' |
|
88 | 88 | 7 b3 |
|
89 | 89 | 6 b2 |
|
90 | 90 | 5 1:d11e3596cc1a b1 |
|
91 | 91 | 4 b3 |
|
92 | 92 | 3 b2 |
|
93 | 93 | 2 0:17ab29e464c6 b1 |
|
94 | 94 | 1 r2 |
|
95 | 95 | 0 r1 |
|
96 | 96 | |
|
97 | 97 | test format of transplant_source |
|
98 | 98 | |
|
99 | 99 | $ hg log -r7 --debug | grep transplant_source |
|
100 | 100 | extra: transplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z |
|
101 | 101 | $ hg log -r7 -T '{extras}\n' |
|
102 | 102 | branch=defaulttransplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z |
|
103 | 103 | $ hg log -r7 -T '{join(extras, " ")}\n' |
|
104 | 104 | branch=default transplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z |
|
105 | 105 | |
|
106 | 106 | test transplanted revset |
|
107 | 107 | |
|
108 | 108 | $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n' |
|
109 | 109 | 5 1:d11e3596cc1a b1 |
|
110 | 110 | 6 b2 |
|
111 | 111 | 7 b3 |
|
112 | 112 | $ hg log -r 'transplanted(head())' --template '{rev} {parents} {desc}\n' |
|
113 | 113 | 7 b3 |
|
114 | 114 | $ hg help revisions.transplanted |
|
115 | 115 | "transplanted([set])" |
|
116 | 116 | Transplanted changesets in set, or all transplanted changesets. |
|
117 | 117 | |
|
118 | 118 | |
|
119 | 119 | test transplanted keyword |
|
120 | 120 | |
|
121 | 121 | $ hg log --template '{rev} {transplanted}\n' |
|
122 | 122 | 7 a53251cdf717679d1907b289f991534be05c997a |
|
123 | 123 | 6 722f4667af767100cb15b6a79324bf8abbfe1ef4 |
|
124 | 124 | 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21 |
|
125 | 125 | 4 |
|
126 | 126 | 3 |
|
127 | 127 | 2 |
|
128 | 128 | 1 |
|
129 | 129 | 0 |
|
130 | 130 | |
|
131 | 131 | test destination() revset predicate with a transplant of a transplant; new |
|
132 | 132 | clone so subsequent rollback isn't affected |
|
133 | 133 | (this also tests that editor is invoked if '--edit' is specified) |
|
134 | 134 | |
|
135 | 135 | $ hg clone -q . ../destination |
|
136 | 136 | $ cd ../destination |
|
137 | 137 | $ hg up -Cq 0 |
|
138 | 138 | $ hg branch -q b4 |
|
139 | 139 | $ hg ci -qm "b4" |
|
140 | 140 | $ hg status --rev "7^1" --rev 7 |
|
141 | 141 | A b3 |
|
142 | 142 | $ cat > $TESTTMP/checkeditform.sh <<EOF |
|
143 | 143 | > env | grep HGEDITFORM |
|
144 | 144 | > true |
|
145 | 145 | > EOF |
|
146 | 146 | $ cat > $TESTTMP/checkeditform-n-cat.sh <<EOF |
|
147 | 147 | > env | grep HGEDITFORM |
|
148 | 148 | > cat \$* |
|
149 | 149 | > EOF |
|
150 | 150 | $ HGEDITOR="sh $TESTTMP/checkeditform-n-cat.sh" hg transplant --edit 7 |
|
151 | 151 | applying ffd6818a3975 |
|
152 | 152 | HGEDITFORM=transplant.normal |
|
153 | 153 | b3 |
|
154 | 154 | |
|
155 | 155 | |
|
156 | 156 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
157 | 157 | HG: Leave message empty to abort commit. |
|
158 | 158 | HG: -- |
|
159 | 159 | HG: user: test |
|
160 | 160 | HG: branch 'b4' |
|
161 | 161 | HG: added b3 |
|
162 | 162 | ffd6818a3975 transplanted to 502236fa76bb |
|
163 | 163 | |
|
164 | 164 | |
|
165 | 165 | $ hg log -r 'destination()' |
|
166 | 166 | changeset: 5:e234d668f844 |
|
167 | 167 | parent: 1:d11e3596cc1a |
|
168 | 168 | user: test |
|
169 | 169 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
170 | 170 | summary: b1 |
|
171 | 171 | |
|
172 | 172 | changeset: 6:539f377d78df |
|
173 | 173 | user: test |
|
174 | 174 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
175 | 175 | summary: b2 |
|
176 | 176 | |
|
177 | 177 | changeset: 7:ffd6818a3975 |
|
178 | 178 | user: test |
|
179 | 179 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
180 | 180 | summary: b3 |
|
181 | 181 | |
|
182 | 182 | changeset: 9:502236fa76bb |
|
183 | 183 | branch: b4 |
|
184 | 184 | tag: tip |
|
185 | 185 | user: test |
|
186 | 186 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
187 | 187 | summary: b3 |
|
188 | 188 | |
|
189 | 189 | $ hg log -r 'destination(a53251cdf717)' |
|
190 | 190 | changeset: 7:ffd6818a3975 |
|
191 | 191 | user: test |
|
192 | 192 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
193 | 193 | summary: b3 |
|
194 | 194 | |
|
195 | 195 | changeset: 9:502236fa76bb |
|
196 | 196 | branch: b4 |
|
197 | 197 | tag: tip |
|
198 | 198 | user: test |
|
199 | 199 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
200 | 200 | summary: b3 |
|
201 | 201 | |
|
202 | 202 | |
|
203 | 203 | test subset parameter in reverse order |
|
204 | 204 | $ hg log -r 'reverse(all()) and destination(a53251cdf717)' |
|
205 | 205 | changeset: 9:502236fa76bb |
|
206 | 206 | branch: b4 |
|
207 | 207 | tag: tip |
|
208 | 208 | user: test |
|
209 | 209 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
210 | 210 | summary: b3 |
|
211 | 211 | |
|
212 | 212 | changeset: 7:ffd6818a3975 |
|
213 | 213 | user: test |
|
214 | 214 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
215 | 215 | summary: b3 |
|
216 | 216 | |
|
217 | 217 | |
|
218 | 218 | back to the original dir |
|
219 | 219 | $ cd ../rebase |
|
220 | 220 | |
|
221 | 221 | rollback the transplant |
|
222 | 222 | $ hg rollback |
|
223 | 223 | repository tip rolled back to revision 4 (undo transplant) |
|
224 | 224 | working directory now based on revision 1 |
|
225 | 225 | $ hg tip -q |
|
226 | 226 | 4:a53251cdf717 |
|
227 | 227 | $ hg parents -q |
|
228 | 228 | 1:d11e3596cc1a |
|
229 | 229 | $ hg status |
|
230 | 230 | ? b1 |
|
231 | 231 | ? b2 |
|
232 | 232 | ? b3 |
|
233 | 233 | |
|
234 | 234 | $ hg clone ../t ../prune |
|
235 | 235 | updating to branch default |
|
236 | 236 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
237 | 237 | $ cd ../prune |
|
238 | 238 | |
|
239 | 239 | $ hg up -C 1 |
|
240 | 240 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
241 | 241 | |
|
242 | 242 | rebase b onto r1, skipping b2 |
|
243 | 243 | |
|
244 | 244 | $ hg transplant -a -b tip -p 3 |
|
245 | 245 | applying 37a1297eb21b |
|
246 | 246 | 37a1297eb21b transplanted to e234d668f844 |
|
247 | 247 | applying a53251cdf717 |
|
248 | 248 | a53251cdf717 transplanted to 7275fda4d04f |
|
249 | 249 | $ hg log --template '{rev} {parents} {desc}\n' |
|
250 | 250 | 6 b3 |
|
251 | 251 | 5 1:d11e3596cc1a b1 |
|
252 | 252 | 4 b3 |
|
253 | 253 | 3 b2 |
|
254 | 254 | 2 0:17ab29e464c6 b1 |
|
255 | 255 | 1 r2 |
|
256 | 256 | 0 r1 |
|
257 | 257 | |
|
258 | 258 | test same-parent transplant with --log |
|
259 | 259 | |
|
260 | 260 | $ hg clone -r 1 ../t ../sameparent |
|
261 | 261 | adding changesets |
|
262 | 262 | adding manifests |
|
263 | 263 | adding file changes |
|
264 | 264 | added 2 changesets with 2 changes to 2 files |
|
265 | 265 | updating to branch default |
|
266 | 266 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
267 | 267 | $ cd ../sameparent |
|
268 | 268 | $ hg transplant --log -s ../prune 5 |
|
269 | 269 | searching for changes |
|
270 | 270 | applying e234d668f844 |
|
271 | 271 | e234d668f844 transplanted to e07aea8ecf9c |
|
272 | 272 | $ hg log --template '{rev} {parents} {desc}\n' |
|
273 | 273 | 2 b1 |
|
274 | 274 | (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170) |
|
275 | 275 | 1 r2 |
|
276 | 276 | 0 r1 |
|
277 | 277 | remote transplant, and also test that transplant doesn't break with |
|
278 | 278 | format-breaking diffopts |
|
279 | 279 | |
|
280 | 280 | $ hg clone -r 1 ../t ../remote |
|
281 | 281 | adding changesets |
|
282 | 282 | adding manifests |
|
283 | 283 | adding file changes |
|
284 | 284 | added 2 changesets with 2 changes to 2 files |
|
285 | 285 | updating to branch default |
|
286 | 286 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
287 | 287 | $ cd ../remote |
|
288 | 288 | $ hg --config diff.noprefix=True transplant --log -s ../t 2 4 |
|
289 | 289 | searching for changes |
|
290 | 290 | applying 37a1297eb21b |
|
291 | 291 | 37a1297eb21b transplanted to c19cf0ccb069 |
|
292 | 292 | applying a53251cdf717 |
|
293 | 293 | a53251cdf717 transplanted to f7fe5bf98525 |
|
294 | 294 | $ hg log --template '{rev} {parents} {desc}\n' |
|
295 | 295 | 3 b3 |
|
296 | 296 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
297 | 297 | 2 b1 |
|
298 | 298 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
299 | 299 | 1 r2 |
|
300 | 300 | 0 r1 |
|
301 | 301 | |
|
302 | 302 | skip previous transplants |
|
303 | 303 | |
|
304 | 304 | $ hg transplant -s ../t -a -b 4 |
|
305 | 305 | searching for changes |
|
306 | 306 | applying 722f4667af76 |
|
307 | 307 | 722f4667af76 transplanted to 47156cd86c0b |
|
308 | 308 | $ hg log --template '{rev} {parents} {desc}\n' |
|
309 | 309 | 4 b2 |
|
310 | 310 | 3 b3 |
|
311 | 311 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
312 | 312 | 2 b1 |
|
313 | 313 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
314 | 314 | 1 r2 |
|
315 | 315 | 0 r1 |
|
316 | 316 | |
|
317 | 317 | skip local changes transplanted to the source |
|
318 | 318 | |
|
319 | 319 | $ echo b4 > b4 |
|
320 | 320 | $ hg ci -Amb4 -d '3 0' |
|
321 | 321 | adding b4 |
|
322 | 322 | $ hg clone ../t ../pullback |
|
323 | 323 | updating to branch default |
|
324 | 324 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
325 | 325 | $ cd ../pullback |
|
326 | 326 | $ hg transplant -s ../remote -a -b tip |
|
327 | 327 | searching for changes |
|
328 | 328 | applying 4333daefcb15 |
|
329 | 329 | 4333daefcb15 transplanted to 5f42c04e07cc |
|
330 | 330 | |
|
331 | 331 | |
|
332 | 332 | remote transplant with pull |
|
333 | 333 | |
|
334 | 334 | $ hg serve -R ../t -p $HGPORT -d --pid-file=../t.pid |
|
335 | 335 | $ cat ../t.pid >> $DAEMON_PIDS |
|
336 | 336 | |
|
337 | 337 | $ hg clone -r 0 ../t ../rp |
|
338 | 338 | adding changesets |
|
339 | 339 | adding manifests |
|
340 | 340 | adding file changes |
|
341 | 341 | added 1 changesets with 1 changes to 1 files |
|
342 | 342 | updating to branch default |
|
343 | 343 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
344 | 344 | $ cd ../rp |
|
345 | 345 | $ hg transplant -s http://localhost:$HGPORT/ 37a1297eb21b a53251cdf717 |
|
346 | 346 | searching for changes |
|
347 | 347 | searching for changes |
|
348 | 348 | adding changesets |
|
349 | 349 | adding manifests |
|
350 | 350 | adding file changes |
|
351 | 351 | added 1 changesets with 1 changes to 1 files |
|
352 | 352 | applying a53251cdf717 |
|
353 | 353 | a53251cdf717 transplanted to 8d9279348abb |
|
354 | 354 | $ hg log --template '{rev} {parents} {desc}\n' |
|
355 | 355 | 2 b3 |
|
356 | 356 | 1 b1 |
|
357 | 357 | 0 r1 |
|
358 | 358 | |
|
359 | 359 | remote transplant without pull |
|
360 | 360 | (It was using "2" and "4" (as the previous transplant used to) which referenced |
|
361 | 361 | revision different from one run to another) |
|
362 | 362 | |
|
363 | 363 | $ hg pull -q http://localhost:$HGPORT/ |
|
364 | 364 | $ hg transplant -s http://localhost:$HGPORT/ 8d9279348abb 722f4667af76 |
|
365 | 365 | skipping already applied revision 2:8d9279348abb |
|
366 | 366 | applying 722f4667af76 |
|
367 | 367 | 722f4667af76 transplanted to 76e321915884 |
|
368 | 368 | |
|
369 | 369 | transplant --continue |
|
370 | 370 | |
|
371 | 371 | $ hg init ../tc |
|
372 | 372 | $ cd ../tc |
|
373 | 373 | $ cat <<EOF > foo |
|
374 | 374 | > foo |
|
375 | 375 | > bar |
|
376 | 376 | > baz |
|
377 | 377 | > EOF |
|
378 | 378 | $ echo toremove > toremove |
|
379 | 379 | $ echo baz > baz |
|
380 | 380 | $ hg ci -Amfoo |
|
381 | 381 | adding baz |
|
382 | 382 | adding foo |
|
383 | 383 | adding toremove |
|
384 | 384 | $ cat <<EOF > foo |
|
385 | 385 | > foo2 |
|
386 | 386 | > bar2 |
|
387 | 387 | > baz2 |
|
388 | 388 | > EOF |
|
389 | 389 | $ rm toremove |
|
390 | 390 | $ echo added > added |
|
391 | 391 | $ hg ci -Amfoo2 |
|
392 | 392 | adding added |
|
393 | 393 | removing toremove |
|
394 | 394 | $ echo bar > bar |
|
395 | 395 | $ cat > baz <<EOF |
|
396 | 396 | > before baz |
|
397 | 397 | > baz |
|
398 | 398 | > after baz |
|
399 | 399 | > EOF |
|
400 | 400 | $ hg ci -Ambar |
|
401 | 401 | adding bar |
|
402 | 402 | $ echo bar2 >> bar |
|
403 | 403 | $ hg ci -mbar2 |
|
404 | 404 | $ hg up 0 |
|
405 | 405 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
406 | 406 | $ echo foobar > foo |
|
407 | 407 | $ hg ci -mfoobar |
|
408 | 408 | created new head |
|
409 | 409 | $ hg transplant 1:3 |
|
410 | 410 | applying 46ae92138f3c |
|
411 | 411 | patching file foo |
|
412 | 412 | Hunk #1 FAILED at 0 |
|
413 | 413 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
414 | 414 | patch failed to apply |
|
415 | 415 | abort: fix up the working directory and run hg transplant --continue |
|
416 | 416 | [255] |
|
417 | 417 | |
|
418 | 418 | transplant -c shouldn't use an old changeset |
|
419 | 419 | |
|
420 | 420 | $ hg up -C |
|
421 | 421 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
422 | updated to "e8643552fde5: foobar" | |
|
422 | 423 | 1 other heads for branch "default" |
|
423 | 424 | $ rm added |
|
424 | 425 | $ hg transplant --continue |
|
425 | 426 | abort: no transplant to continue |
|
426 | 427 | [255] |
|
427 | 428 | $ hg transplant 1 |
|
428 | 429 | applying 46ae92138f3c |
|
429 | 430 | patching file foo |
|
430 | 431 | Hunk #1 FAILED at 0 |
|
431 | 432 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
432 | 433 | patch failed to apply |
|
433 | 434 | abort: fix up the working directory and run hg transplant --continue |
|
434 | 435 | [255] |
|
435 | 436 | $ cp .hg/transplant/journal .hg/transplant/journal.orig |
|
436 | 437 | $ cat .hg/transplant/journal |
|
437 | 438 | # User test |
|
438 | 439 | # Date 0 0 |
|
439 | 440 | # Node ID 46ae92138f3ce0249f6789650403286ead052b6d |
|
440 | 441 | # Parent e8643552fde58f57515e19c4b373a57c96e62af3 |
|
441 | 442 | foo2 |
|
442 | 443 | $ grep -v 'Date' .hg/transplant/journal.orig > .hg/transplant/journal |
|
443 | 444 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e |
|
444 | 445 | abort: filter corrupted changeset (no user or date) |
|
445 | 446 | [255] |
|
446 | 447 | $ cp .hg/transplant/journal.orig .hg/transplant/journal |
|
447 | 448 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e |
|
448 | 449 | HGEDITFORM=transplant.normal |
|
449 | 450 | 46ae92138f3c transplanted as 9159dada197d |
|
450 | 451 | $ hg transplant 1:3 |
|
451 | 452 | skipping already applied revision 1:46ae92138f3c |
|
452 | 453 | applying 9d6d6b5a8275 |
|
453 | 454 | 9d6d6b5a8275 transplanted to 2d17a10c922f |
|
454 | 455 | applying 1dab759070cf |
|
455 | 456 | 1dab759070cf transplanted to e06a69927eb0 |
|
456 | 457 | $ hg locate |
|
457 | 458 | added |
|
458 | 459 | bar |
|
459 | 460 | baz |
|
460 | 461 | foo |
|
461 | 462 | |
|
462 | 463 | test multiple revisions and --continue |
|
463 | 464 | |
|
464 | 465 | $ hg up -qC 0 |
|
465 | 466 | $ echo bazbaz > baz |
|
466 | 467 | $ hg ci -Am anotherbaz baz |
|
467 | 468 | created new head |
|
468 | 469 | $ hg transplant 1:3 |
|
469 | 470 | applying 46ae92138f3c |
|
470 | 471 | 46ae92138f3c transplanted to 1024233ea0ba |
|
471 | 472 | applying 9d6d6b5a8275 |
|
472 | 473 | patching file baz |
|
473 | 474 | Hunk #1 FAILED at 0 |
|
474 | 475 | 1 out of 1 hunks FAILED -- saving rejects to file baz.rej |
|
475 | 476 | patch failed to apply |
|
476 | 477 | abort: fix up the working directory and run hg transplant --continue |
|
477 | 478 | [255] |
|
478 | 479 | $ hg transplant 1:3 |
|
479 | 480 | abort: transplant in progress |
|
480 | 481 | (use 'hg transplant --continue' or 'hg update' to abort) |
|
481 | 482 | [255] |
|
482 | 483 | $ echo fixed > baz |
|
483 | 484 | $ hg transplant --continue |
|
484 | 485 | 9d6d6b5a8275 transplanted as d80c49962290 |
|
485 | 486 | applying 1dab759070cf |
|
486 | 487 | 1dab759070cf transplanted to aa0ffe6bd5ae |
|
487 | 488 | |
|
488 | 489 | $ cd .. |
|
489 | 490 | |
|
490 | 491 | Issue1111: Test transplant --merge |
|
491 | 492 | |
|
492 | 493 | $ hg init t1111 |
|
493 | 494 | $ cd t1111 |
|
494 | 495 | $ echo a > a |
|
495 | 496 | $ hg ci -Am adda |
|
496 | 497 | adding a |
|
497 | 498 | $ echo b >> a |
|
498 | 499 | $ hg ci -m appendb |
|
499 | 500 | $ echo c >> a |
|
500 | 501 | $ hg ci -m appendc |
|
501 | 502 | $ hg up -C 0 |
|
502 | 503 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
503 | 504 | $ echo d >> a |
|
504 | 505 | $ hg ci -m appendd |
|
505 | 506 | created new head |
|
506 | 507 | |
|
507 | 508 | transplant |
|
508 | 509 | |
|
509 | 510 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e |
|
510 | 511 | applying 42dc4432fd35 |
|
511 | 512 | HGEDITFORM=transplant.merge |
|
512 | 513 | 1:42dc4432fd35 merged at a9f4acbac129 |
|
513 | 514 | $ hg update -q -C 2 |
|
514 | 515 | $ cat > a <<EOF |
|
515 | 516 | > x |
|
516 | 517 | > y |
|
517 | 518 | > z |
|
518 | 519 | > EOF |
|
519 | 520 | $ hg commit -m replace |
|
520 | 521 | $ hg update -q -C 4 |
|
521 | 522 | $ hg transplant -m 5 |
|
522 | 523 | applying 600a3cdcb41d |
|
523 | 524 | patching file a |
|
524 | 525 | Hunk #1 FAILED at 0 |
|
525 | 526 | 1 out of 1 hunks FAILED -- saving rejects to file a.rej |
|
526 | 527 | patch failed to apply |
|
527 | 528 | abort: fix up the working directory and run hg transplant --continue |
|
528 | 529 | [255] |
|
529 | 530 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e |
|
530 | 531 | HGEDITFORM=transplant.merge |
|
531 | 532 | 600a3cdcb41d transplanted as a3f88be652e0 |
|
532 | 533 | |
|
533 | 534 | $ cd .. |
|
534 | 535 | |
|
535 | 536 | test transplant into empty repository |
|
536 | 537 | |
|
537 | 538 | $ hg init empty |
|
538 | 539 | $ cd empty |
|
539 | 540 | $ hg transplant -s ../t -b tip -a |
|
540 | 541 | adding changesets |
|
541 | 542 | adding manifests |
|
542 | 543 | adding file changes |
|
543 | 544 | added 4 changesets with 4 changes to 4 files |
|
544 | 545 | |
|
545 | 546 | test "--merge" causing pull from source repository on local host |
|
546 | 547 | |
|
547 | 548 | $ hg --config extensions.mq= -q strip 2 |
|
548 | 549 | $ hg transplant -s ../t --merge tip |
|
549 | 550 | searching for changes |
|
550 | 551 | searching for changes |
|
551 | 552 | adding changesets |
|
552 | 553 | adding manifests |
|
553 | 554 | adding file changes |
|
554 | 555 | added 2 changesets with 2 changes to 2 files |
|
555 | 556 | applying a53251cdf717 |
|
556 | 557 | 4:a53251cdf717 merged at 4831f4dc831a |
|
557 | 558 | |
|
558 | 559 | test interactive transplant |
|
559 | 560 | |
|
560 | 561 | $ hg --config extensions.strip= -q strip 0 |
|
561 | 562 | $ hg -R ../t log -G --template "{rev}:{node|short}" |
|
562 | 563 | @ 4:a53251cdf717 |
|
563 | 564 | | |
|
564 | 565 | o 3:722f4667af76 |
|
565 | 566 | | |
|
566 | 567 | o 2:37a1297eb21b |
|
567 | 568 | | |
|
568 | 569 | | o 1:d11e3596cc1a |
|
569 | 570 | |/ |
|
570 | 571 | o 0:17ab29e464c6 |
|
571 | 572 | |
|
572 | 573 | $ hg transplant -q --config ui.interactive=true -s ../t <<EOF |
|
573 | 574 | > ? |
|
574 | 575 | > x |
|
575 | 576 | > q |
|
576 | 577 | > EOF |
|
577 | 578 | 0:17ab29e464c6 |
|
578 | 579 | apply changeset? [ynmpcq?]: ? |
|
579 | 580 | y: yes, transplant this changeset |
|
580 | 581 | n: no, skip this changeset |
|
581 | 582 | m: merge at this changeset |
|
582 | 583 | p: show patch |
|
583 | 584 | c: commit selected changesets |
|
584 | 585 | q: quit and cancel transplant |
|
585 | 586 | ?: ? (show this help) |
|
586 | 587 | apply changeset? [ynmpcq?]: x |
|
587 | 588 | unrecognized response |
|
588 | 589 | apply changeset? [ynmpcq?]: q |
|
589 | 590 | $ hg transplant -q --config ui.interactive=true -s ../t <<EOF |
|
590 | 591 | > p |
|
591 | 592 | > y |
|
592 | 593 | > n |
|
593 | 594 | > n |
|
594 | 595 | > m |
|
595 | 596 | > c |
|
596 | 597 | > EOF |
|
597 | 598 | 0:17ab29e464c6 |
|
598 | 599 | apply changeset? [ynmpcq?]: p |
|
599 | 600 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
600 | 601 | +++ b/r1 Thu Jan 01 00:00:00 1970 +0000 |
|
601 | 602 | @@ -0,0 +1,1 @@ |
|
602 | 603 | +r1 |
|
603 | 604 | apply changeset? [ynmpcq?]: y |
|
604 | 605 | 1:d11e3596cc1a |
|
605 | 606 | apply changeset? [ynmpcq?]: n |
|
606 | 607 | 2:37a1297eb21b |
|
607 | 608 | apply changeset? [ynmpcq?]: n |
|
608 | 609 | 3:722f4667af76 |
|
609 | 610 | apply changeset? [ynmpcq?]: m |
|
610 | 611 | 4:a53251cdf717 |
|
611 | 612 | apply changeset? [ynmpcq?]: c |
|
612 | 613 | $ hg log -G --template "{node|short}" |
|
613 | 614 | @ 88be5dde5260 |
|
614 | 615 | |\ |
|
615 | 616 | | o 722f4667af76 |
|
616 | 617 | | | |
|
617 | 618 | | o 37a1297eb21b |
|
618 | 619 | |/ |
|
619 | 620 | o 17ab29e464c6 |
|
620 | 621 | |
|
621 | 622 | $ hg transplant -q --config ui.interactive=true -s ../t <<EOF |
|
622 | 623 | > x |
|
623 | 624 | > ? |
|
624 | 625 | > y |
|
625 | 626 | > q |
|
626 | 627 | > EOF |
|
627 | 628 | 1:d11e3596cc1a |
|
628 | 629 | apply changeset? [ynmpcq?]: x |
|
629 | 630 | unrecognized response |
|
630 | 631 | apply changeset? [ynmpcq?]: ? |
|
631 | 632 | y: yes, transplant this changeset |
|
632 | 633 | n: no, skip this changeset |
|
633 | 634 | m: merge at this changeset |
|
634 | 635 | p: show patch |
|
635 | 636 | c: commit selected changesets |
|
636 | 637 | q: quit and cancel transplant |
|
637 | 638 | ?: ? (show this help) |
|
638 | 639 | apply changeset? [ynmpcq?]: y |
|
639 | 640 | 4:a53251cdf717 |
|
640 | 641 | apply changeset? [ynmpcq?]: q |
|
641 | 642 | $ hg heads --template "{node|short}\n" |
|
642 | 643 | 88be5dde5260 |
|
643 | 644 | |
|
644 | 645 | $ cd .. |
|
645 | 646 | |
|
646 | 647 | |
|
647 | 648 | #if unix-permissions system-sh |
|
648 | 649 | |
|
649 | 650 | test filter |
|
650 | 651 | |
|
651 | 652 | $ hg init filter |
|
652 | 653 | $ cd filter |
|
653 | 654 | $ cat <<'EOF' >test-filter |
|
654 | 655 | > #!/bin/sh |
|
655 | 656 | > sed 's/r1/r2/' $1 > $1.new |
|
656 | 657 | > mv $1.new $1 |
|
657 | 658 | > EOF |
|
658 | 659 | $ chmod +x test-filter |
|
659 | 660 | $ hg transplant -s ../t -b tip -a --filter ./test-filter |
|
660 | 661 | filtering * (glob) |
|
661 | 662 | applying 17ab29e464c6 |
|
662 | 663 | 17ab29e464c6 transplanted to e9ffc54ea104 |
|
663 | 664 | filtering * (glob) |
|
664 | 665 | applying 37a1297eb21b |
|
665 | 666 | 37a1297eb21b transplanted to 348b36d0b6a5 |
|
666 | 667 | filtering * (glob) |
|
667 | 668 | applying 722f4667af76 |
|
668 | 669 | 722f4667af76 transplanted to 0aa6979afb95 |
|
669 | 670 | filtering * (glob) |
|
670 | 671 | applying a53251cdf717 |
|
671 | 672 | a53251cdf717 transplanted to 14f8512272b5 |
|
672 | 673 | $ hg log --template '{rev} {parents} {desc}\n' |
|
673 | 674 | 3 b3 |
|
674 | 675 | 2 b2 |
|
675 | 676 | 1 b1 |
|
676 | 677 | 0 r2 |
|
677 | 678 | $ cd .. |
|
678 | 679 | |
|
679 | 680 | |
|
680 | 681 | test filter with failed patch |
|
681 | 682 | |
|
682 | 683 | $ cd filter |
|
683 | 684 | $ hg up 0 |
|
684 | 685 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
685 | 686 | $ echo foo > b1 |
|
686 | 687 | $ hg ci -Am foo |
|
687 | 688 | adding b1 |
|
688 | 689 | adding test-filter |
|
689 | 690 | created new head |
|
690 | 691 | $ hg transplant 1 --filter ./test-filter |
|
691 | 692 | filtering * (glob) |
|
692 | 693 | applying 348b36d0b6a5 |
|
693 | 694 | file b1 already exists |
|
694 | 695 | 1 out of 1 hunks FAILED -- saving rejects to file b1.rej |
|
695 | 696 | patch failed to apply |
|
696 | 697 | abort: fix up the working directory and run hg transplant --continue |
|
697 | 698 | [255] |
|
698 | 699 | $ cd .. |
|
699 | 700 | |
|
700 | 701 | test environment passed to filter |
|
701 | 702 | |
|
702 | 703 | $ hg init filter-environment |
|
703 | 704 | $ cd filter-environment |
|
704 | 705 | $ cat <<'EOF' >test-filter-environment |
|
705 | 706 | > #!/bin/sh |
|
706 | 707 | > echo "Transplant by $HGUSER" >> $1 |
|
707 | 708 | > echo "Transplant from rev $HGREVISION" >> $1 |
|
708 | 709 | > EOF |
|
709 | 710 | $ chmod +x test-filter-environment |
|
710 | 711 | $ hg transplant -s ../t --filter ./test-filter-environment 0 |
|
711 | 712 | filtering * (glob) |
|
712 | 713 | applying 17ab29e464c6 |
|
713 | 714 | 17ab29e464c6 transplanted to 5190e68026a0 |
|
714 | 715 | |
|
715 | 716 | $ hg log --template '{rev} {parents} {desc}\n' |
|
716 | 717 | 0 r1 |
|
717 | 718 | Transplant by test |
|
718 | 719 | Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f |
|
719 | 720 | $ cd .. |
|
720 | 721 | |
|
721 | 722 | test transplant with filter handles invalid changelog |
|
722 | 723 | |
|
723 | 724 | $ hg init filter-invalid-log |
|
724 | 725 | $ cd filter-invalid-log |
|
725 | 726 | $ cat <<'EOF' >test-filter-invalid-log |
|
726 | 727 | > #!/bin/sh |
|
727 | 728 | > echo "" > $1 |
|
728 | 729 | > EOF |
|
729 | 730 | $ chmod +x test-filter-invalid-log |
|
730 | 731 | $ hg transplant -s ../t --filter ./test-filter-invalid-log 0 |
|
731 | 732 | filtering * (glob) |
|
732 | 733 | abort: filter corrupted changeset (no user or date) |
|
733 | 734 | [255] |
|
734 | 735 | $ cd .. |
|
735 | 736 | |
|
736 | 737 | #endif |
|
737 | 738 | |
|
738 | 739 | |
|
739 | 740 | test with a win32ext like setup (differing EOLs) |
|
740 | 741 | |
|
741 | 742 | $ hg init twin1 |
|
742 | 743 | $ cd twin1 |
|
743 | 744 | $ echo a > a |
|
744 | 745 | $ echo b > b |
|
745 | 746 | $ echo b >> b |
|
746 | 747 | $ hg ci -Am t |
|
747 | 748 | adding a |
|
748 | 749 | adding b |
|
749 | 750 | $ echo a > b |
|
750 | 751 | $ echo b >> b |
|
751 | 752 | $ hg ci -m changeb |
|
752 | 753 | $ cd .. |
|
753 | 754 | |
|
754 | 755 | $ hg init twin2 |
|
755 | 756 | $ cd twin2 |
|
756 | 757 | $ echo '[patch]' >> .hg/hgrc |
|
757 | 758 | $ echo 'eol = crlf' >> .hg/hgrc |
|
758 | 759 | $ $PYTHON -c "file('b', 'wb').write('b\r\nb\r\n')" |
|
759 | 760 | $ hg ci -Am addb |
|
760 | 761 | adding b |
|
761 | 762 | $ hg transplant -s ../twin1 tip |
|
762 | 763 | searching for changes |
|
763 | 764 | warning: repository is unrelated |
|
764 | 765 | applying 2e849d776c17 |
|
765 | 766 | 2e849d776c17 transplanted to 8e65bebc063e |
|
766 | 767 | $ cat b |
|
767 | 768 | a\r (esc) |
|
768 | 769 | b\r (esc) |
|
769 | 770 | $ cd .. |
|
770 | 771 | |
|
771 | 772 | test transplant with merge changeset is skipped |
|
772 | 773 | |
|
773 | 774 | $ hg init merge1a |
|
774 | 775 | $ cd merge1a |
|
775 | 776 | $ echo a > a |
|
776 | 777 | $ hg ci -Am a |
|
777 | 778 | adding a |
|
778 | 779 | $ hg branch b |
|
779 | 780 | marked working directory as branch b |
|
780 | 781 | (branches are permanent and global, did you want a bookmark?) |
|
781 | 782 | $ hg ci -m branchb |
|
782 | 783 | $ echo b > b |
|
783 | 784 | $ hg ci -Am b |
|
784 | 785 | adding b |
|
785 | 786 | $ hg update default |
|
786 | 787 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
787 | 788 | $ hg merge b |
|
788 | 789 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
789 | 790 | (branch merge, don't forget to commit) |
|
790 | 791 | $ hg ci -m mergeb |
|
791 | 792 | $ cd .. |
|
792 | 793 | |
|
793 | 794 | $ hg init merge1b |
|
794 | 795 | $ cd merge1b |
|
795 | 796 | $ hg transplant -s ../merge1a tip |
|
796 | 797 | $ cd .. |
|
797 | 798 | |
|
798 | 799 | test transplant with merge changeset accepts --parent |
|
799 | 800 | |
|
800 | 801 | $ hg init merge2a |
|
801 | 802 | $ cd merge2a |
|
802 | 803 | $ echo a > a |
|
803 | 804 | $ hg ci -Am a |
|
804 | 805 | adding a |
|
805 | 806 | $ hg branch b |
|
806 | 807 | marked working directory as branch b |
|
807 | 808 | (branches are permanent and global, did you want a bookmark?) |
|
808 | 809 | $ hg ci -m branchb |
|
809 | 810 | $ echo b > b |
|
810 | 811 | $ hg ci -Am b |
|
811 | 812 | adding b |
|
812 | 813 | $ hg update default |
|
813 | 814 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
814 | 815 | $ hg merge b |
|
815 | 816 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
816 | 817 | (branch merge, don't forget to commit) |
|
817 | 818 | $ hg ci -m mergeb |
|
818 | 819 | $ cd .. |
|
819 | 820 | |
|
820 | 821 | $ hg init merge2b |
|
821 | 822 | $ cd merge2b |
|
822 | 823 | $ hg transplant -s ../merge2a --parent tip tip |
|
823 | 824 | abort: be9f9b39483f is not a parent of be9f9b39483f |
|
824 | 825 | [255] |
|
825 | 826 | $ hg transplant -s ../merge2a --parent 0 tip |
|
826 | 827 | applying be9f9b39483f |
|
827 | 828 | be9f9b39483f transplanted to 9959e51f94d1 |
|
828 | 829 | $ cd .. |
|
829 | 830 | |
|
830 | 831 | test transplanting a patch turning into a no-op |
|
831 | 832 | |
|
832 | 833 | $ hg init binarysource |
|
833 | 834 | $ cd binarysource |
|
834 | 835 | $ echo a > a |
|
835 | 836 | $ hg ci -Am adda a |
|
836 | 837 | >>> file('b', 'wb').write('\0b1') |
|
837 | 838 | $ hg ci -Am addb b |
|
838 | 839 | >>> file('b', 'wb').write('\0b2') |
|
839 | 840 | $ hg ci -m changeb b |
|
840 | 841 | $ cd .. |
|
841 | 842 | |
|
842 | 843 | $ hg clone -r0 binarysource binarydest |
|
843 | 844 | adding changesets |
|
844 | 845 | adding manifests |
|
845 | 846 | adding file changes |
|
846 | 847 | added 1 changesets with 1 changes to 1 files |
|
847 | 848 | updating to branch default |
|
848 | 849 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
849 | 850 | $ cd binarydest |
|
850 | 851 | $ cp ../binarysource/b b |
|
851 | 852 | $ hg ci -Am addb2 b |
|
852 | 853 | $ hg transplant -s ../binarysource 2 |
|
853 | 854 | searching for changes |
|
854 | 855 | applying 7a7d57e15850 |
|
855 | 856 | skipping emptied changeset 7a7d57e15850 |
|
856 | 857 | |
|
857 | 858 | Test empty result in --continue |
|
858 | 859 | |
|
859 | 860 | $ hg transplant -s ../binarysource 1 |
|
860 | 861 | searching for changes |
|
861 | 862 | applying 645035761929 |
|
862 | 863 | file b already exists |
|
863 | 864 | 1 out of 1 hunks FAILED -- saving rejects to file b.rej |
|
864 | 865 | patch failed to apply |
|
865 | 866 | abort: fix up the working directory and run hg transplant --continue |
|
866 | 867 | [255] |
|
867 | 868 | $ hg status |
|
868 | 869 | ? b.rej |
|
869 | 870 | $ hg transplant --continue |
|
870 | 871 | 645035761929 skipped due to empty diff |
|
871 | 872 | |
|
872 | 873 | $ cd .. |
|
873 | 874 | |
|
874 | 875 | Explicitly kill daemons to let the test exit on Windows |
|
875 | 876 | |
|
876 | 877 | $ killdaemons.py |
|
877 | 878 | |
|
878 | 879 | Test that patch-ed files are treated as "modified", when transplant is |
|
879 | 880 | aborted by failure of patching, even if none of mode, size and |
|
880 | 881 | timestamp of them isn't changed on the filesystem (see also issue4583) |
|
881 | 882 | |
|
882 | 883 | $ cd t |
|
883 | 884 | |
|
884 | 885 | $ cat > $TESTTMP/abort.py <<EOF |
|
885 | 886 | > # emulate that patch.patch() is aborted at patching on "abort" file |
|
886 | 887 | > from mercurial import extensions, patch as patchmod |
|
887 | 888 | > def patch(orig, ui, repo, patchname, |
|
888 | 889 | > strip=1, prefix='', files=None, |
|
889 | 890 | > eolmode='strict', similarity=0): |
|
890 | 891 | > if files is None: |
|
891 | 892 | > files = set() |
|
892 | 893 | > r = orig(ui, repo, patchname, |
|
893 | 894 | > strip=strip, prefix=prefix, files=files, |
|
894 | 895 | > eolmode=eolmode, similarity=similarity) |
|
895 | 896 | > if 'abort' in files: |
|
896 | 897 | > raise patchmod.PatchError('intentional error while patching') |
|
897 | 898 | > return r |
|
898 | 899 | > def extsetup(ui): |
|
899 | 900 | > extensions.wrapfunction(patchmod, 'patch', patch) |
|
900 | 901 | > EOF |
|
901 | 902 | |
|
902 | 903 | $ echo X1 > r1 |
|
903 | 904 | $ hg diff --nodates r1 |
|
904 | 905 | diff -r a53251cdf717 r1 |
|
905 | 906 | --- a/r1 |
|
906 | 907 | +++ b/r1 |
|
907 | 908 | @@ -1,1 +1,1 @@ |
|
908 | 909 | -r1 |
|
909 | 910 | +X1 |
|
910 | 911 | $ hg commit -m "X1 as r1" |
|
911 | 912 | |
|
912 | 913 | $ echo 'marking to abort patching' > abort |
|
913 | 914 | $ hg add abort |
|
914 | 915 | $ echo Y1 > r1 |
|
915 | 916 | $ hg diff --nodates r1 |
|
916 | 917 | diff -r 22c515968f13 r1 |
|
917 | 918 | --- a/r1 |
|
918 | 919 | +++ b/r1 |
|
919 | 920 | @@ -1,1 +1,1 @@ |
|
920 | 921 | -X1 |
|
921 | 922 | +Y1 |
|
922 | 923 | $ hg commit -m "Y1 as r1" |
|
923 | 924 | |
|
924 | 925 | $ hg update -q -C d11e3596cc1a |
|
925 | 926 | $ cat r1 |
|
926 | 927 | r1 |
|
927 | 928 | |
|
928 | 929 | $ cat >> .hg/hgrc <<EOF |
|
929 | 930 | > [fakedirstatewritetime] |
|
930 | 931 | > # emulate invoking dirstate.write() via repo.status() or markcommitted() |
|
931 | 932 | > # at 2000-01-01 00:00 |
|
932 | 933 | > fakenow = 200001010000 |
|
933 | 934 | > |
|
934 | 935 | > # emulate invoking patch.internalpatch() at 2000-01-01 00:00 |
|
935 | 936 | > [fakepatchtime] |
|
936 | 937 | > fakenow = 200001010000 |
|
937 | 938 | > |
|
938 | 939 | > [extensions] |
|
939 | 940 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
940 | 941 | > fakepatchtime = $TESTDIR/fakepatchtime.py |
|
941 | 942 | > abort = $TESTTMP/abort.py |
|
942 | 943 | > EOF |
|
943 | 944 | $ hg transplant "22c515968f13::" |
|
944 | 945 | applying 22c515968f13 |
|
945 | 946 | 22c515968f13 transplanted to * (glob) |
|
946 | 947 | applying e38700ba9dd3 |
|
947 | 948 | intentional error while patching |
|
948 | 949 | abort: fix up the working directory and run hg transplant --continue |
|
949 | 950 | [255] |
|
950 | 951 | $ cat >> .hg/hgrc <<EOF |
|
951 | 952 | > [hooks] |
|
952 | 953 | > fakedirstatewritetime = ! |
|
953 | 954 | > fakepatchtime = ! |
|
954 | 955 | > [extensions] |
|
955 | 956 | > abort = ! |
|
956 | 957 | > EOF |
|
957 | 958 | |
|
958 | 959 | $ cat r1 |
|
959 | 960 | Y1 |
|
960 | 961 | $ hg debugstate | grep ' r1$' |
|
961 | 962 | n 644 3 unset r1 |
|
962 | 963 | $ hg status -A r1 |
|
963 | 964 | M r1 |
|
964 | 965 | |
|
965 | 966 | Test that rollback by unexpected failure after transplanting the first |
|
966 | 967 | revision restores dirstate correctly. |
|
967 | 968 | |
|
968 | 969 | $ hg rollback -q |
|
969 | 970 | $ rm -f abort |
|
970 | 971 | $ hg update -q -C d11e3596cc1a |
|
971 | 972 | $ hg parents -T "{node|short}\n" |
|
972 | 973 | d11e3596cc1a |
|
973 | 974 | $ hg status -A |
|
974 | 975 | C r1 |
|
975 | 976 | C r2 |
|
976 | 977 | |
|
977 | 978 | $ cat >> .hg/hgrc <<EOF |
|
978 | 979 | > [hooks] |
|
979 | 980 | > # emulate failure at transplanting the 2nd revision |
|
980 | 981 | > pretxncommit.abort = test ! -f abort |
|
981 | 982 | > EOF |
|
982 | 983 | $ hg transplant "22c515968f13::" |
|
983 | 984 | applying 22c515968f13 |
|
984 | 985 | 22c515968f13 transplanted to * (glob) |
|
985 | 986 | applying e38700ba9dd3 |
|
986 | 987 | transaction abort! |
|
987 | 988 | rollback completed |
|
988 | 989 | abort: pretxncommit.abort hook exited with status 1 |
|
989 | 990 | [255] |
|
990 | 991 | $ cat >> .hg/hgrc <<EOF |
|
991 | 992 | > [hooks] |
|
992 | 993 | > pretxncommit.abort = ! |
|
993 | 994 | > EOF |
|
994 | 995 | |
|
995 | 996 | $ hg parents -T "{node|short}\n" |
|
996 | 997 | d11e3596cc1a |
|
997 | 998 | $ hg status -A |
|
998 | 999 | M r1 |
|
999 | 1000 | ? abort |
|
1000 | 1001 | C r2 |
|
1001 | 1002 | |
|
1002 | 1003 | $ cd .. |
@@ -1,252 +1,253 | |||
|
1 | 1 | $ HGMERGE=true; export HGMERGE |
|
2 | 2 | |
|
3 | 3 | $ hg init r1 |
|
4 | 4 | $ cd r1 |
|
5 | 5 | $ echo a > a |
|
6 | 6 | $ hg addremove |
|
7 | 7 | adding a |
|
8 | 8 | $ hg commit -m "1" |
|
9 | 9 | |
|
10 | 10 | $ hg clone . ../r2 |
|
11 | 11 | updating to branch default |
|
12 | 12 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
13 | 13 | $ cd ../r2 |
|
14 | 14 | $ hg up |
|
15 | 15 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
16 | 16 | $ echo abc > a |
|
17 | 17 | $ hg diff --nodates |
|
18 | 18 | diff -r c19d34741b0a a |
|
19 | 19 | --- a/a |
|
20 | 20 | +++ b/a |
|
21 | 21 | @@ -1,1 +1,1 @@ |
|
22 | 22 | -a |
|
23 | 23 | +abc |
|
24 | 24 | |
|
25 | 25 | $ cd ../r1 |
|
26 | 26 | $ echo b > b |
|
27 | 27 | $ echo a2 > a |
|
28 | 28 | $ hg addremove |
|
29 | 29 | adding b |
|
30 | 30 | $ hg commit -m "2" |
|
31 | 31 | |
|
32 | 32 | $ cd ../r2 |
|
33 | 33 | $ hg -q pull ../r1 |
|
34 | 34 | $ hg status |
|
35 | 35 | M a |
|
36 | 36 | $ hg parents |
|
37 | 37 | changeset: 0:c19d34741b0a |
|
38 | 38 | user: test |
|
39 | 39 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | summary: 1 |
|
41 | 41 | |
|
42 | 42 | $ hg --debug up |
|
43 | 43 | searching for copies back to rev 1 |
|
44 | 44 | unmatched files in other: |
|
45 | 45 | b |
|
46 | 46 | resolving manifests |
|
47 | 47 | branchmerge: False, force: False, partial: False |
|
48 | 48 | ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb |
|
49 | 49 | preserving a for resolve of a |
|
50 | 50 | b: remote created -> g |
|
51 | 51 | getting b |
|
52 | 52 | a: versions differ -> m (premerge) |
|
53 | 53 | picked tool 'true' for a (binary False symlink False changedelete False) |
|
54 | 54 | merging a |
|
55 | 55 | my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a |
|
56 | 56 | a: versions differ -> m (merge) |
|
57 | 57 | picked tool 'true' for a (binary False symlink False changedelete False) |
|
58 | 58 | my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a |
|
59 | 59 | launching merge tool: true *$TESTTMP/r2/a* * * (glob) |
|
60 | 60 | merge tool returned: 0 |
|
61 | 61 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
62 | 62 | $ hg parents |
|
63 | 63 | changeset: 1:1e71731e6fbb |
|
64 | 64 | tag: tip |
|
65 | 65 | user: test |
|
66 | 66 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
67 | 67 | summary: 2 |
|
68 | 68 | |
|
69 | 69 | $ hg --debug up 0 |
|
70 | 70 | starting 4 threads for background file closing (?) |
|
71 | 71 | searching for copies back to rev 0 |
|
72 | 72 | unmatched files in local (from topological common ancestor): |
|
73 | 73 | b |
|
74 | 74 | resolving manifests |
|
75 | 75 | branchmerge: False, force: False, partial: False |
|
76 | 76 | ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a |
|
77 | 77 | preserving a for resolve of a |
|
78 | 78 | b: other deleted -> r |
|
79 | 79 | removing b |
|
80 | 80 | starting 4 threads for background file closing (?) |
|
81 | 81 | a: versions differ -> m (premerge) |
|
82 | 82 | picked tool 'true' for a (binary False symlink False changedelete False) |
|
83 | 83 | merging a |
|
84 | 84 | my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb |
|
85 | 85 | a: versions differ -> m (merge) |
|
86 | 86 | picked tool 'true' for a (binary False symlink False changedelete False) |
|
87 | 87 | my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb |
|
88 | 88 | launching merge tool: true *$TESTTMP/r2/a* * * (glob) |
|
89 | 89 | merge tool returned: 0 |
|
90 | 90 | 0 files updated, 1 files merged, 1 files removed, 0 files unresolved |
|
91 | 91 | $ hg parents |
|
92 | 92 | changeset: 0:c19d34741b0a |
|
93 | 93 | user: test |
|
94 | 94 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
95 | 95 | summary: 1 |
|
96 | 96 | |
|
97 | 97 | $ hg --debug up |
|
98 | 98 | searching for copies back to rev 1 |
|
99 | 99 | unmatched files in other: |
|
100 | 100 | b |
|
101 | 101 | resolving manifests |
|
102 | 102 | branchmerge: False, force: False, partial: False |
|
103 | 103 | ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb |
|
104 | 104 | preserving a for resolve of a |
|
105 | 105 | b: remote created -> g |
|
106 | 106 | getting b |
|
107 | 107 | a: versions differ -> m (premerge) |
|
108 | 108 | picked tool 'true' for a (binary False symlink False changedelete False) |
|
109 | 109 | merging a |
|
110 | 110 | my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a |
|
111 | 111 | a: versions differ -> m (merge) |
|
112 | 112 | picked tool 'true' for a (binary False symlink False changedelete False) |
|
113 | 113 | my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a |
|
114 | 114 | launching merge tool: true *$TESTTMP/r2/a* * * (glob) |
|
115 | 115 | merge tool returned: 0 |
|
116 | 116 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
117 | 117 | $ hg parents |
|
118 | 118 | changeset: 1:1e71731e6fbb |
|
119 | 119 | tag: tip |
|
120 | 120 | user: test |
|
121 | 121 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
122 | 122 | summary: 2 |
|
123 | 123 | |
|
124 | 124 | $ hg -v history |
|
125 | 125 | changeset: 1:1e71731e6fbb |
|
126 | 126 | tag: tip |
|
127 | 127 | user: test |
|
128 | 128 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
129 | 129 | files: a b |
|
130 | 130 | description: |
|
131 | 131 | 2 |
|
132 | 132 | |
|
133 | 133 | |
|
134 | 134 | changeset: 0:c19d34741b0a |
|
135 | 135 | user: test |
|
136 | 136 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
137 | 137 | files: a |
|
138 | 138 | description: |
|
139 | 139 | 1 |
|
140 | 140 | |
|
141 | 141 | |
|
142 | 142 | $ hg diff --nodates |
|
143 | 143 | diff -r 1e71731e6fbb a |
|
144 | 144 | --- a/a |
|
145 | 145 | +++ b/a |
|
146 | 146 | @@ -1,1 +1,1 @@ |
|
147 | 147 | -a2 |
|
148 | 148 | +abc |
|
149 | 149 | |
|
150 | 150 | |
|
151 | 151 | create a second head |
|
152 | 152 | |
|
153 | 153 | $ cd ../r1 |
|
154 | 154 | $ hg up 0 |
|
155 | 155 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
156 | 156 | $ echo b2 > b |
|
157 | 157 | $ echo a3 > a |
|
158 | 158 | $ hg addremove |
|
159 | 159 | adding b |
|
160 | 160 | $ hg commit -m "3" |
|
161 | 161 | created new head |
|
162 | 162 | |
|
163 | 163 | $ cd ../r2 |
|
164 | 164 | $ hg -q pull ../r1 |
|
165 | 165 | $ hg status |
|
166 | 166 | M a |
|
167 | 167 | $ hg parents |
|
168 | 168 | changeset: 1:1e71731e6fbb |
|
169 | 169 | user: test |
|
170 | 170 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
171 | 171 | summary: 2 |
|
172 | 172 | |
|
173 | 173 | $ hg --debug up |
|
174 | 174 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
175 | updated to "1e71731e6fbb: 2" | |
|
175 | 176 | 1 other heads for branch "default" |
|
176 | 177 | |
|
177 | 178 | test conflicting untracked files |
|
178 | 179 | |
|
179 | 180 | $ hg up -qC 0 |
|
180 | 181 | $ echo untracked > b |
|
181 | 182 | $ hg st |
|
182 | 183 | ? b |
|
183 | 184 | $ hg up 1 |
|
184 | 185 | b: untracked file differs |
|
185 | 186 | abort: untracked files in working directory differ from files in requested revision |
|
186 | 187 | [255] |
|
187 | 188 | $ rm b |
|
188 | 189 | |
|
189 | 190 | test conflicting untracked ignored file |
|
190 | 191 | |
|
191 | 192 | $ hg up -qC 0 |
|
192 | 193 | $ echo ignored > .hgignore |
|
193 | 194 | $ hg add .hgignore |
|
194 | 195 | $ hg ci -m 'add .hgignore' |
|
195 | 196 | created new head |
|
196 | 197 | $ echo ignored > ignored |
|
197 | 198 | $ hg add ignored |
|
198 | 199 | $ hg ci -m 'add ignored file' |
|
199 | 200 | |
|
200 | 201 | $ hg up -q 'desc("add .hgignore")' |
|
201 | 202 | $ echo untracked > ignored |
|
202 | 203 | $ hg st |
|
203 | 204 | $ hg up 'desc("add ignored file")' |
|
204 | 205 | ignored: untracked file differs |
|
205 | 206 | abort: untracked files in working directory differ from files in requested revision |
|
206 | 207 | [255] |
|
207 | 208 | |
|
208 | 209 | test a local add |
|
209 | 210 | |
|
210 | 211 | $ cd .. |
|
211 | 212 | $ hg init a |
|
212 | 213 | $ hg init b |
|
213 | 214 | $ echo a > a/a |
|
214 | 215 | $ echo a > b/a |
|
215 | 216 | $ hg --cwd a commit -A -m a |
|
216 | 217 | adding a |
|
217 | 218 | $ cd b |
|
218 | 219 | $ hg add a |
|
219 | 220 | $ hg pull -u ../a |
|
220 | 221 | pulling from ../a |
|
221 | 222 | requesting all changes |
|
222 | 223 | adding changesets |
|
223 | 224 | adding manifests |
|
224 | 225 | adding file changes |
|
225 | 226 | added 1 changesets with 1 changes to 1 files |
|
226 | 227 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
227 | 228 | $ hg st |
|
228 | 229 | |
|
229 | 230 | test updating backwards through a rename |
|
230 | 231 | |
|
231 | 232 | $ hg mv a b |
|
232 | 233 | $ hg ci -m b |
|
233 | 234 | $ echo b > b |
|
234 | 235 | $ hg up -q 0 |
|
235 | 236 | $ hg st |
|
236 | 237 | M a |
|
237 | 238 | $ hg diff --nodates |
|
238 | 239 | diff -r cb9a9f314b8b a |
|
239 | 240 | --- a/a |
|
240 | 241 | +++ b/a |
|
241 | 242 | @@ -1,1 +1,1 @@ |
|
242 | 243 | -a |
|
243 | 244 | +b |
|
244 | 245 | |
|
245 | 246 | test for superfluous filemerge of clean files renamed in the past |
|
246 | 247 | |
|
247 | 248 | $ hg up -qC tip |
|
248 | 249 | $ echo c > c |
|
249 | 250 | $ hg add c |
|
250 | 251 | $ hg up -qt:fail 0 |
|
251 | 252 | |
|
252 | 253 | $ cd .. |
@@ -1,565 +1,568 | |||
|
1 | 1 | # Construct the following history tree: |
|
2 | 2 | # |
|
3 | 3 | # @ 5:e1bb631146ca b1 |
|
4 | 4 | # | |
|
5 | 5 | # o 4:a4fdb3b883c4 0:b608b9236435 b1 |
|
6 | 6 | # | |
|
7 | 7 | # | o 3:4b57d2520816 1:44592833ba9f |
|
8 | 8 | # | | |
|
9 | 9 | # | | o 2:063f31070f65 |
|
10 | 10 | # | |/ |
|
11 | 11 | # | o 1:44592833ba9f |
|
12 | 12 | # |/ |
|
13 | 13 | # o 0:b608b9236435 |
|
14 | 14 | |
|
15 | 15 | $ mkdir b1 |
|
16 | 16 | $ cd b1 |
|
17 | 17 | $ hg init |
|
18 | 18 | $ echo foo > foo |
|
19 | 19 | $ echo zero > a |
|
20 | 20 | $ hg init sub |
|
21 | 21 | $ echo suba > sub/suba |
|
22 | 22 | $ hg --cwd sub ci -Am addsuba |
|
23 | 23 | adding suba |
|
24 | 24 | $ echo 'sub = sub' > .hgsub |
|
25 | 25 | $ hg ci -qAm0 |
|
26 | 26 | $ echo one > a ; hg ci -m1 |
|
27 | 27 | $ echo two > a ; hg ci -m2 |
|
28 | 28 | $ hg up -q 1 |
|
29 | 29 | $ echo three > a ; hg ci -qm3 |
|
30 | 30 | $ hg up -q 0 |
|
31 | 31 | $ hg branch -q b1 |
|
32 | 32 | $ echo four > a ; hg ci -qm4 |
|
33 | 33 | $ echo five > a ; hg ci -qm5 |
|
34 | 34 | |
|
35 | 35 | Initial repo state: |
|
36 | 36 | |
|
37 | 37 | $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n' |
|
38 | 38 | @ 5:ff252e8273df b1 |
|
39 | 39 | | |
|
40 | 40 | o 4:d047485b3896 0:60829823a42a b1 |
|
41 | 41 | | |
|
42 | 42 | | o 3:6efa171f091b 1:0786582aa4b1 |
|
43 | 43 | | | |
|
44 | 44 | | | o 2:bd10386d478c |
|
45 | 45 | | |/ |
|
46 | 46 | | o 1:0786582aa4b1 |
|
47 | 47 | |/ |
|
48 | 48 | o 0:60829823a42a |
|
49 | 49 | |
|
50 | 50 | |
|
51 | 51 | Make sure update doesn't assume b1 is a repository if invoked from outside: |
|
52 | 52 | |
|
53 | 53 | $ cd .. |
|
54 | 54 | $ hg update b1 |
|
55 | 55 | abort: no repository found in '$TESTTMP' (.hg not found)! |
|
56 | 56 | [255] |
|
57 | 57 | $ cd b1 |
|
58 | 58 | |
|
59 | 59 | Test helper functions: |
|
60 | 60 | |
|
61 | 61 | $ revtest () { |
|
62 | 62 | > msg=$1 |
|
63 | 63 | > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' |
|
64 | 64 | > startrev=$3 |
|
65 | 65 | > targetrev=$4 |
|
66 | 66 | > opt=$5 |
|
67 | 67 | > hg up -qC $startrev |
|
68 | 68 | > test $dirtyflag = dirty && echo dirty > foo |
|
69 | 69 | > test $dirtyflag = dirtysub && echo dirty > sub/suba |
|
70 | 70 | > hg up $opt $targetrev |
|
71 | 71 | > hg parent --template 'parent={rev}\n' |
|
72 | 72 | > hg stat -S |
|
73 | 73 | > } |
|
74 | 74 | |
|
75 | 75 | $ norevtest () { |
|
76 | 76 | > msg=$1 |
|
77 | 77 | > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' |
|
78 | 78 | > startrev=$3 |
|
79 | 79 | > opt=$4 |
|
80 | 80 | > hg up -qC $startrev |
|
81 | 81 | > test $dirtyflag = dirty && echo dirty > foo |
|
82 | 82 | > test $dirtyflag = dirtysub && echo dirty > sub/suba |
|
83 | 83 | > hg up $opt |
|
84 | 84 | > hg parent --template 'parent={rev}\n' |
|
85 | 85 | > hg stat -S |
|
86 | 86 | > } |
|
87 | 87 | |
|
88 | 88 | Test cases are documented in a table in the update function of merge.py. |
|
89 | 89 | Cases are run as shown in that table, row by row. |
|
90 | 90 | |
|
91 | 91 | $ norevtest 'none clean linear' clean 4 |
|
92 | 92 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
93 | 93 | parent=5 |
|
94 | 94 | |
|
95 | 95 | $ norevtest 'none clean same' clean 2 |
|
96 | 96 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
97 | updated to "bd10386d478c: 2" | |
|
97 | 98 | 1 other heads for branch "default" |
|
98 | 99 | parent=2 |
|
99 | 100 | |
|
100 | 101 | |
|
101 | 102 | $ revtest 'none clean linear' clean 1 2 |
|
102 | 103 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
103 | 104 | parent=2 |
|
104 | 105 | |
|
105 | 106 | $ revtest 'none clean same' clean 2 3 |
|
106 | 107 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
107 | 108 | parent=3 |
|
108 | 109 | |
|
109 | 110 | $ revtest 'none clean cross' clean 3 4 |
|
110 | 111 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
111 | 112 | parent=4 |
|
112 | 113 | |
|
113 | 114 | |
|
114 | 115 | $ revtest 'none dirty linear' dirty 1 2 |
|
115 | 116 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
116 | 117 | parent=2 |
|
117 | 118 | M foo |
|
118 | 119 | |
|
119 | 120 | $ revtest 'none dirtysub linear' dirtysub 1 2 |
|
120 | 121 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
121 | 122 | parent=2 |
|
122 | 123 | M sub/suba |
|
123 | 124 | |
|
124 | 125 | $ revtest 'none dirty same' dirty 2 3 |
|
125 | 126 | abort: uncommitted changes |
|
126 | 127 | (commit or update --clean to discard changes) |
|
127 | 128 | parent=2 |
|
128 | 129 | M foo |
|
129 | 130 | |
|
130 | 131 | $ revtest 'none dirtysub same' dirtysub 2 3 |
|
131 | 132 | abort: uncommitted changes |
|
132 | 133 | (commit or update --clean to discard changes) |
|
133 | 134 | parent=2 |
|
134 | 135 | M sub/suba |
|
135 | 136 | |
|
136 | 137 | $ revtest 'none dirty cross' dirty 3 4 |
|
137 | 138 | abort: uncommitted changes |
|
138 | 139 | (commit or update --clean to discard changes) |
|
139 | 140 | parent=3 |
|
140 | 141 | M foo |
|
141 | 142 | |
|
142 | 143 | $ norevtest 'none dirty cross' dirty 2 |
|
143 | 144 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
145 | updated to "bd10386d478c: 2" | |
|
144 | 146 | 1 other heads for branch "default" |
|
145 | 147 | parent=2 |
|
146 | 148 | M foo |
|
147 | 149 | |
|
148 | 150 | $ revtest 'none dirtysub cross' dirtysub 3 4 |
|
149 | 151 | abort: uncommitted changes |
|
150 | 152 | (commit or update --clean to discard changes) |
|
151 | 153 | parent=3 |
|
152 | 154 | M sub/suba |
|
153 | 155 | |
|
154 | 156 | $ revtest '-C dirty linear' dirty 1 2 -C |
|
155 | 157 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
156 | 158 | parent=2 |
|
157 | 159 | |
|
158 | 160 | $ revtest '-c dirty linear' dirty 1 2 -c |
|
159 | 161 | abort: uncommitted changes |
|
160 | 162 | parent=1 |
|
161 | 163 | M foo |
|
162 | 164 | |
|
163 | 165 | $ revtest '-m dirty linear' dirty 1 2 -m |
|
164 | 166 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
165 | 167 | parent=2 |
|
166 | 168 | M foo |
|
167 | 169 | |
|
168 | 170 | $ revtest '-m dirty cross' dirty 3 4 -m |
|
169 | 171 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
170 | 172 | parent=4 |
|
171 | 173 | M foo |
|
172 | 174 | |
|
173 | 175 | $ revtest '-c dirtysub linear' dirtysub 1 2 -c |
|
174 | 176 | abort: uncommitted changes in subrepository 'sub' |
|
175 | 177 | parent=1 |
|
176 | 178 | M sub/suba |
|
177 | 179 | |
|
178 | 180 | $ norevtest '-c clean same' clean 2 -c |
|
179 | 181 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
182 | updated to "bd10386d478c: 2" | |
|
180 | 183 | 1 other heads for branch "default" |
|
181 | 184 | parent=2 |
|
182 | 185 | |
|
183 | 186 | $ revtest '-cC dirty linear' dirty 1 2 -cC |
|
184 | 187 | abort: can only specify one of -C/--clean, -c/--check, or -m/merge |
|
185 | 188 | parent=1 |
|
186 | 189 | M foo |
|
187 | 190 | |
|
188 | 191 | $ revtest '-mc dirty linear' dirty 1 2 -mc |
|
189 | 192 | abort: can only specify one of -C/--clean, -c/--check, or -m/merge |
|
190 | 193 | parent=1 |
|
191 | 194 | M foo |
|
192 | 195 | |
|
193 | 196 | $ revtest '-mC dirty linear' dirty 1 2 -mC |
|
194 | 197 | abort: can only specify one of -C/--clean, -c/--check, or -m/merge |
|
195 | 198 | parent=1 |
|
196 | 199 | M foo |
|
197 | 200 | |
|
198 | 201 | $ echo '[experimental]' >> .hg/hgrc |
|
199 | 202 | $ echo 'updatecheck = abort' >> .hg/hgrc |
|
200 | 203 | |
|
201 | 204 | $ revtest 'none dirty linear' dirty 1 2 |
|
202 | 205 | abort: uncommitted changes |
|
203 | 206 | parent=1 |
|
204 | 207 | M foo |
|
205 | 208 | |
|
206 | 209 | $ revtest 'none dirty linear' dirty 1 2 -c |
|
207 | 210 | abort: uncommitted changes |
|
208 | 211 | parent=1 |
|
209 | 212 | M foo |
|
210 | 213 | |
|
211 | 214 | $ revtest 'none dirty linear' dirty 1 2 -C |
|
212 | 215 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
213 | 216 | parent=2 |
|
214 | 217 | |
|
215 | 218 | $ echo 'updatecheck = none' >> .hg/hgrc |
|
216 | 219 | |
|
217 | 220 | $ revtest 'none dirty cross' dirty 3 4 |
|
218 | 221 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
219 | 222 | parent=4 |
|
220 | 223 | M foo |
|
221 | 224 | |
|
222 | 225 | $ revtest 'none dirty linear' dirty 1 2 |
|
223 | 226 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
224 | 227 | parent=2 |
|
225 | 228 | M foo |
|
226 | 229 | |
|
227 | 230 | $ revtest 'none dirty linear' dirty 1 2 -c |
|
228 | 231 | abort: uncommitted changes |
|
229 | 232 | parent=1 |
|
230 | 233 | M foo |
|
231 | 234 | |
|
232 | 235 | $ revtest 'none dirty linear' dirty 1 2 -C |
|
233 | 236 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
234 | 237 | parent=2 |
|
235 | 238 | |
|
236 | 239 | $ hg co -qC 3 |
|
237 | 240 | $ echo dirty >> a |
|
238 | 241 | $ hg co --tool :merge3 4 |
|
239 | 242 | merging a |
|
240 | 243 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
241 | 244 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
242 | 245 | use 'hg resolve' to retry unresolved file merges |
|
243 | 246 | [1] |
|
244 | 247 | $ hg st |
|
245 | 248 | M a |
|
246 | 249 | ? a.orig |
|
247 | 250 | $ cat a |
|
248 | 251 | <<<<<<< working copy: 6efa171f091b - test: 3 |
|
249 | 252 | three |
|
250 | 253 | dirty |
|
251 | 254 | ||||||| base |
|
252 | 255 | three |
|
253 | 256 | ======= |
|
254 | 257 | four |
|
255 | 258 | >>>>>>> destination: d047485b3896 b1 - test: 4 |
|
256 | 259 | $ rm a.orig |
|
257 | 260 | |
|
258 | 261 | $ echo 'updatecheck = noconflict' >> .hg/hgrc |
|
259 | 262 | |
|
260 | 263 | $ revtest 'none dirty cross' dirty 3 4 |
|
261 | 264 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
262 | 265 | parent=4 |
|
263 | 266 | M foo |
|
264 | 267 | |
|
265 | 268 | $ revtest 'none dirty linear' dirty 1 2 |
|
266 | 269 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
267 | 270 | parent=2 |
|
268 | 271 | M foo |
|
269 | 272 | |
|
270 | 273 | $ revtest 'none dirty linear' dirty 1 2 -c |
|
271 | 274 | abort: uncommitted changes |
|
272 | 275 | parent=1 |
|
273 | 276 | M foo |
|
274 | 277 | |
|
275 | 278 | $ revtest 'none dirty linear' dirty 1 2 -C |
|
276 | 279 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
277 | 280 | parent=2 |
|
278 | 281 | |
|
279 | 282 | Locally added file is allowed |
|
280 | 283 | $ hg up -qC 3 |
|
281 | 284 | $ echo a > bar |
|
282 | 285 | $ hg add bar |
|
283 | 286 | $ hg up -q 4 |
|
284 | 287 | $ hg st |
|
285 | 288 | A bar |
|
286 | 289 | $ hg forget bar |
|
287 | 290 | $ rm bar |
|
288 | 291 | |
|
289 | 292 | Locally removed file is allowed |
|
290 | 293 | $ hg up -qC 3 |
|
291 | 294 | $ hg rm foo |
|
292 | 295 | $ hg up -q 4 |
|
293 | 296 | |
|
294 | 297 | File conflict is not allowed |
|
295 | 298 | $ hg up -qC 3 |
|
296 | 299 | $ echo dirty >> a |
|
297 | 300 | $ hg up -q 4 |
|
298 | 301 | abort: conflicting changes |
|
299 | 302 | (commit or update --clean to discard changes) |
|
300 | 303 | [255] |
|
301 | 304 | $ hg up -m 4 |
|
302 | 305 | merging a |
|
303 | 306 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
304 | 307 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
305 | 308 | use 'hg resolve' to retry unresolved file merges |
|
306 | 309 | [1] |
|
307 | 310 | $ rm a.orig |
|
308 | 311 | |
|
309 | 312 | Change/delete conflict is not allowed |
|
310 | 313 | $ hg up -qC 3 |
|
311 | 314 | $ hg rm foo |
|
312 | 315 | $ hg up -q 4 |
|
313 | 316 | |
|
314 | 317 | Uses default value of "linear" when value is misspelled |
|
315 | 318 | $ echo 'updatecheck = linyar' >> .hg/hgrc |
|
316 | 319 | |
|
317 | 320 | $ revtest 'dirty cross' dirty 3 4 |
|
318 | 321 | abort: uncommitted changes |
|
319 | 322 | (commit or update --clean to discard changes) |
|
320 | 323 | parent=3 |
|
321 | 324 | M foo |
|
322 | 325 | |
|
323 | 326 | Setup for later tests |
|
324 | 327 | $ revtest 'none dirty linear' dirty 1 2 -c |
|
325 | 328 | abort: uncommitted changes |
|
326 | 329 | parent=1 |
|
327 | 330 | M foo |
|
328 | 331 | |
|
329 | 332 | $ cd .. |
|
330 | 333 | |
|
331 | 334 | Test updating to null revision |
|
332 | 335 | |
|
333 | 336 | $ hg init null-repo |
|
334 | 337 | $ cd null-repo |
|
335 | 338 | $ echo a > a |
|
336 | 339 | $ hg add a |
|
337 | 340 | $ hg ci -m a |
|
338 | 341 | $ hg up -qC 0 |
|
339 | 342 | $ echo b > b |
|
340 | 343 | $ hg add b |
|
341 | 344 | $ hg up null |
|
342 | 345 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
343 | 346 | $ hg st |
|
344 | 347 | A b |
|
345 | 348 | $ hg up -q 0 |
|
346 | 349 | $ hg st |
|
347 | 350 | A b |
|
348 | 351 | $ hg up -qC null |
|
349 | 352 | $ hg st |
|
350 | 353 | ? b |
|
351 | 354 | $ cd .. |
|
352 | 355 | |
|
353 | 356 | Test updating with closed head |
|
354 | 357 | --------------------------------------------------------------------- |
|
355 | 358 | |
|
356 | 359 | $ hg clone -U -q b1 closed-heads |
|
357 | 360 | $ cd closed-heads |
|
358 | 361 | |
|
359 | 362 | Test updating if at least one non-closed branch head exists |
|
360 | 363 | |
|
361 | 364 | if on the closed branch head: |
|
362 | 365 | - update to "." |
|
363 | 366 | - "updated to a closed branch head ...." message is displayed |
|
364 | 367 | - "N other heads for ...." message is displayed |
|
365 | 368 | |
|
366 | 369 | $ hg update -q -C 3 |
|
367 | 370 | $ hg commit --close-branch -m 6 |
|
368 | 371 | $ norevtest "on closed branch head" clean 6 |
|
369 | 372 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
370 | 373 | no open descendant heads on branch "default", updating to a closed head |
|
371 | 374 | (committing will reopen the head, use 'hg heads .' to see 1 other heads) |
|
372 | 375 | parent=6 |
|
373 | 376 | |
|
374 | 377 | if descendant non-closed branch head exists, and it is only one branch head: |
|
375 | 378 | - update to it, even if its revision is less than closed one |
|
376 | 379 | - "N other heads for ...." message isn't displayed |
|
377 | 380 | |
|
378 | 381 | $ norevtest "non-closed 2 should be chosen" clean 1 |
|
379 | 382 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
380 | 383 | parent=2 |
|
381 | 384 | |
|
382 | 385 | if all descendant branch heads are closed, but there is another branch head: |
|
383 | 386 | - update to the tipmost descendant head |
|
384 | 387 | - "updated to a closed branch head ...." message is displayed |
|
385 | 388 | - "N other heads for ...." message is displayed |
|
386 | 389 | |
|
387 | 390 | $ norevtest "all descendant branch heads are closed" clean 3 |
|
388 | 391 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
389 | 392 | no open descendant heads on branch "default", updating to a closed head |
|
390 | 393 | (committing will reopen the head, use 'hg heads .' to see 1 other heads) |
|
391 | 394 | parent=6 |
|
392 | 395 | |
|
393 | 396 | Test updating if all branch heads are closed |
|
394 | 397 | |
|
395 | 398 | if on the closed branch head: |
|
396 | 399 | - update to "." |
|
397 | 400 | - "updated to a closed branch head ...." message is displayed |
|
398 | 401 | - "all heads of branch ...." message is displayed |
|
399 | 402 | |
|
400 | 403 | $ hg update -q -C 2 |
|
401 | 404 | $ hg commit --close-branch -m 7 |
|
402 | 405 | $ norevtest "all heads of branch default are closed" clean 6 |
|
403 | 406 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
404 | 407 | no open descendant heads on branch "default", updating to a closed head |
|
405 | 408 | (committing will reopen branch "default") |
|
406 | 409 | parent=6 |
|
407 | 410 | |
|
408 | 411 | if not on the closed branch head: |
|
409 | 412 | - update to the tipmost descendant (closed) head |
|
410 | 413 | - "updated to a closed branch head ...." message is displayed |
|
411 | 414 | - "all heads of branch ...." message is displayed |
|
412 | 415 | |
|
413 | 416 | $ norevtest "all heads of branch default are closed" clean 1 |
|
414 | 417 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
415 | 418 | no open descendant heads on branch "default", updating to a closed head |
|
416 | 419 | (committing will reopen branch "default") |
|
417 | 420 | parent=7 |
|
418 | 421 | |
|
419 | 422 | $ cd .. |
|
420 | 423 | |
|
421 | 424 | Test updating if "default" branch doesn't exist and no revision is |
|
422 | 425 | checked out (= "default" is used as current branch) |
|
423 | 426 | |
|
424 | 427 | $ hg init no-default-branch |
|
425 | 428 | $ cd no-default-branch |
|
426 | 429 | |
|
427 | 430 | $ hg branch foobar |
|
428 | 431 | marked working directory as branch foobar |
|
429 | 432 | (branches are permanent and global, did you want a bookmark?) |
|
430 | 433 | $ echo a > a |
|
431 | 434 | $ hg commit -m "#0" -A |
|
432 | 435 | adding a |
|
433 | 436 | $ echo 1 >> a |
|
434 | 437 | $ hg commit -m "#1" |
|
435 | 438 | $ hg update -q 0 |
|
436 | 439 | $ echo 3 >> a |
|
437 | 440 | $ hg commit -m "#2" |
|
438 | 441 | created new head |
|
439 | 442 | $ hg commit --close-branch -m "#3" |
|
440 | 443 | |
|
441 | 444 | if there is at least one non-closed branch head: |
|
442 | 445 | - update to the tipmost branch head |
|
443 | 446 | |
|
444 | 447 | $ norevtest "non-closed 1 should be chosen" clean null |
|
445 | 448 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
446 | 449 | parent=1 |
|
447 | 450 | |
|
448 | 451 | if all branch heads are closed |
|
449 | 452 | - update to "tip" |
|
450 | 453 | - "updated to a closed branch head ...." message is displayed |
|
451 | 454 | - "all heads for branch "XXXX" are closed" message is displayed |
|
452 | 455 | |
|
453 | 456 | $ hg update -q -C 1 |
|
454 | 457 | $ hg commit --close-branch -m "#4" |
|
455 | 458 | |
|
456 | 459 | $ norevtest "all branches are closed" clean null |
|
457 | 460 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
458 | 461 | no open descendant heads on branch "foobar", updating to a closed head |
|
459 | 462 | (committing will reopen branch "foobar") |
|
460 | 463 | parent=4 |
|
461 | 464 | |
|
462 | 465 | $ cd ../b1 |
|
463 | 466 | |
|
464 | 467 | Test obsolescence behavior |
|
465 | 468 | --------------------------------------------------------------------- |
|
466 | 469 | |
|
467 | 470 | successors should be taken in account when checking head destination |
|
468 | 471 | |
|
469 | 472 | $ cat << EOF >> $HGRCPATH |
|
470 | 473 | > [ui] |
|
471 | 474 | > logtemplate={rev}:{node|short} {desc|firstline} |
|
472 | 475 | > [experimental] |
|
473 | 476 | > evolution=createmarkers |
|
474 | 477 | > EOF |
|
475 | 478 | |
|
476 | 479 | Test no-argument update to a successor of an obsoleted changeset |
|
477 | 480 | |
|
478 | 481 | $ hg log -G |
|
479 | 482 | o 5:ff252e8273df 5 |
|
480 | 483 | | |
|
481 | 484 | o 4:d047485b3896 4 |
|
482 | 485 | | |
|
483 | 486 | | o 3:6efa171f091b 3 |
|
484 | 487 | | | |
|
485 | 488 | | | o 2:bd10386d478c 2 |
|
486 | 489 | | |/ |
|
487 | 490 | | @ 1:0786582aa4b1 1 |
|
488 | 491 | |/ |
|
489 | 492 | o 0:60829823a42a 0 |
|
490 | 493 | |
|
491 | 494 | $ hg book bm -r 3 |
|
492 | 495 | $ hg status |
|
493 | 496 | M foo |
|
494 | 497 | |
|
495 | 498 | We add simple obsolescence marker between 3 and 4 (indirect successors) |
|
496 | 499 | |
|
497 | 500 | $ hg id --debug -i -r 3 |
|
498 | 501 | 6efa171f091b00a3c35edc15d48c52a498929953 |
|
499 | 502 | $ hg id --debug -i -r 4 |
|
500 | 503 | d047485b3896813b2a624e86201983520f003206 |
|
501 | 504 | $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
502 | 505 | $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206 |
|
503 | 506 | |
|
504 | 507 | Test that 5 is detected as a valid destination from 3 and also accepts moving |
|
505 | 508 | the bookmark (issue4015) |
|
506 | 509 | |
|
507 | 510 | $ hg up --quiet --hidden 3 |
|
508 | 511 | $ hg up 5 |
|
509 | 512 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
510 | 513 | $ hg book bm |
|
511 | 514 | moving bookmark 'bm' forward from 6efa171f091b |
|
512 | 515 | $ hg bookmarks |
|
513 | 516 | * bm 5:ff252e8273df |
|
514 | 517 | |
|
515 | 518 | Test that 4 is detected as the no-argument destination from 3 and also moves |
|
516 | 519 | the bookmark with it |
|
517 | 520 | $ hg up --quiet 0 # we should be able to update to 3 directly |
|
518 | 521 | $ hg up --quiet --hidden 3 # but not implemented yet. |
|
519 | 522 | $ hg book -f bm |
|
520 | 523 | $ hg up |
|
521 | 524 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
522 | 525 | updating bookmark bm |
|
523 | 526 | $ hg book |
|
524 | 527 | * bm 4:d047485b3896 |
|
525 | 528 | |
|
526 | 529 | Test that 5 is detected as a valid destination from 1 |
|
527 | 530 | $ hg up --quiet 0 # we should be able to update to 3 directly |
|
528 | 531 | $ hg up --quiet --hidden 3 # but not implemented yet. |
|
529 | 532 | $ hg up 5 |
|
530 | 533 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
531 | 534 | |
|
532 | 535 | Test that 5 is not detected as a valid destination from 2 |
|
533 | 536 | $ hg up --quiet 0 |
|
534 | 537 | $ hg up --quiet 2 |
|
535 | 538 | $ hg up 5 |
|
536 | 539 | abort: uncommitted changes |
|
537 | 540 | (commit or update --clean to discard changes) |
|
538 | 541 | [255] |
|
539 | 542 | |
|
540 | 543 | Test that we don't crash when updating from a pruned changeset (i.e. has no |
|
541 | 544 | successors). Behavior should probably be that we update to the first |
|
542 | 545 | non-obsolete parent but that will be decided later. |
|
543 | 546 | $ hg id --debug -r 2 |
|
544 | 547 | bd10386d478cd5a9faf2e604114c8e6da62d3889 |
|
545 | 548 | $ hg up --quiet 0 |
|
546 | 549 | $ hg up --quiet 2 |
|
547 | 550 | $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889 |
|
548 | 551 | $ hg up |
|
549 | 552 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
550 | 553 | |
|
551 | 554 | Test experimental revset support |
|
552 | 555 | |
|
553 | 556 | $ hg log -r '_destupdate()' |
|
554 | 557 | 2:bd10386d478c 2 (no-eol) |
|
555 | 558 | |
|
556 | 559 | Test that boolean flags allow --no-flag specification to override [defaults] |
|
557 | 560 | $ cat >> $HGRCPATH <<EOF |
|
558 | 561 | > [defaults] |
|
559 | 562 | > update = --check |
|
560 | 563 | > EOF |
|
561 | 564 | $ hg co 2 |
|
562 | 565 | abort: uncommitted changes |
|
563 | 566 | [255] |
|
564 | 567 | $ hg co --no-check 2 |
|
565 | 568 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now