##// END OF EJS Templates
pullreport: issue a message about "extinct" pulled changesets...
Boris Feld -
r39935:f9232b03 default
parent child Browse files
Show More
@@ -1,1791 +1,1802 b''
1 1 # scmutil.py - Mercurial core utility functions
2 2 #
3 3 # Copyright Matt Mackall <mpm@selenic.com>
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 import errno
11 11 import glob
12 12 import hashlib
13 13 import os
14 14 import re
15 15 import socket
16 16 import subprocess
17 17 import weakref
18 18
19 19 from .i18n import _
20 20 from .node import (
21 21 bin,
22 22 hex,
23 23 nullid,
24 24 nullrev,
25 25 short,
26 26 wdirid,
27 27 wdirrev,
28 28 )
29 29
30 30 from . import (
31 31 encoding,
32 32 error,
33 33 match as matchmod,
34 34 obsolete,
35 35 obsutil,
36 36 pathutil,
37 37 phases,
38 38 policy,
39 39 pycompat,
40 40 revsetlang,
41 41 similar,
42 42 smartset,
43 43 url,
44 44 util,
45 45 vfs,
46 46 )
47 47
48 48 from .utils import (
49 49 procutil,
50 50 stringutil,
51 51 )
52 52
53 53 if pycompat.iswindows:
54 54 from . import scmwindows as scmplatform
55 55 else:
56 56 from . import scmposix as scmplatform
57 57
58 58 parsers = policy.importmod(r'parsers')
59 59
60 60 termsize = scmplatform.termsize
61 61
62 62 class status(tuple):
63 63 '''Named tuple with a list of files per status. The 'deleted', 'unknown'
64 64 and 'ignored' properties are only relevant to the working copy.
65 65 '''
66 66
67 67 __slots__ = ()
68 68
69 69 def __new__(cls, modified, added, removed, deleted, unknown, ignored,
70 70 clean):
71 71 return tuple.__new__(cls, (modified, added, removed, deleted, unknown,
72 72 ignored, clean))
73 73
74 74 @property
75 75 def modified(self):
76 76 '''files that have been modified'''
77 77 return self[0]
78 78
79 79 @property
80 80 def added(self):
81 81 '''files that have been added'''
82 82 return self[1]
83 83
84 84 @property
85 85 def removed(self):
86 86 '''files that have been removed'''
87 87 return self[2]
88 88
89 89 @property
90 90 def deleted(self):
91 91 '''files that are in the dirstate, but have been deleted from the
92 92 working copy (aka "missing")
93 93 '''
94 94 return self[3]
95 95
96 96 @property
97 97 def unknown(self):
98 98 '''files not in the dirstate that are not ignored'''
99 99 return self[4]
100 100
101 101 @property
102 102 def ignored(self):
103 103 '''files not in the dirstate that are ignored (by _dirignore())'''
104 104 return self[5]
105 105
106 106 @property
107 107 def clean(self):
108 108 '''files that have not been modified'''
109 109 return self[6]
110 110
111 111 def __repr__(self, *args, **kwargs):
112 112 return ((r'<status modified=%s, added=%s, removed=%s, deleted=%s, '
113 113 r'unknown=%s, ignored=%s, clean=%s>') %
114 114 tuple(pycompat.sysstr(stringutil.pprint(v)) for v in self))
115 115
116 116 def itersubrepos(ctx1, ctx2):
117 117 """find subrepos in ctx1 or ctx2"""
118 118 # Create a (subpath, ctx) mapping where we prefer subpaths from
119 119 # ctx1. The subpaths from ctx2 are important when the .hgsub file
120 120 # has been modified (in ctx2) but not yet committed (in ctx1).
121 121 subpaths = dict.fromkeys(ctx2.substate, ctx2)
122 122 subpaths.update(dict.fromkeys(ctx1.substate, ctx1))
123 123
124 124 missing = set()
125 125
126 126 for subpath in ctx2.substate:
127 127 if subpath not in ctx1.substate:
128 128 del subpaths[subpath]
129 129 missing.add(subpath)
130 130
131 131 for subpath, ctx in sorted(subpaths.iteritems()):
132 132 yield subpath, ctx.sub(subpath)
133 133
134 134 # Yield an empty subrepo based on ctx1 for anything only in ctx2. That way,
135 135 # status and diff will have an accurate result when it does
136 136 # 'sub.{status|diff}(rev2)'. Otherwise, the ctx2 subrepo is compared
137 137 # against itself.
138 138 for subpath in missing:
139 139 yield subpath, ctx2.nullsub(subpath, ctx1)
140 140
141 141 def nochangesfound(ui, repo, excluded=None):
142 142 '''Report no changes for push/pull, excluded is None or a list of
143 143 nodes excluded from the push/pull.
144 144 '''
145 145 secretlist = []
146 146 if excluded:
147 147 for n in excluded:
148 148 ctx = repo[n]
149 149 if ctx.phase() >= phases.secret and not ctx.extinct():
150 150 secretlist.append(n)
151 151
152 152 if secretlist:
153 153 ui.status(_("no changes found (ignored %d secret changesets)\n")
154 154 % len(secretlist))
155 155 else:
156 156 ui.status(_("no changes found\n"))
157 157
158 158 def callcatch(ui, func):
159 159 """call func() with global exception handling
160 160
161 161 return func() if no exception happens. otherwise do some error handling
162 162 and return an exit code accordingly. does not handle all exceptions.
163 163 """
164 164 try:
165 165 try:
166 166 return func()
167 167 except: # re-raises
168 168 ui.traceback()
169 169 raise
170 170 # Global exception handling, alphabetically
171 171 # Mercurial-specific first, followed by built-in and library exceptions
172 172 except error.LockHeld as inst:
173 173 if inst.errno == errno.ETIMEDOUT:
174 174 reason = _('timed out waiting for lock held by %r') % inst.locker
175 175 else:
176 176 reason = _('lock held by %r') % inst.locker
177 177 ui.error(_("abort: %s: %s\n") % (
178 178 inst.desc or stringutil.forcebytestr(inst.filename), reason))
179 179 if not inst.locker:
180 180 ui.error(_("(lock might be very busy)\n"))
181 181 except error.LockUnavailable as inst:
182 182 ui.error(_("abort: could not lock %s: %s\n") %
183 183 (inst.desc or stringutil.forcebytestr(inst.filename),
184 184 encoding.strtolocal(inst.strerror)))
185 185 except error.OutOfBandError as inst:
186 186 if inst.args:
187 187 msg = _("abort: remote error:\n")
188 188 else:
189 189 msg = _("abort: remote error\n")
190 190 ui.error(msg)
191 191 if inst.args:
192 192 ui.error(''.join(inst.args))
193 193 if inst.hint:
194 194 ui.error('(%s)\n' % inst.hint)
195 195 except error.RepoError as inst:
196 196 ui.error(_("abort: %s!\n") % inst)
197 197 if inst.hint:
198 198 ui.error(_("(%s)\n") % inst.hint)
199 199 except error.ResponseError as inst:
200 200 ui.error(_("abort: %s") % inst.args[0])
201 201 msg = inst.args[1]
202 202 if isinstance(msg, type(u'')):
203 203 msg = pycompat.sysbytes(msg)
204 204 if not isinstance(msg, bytes):
205 205 ui.error(" %r\n" % (msg,))
206 206 elif not msg:
207 207 ui.error(_(" empty string\n"))
208 208 else:
209 209 ui.error("\n%r\n" % pycompat.bytestr(stringutil.ellipsis(msg)))
210 210 except error.CensoredNodeError as inst:
211 211 ui.error(_("abort: file censored %s!\n") % inst)
212 212 except error.StorageError as inst:
213 213 ui.error(_("abort: %s!\n") % inst)
214 214 except error.InterventionRequired as inst:
215 215 ui.error("%s\n" % inst)
216 216 if inst.hint:
217 217 ui.error(_("(%s)\n") % inst.hint)
218 218 return 1
219 219 except error.WdirUnsupported:
220 220 ui.error(_("abort: working directory revision cannot be specified\n"))
221 221 except error.Abort as inst:
222 222 ui.error(_("abort: %s\n") % inst)
223 223 if inst.hint:
224 224 ui.error(_("(%s)\n") % inst.hint)
225 225 except ImportError as inst:
226 226 ui.error(_("abort: %s!\n") % stringutil.forcebytestr(inst))
227 227 m = stringutil.forcebytestr(inst).split()[-1]
228 228 if m in "mpatch bdiff".split():
229 229 ui.error(_("(did you forget to compile extensions?)\n"))
230 230 elif m in "zlib".split():
231 231 ui.error(_("(is your Python install correct?)\n"))
232 232 except IOError as inst:
233 233 if util.safehasattr(inst, "code"):
234 234 ui.error(_("abort: %s\n") % stringutil.forcebytestr(inst))
235 235 elif util.safehasattr(inst, "reason"):
236 236 try: # usually it is in the form (errno, strerror)
237 237 reason = inst.reason.args[1]
238 238 except (AttributeError, IndexError):
239 239 # it might be anything, for example a string
240 240 reason = inst.reason
241 241 if isinstance(reason, pycompat.unicode):
242 242 # SSLError of Python 2.7.9 contains a unicode
243 243 reason = encoding.unitolocal(reason)
244 244 ui.error(_("abort: error: %s\n") % reason)
245 245 elif (util.safehasattr(inst, "args")
246 246 and inst.args and inst.args[0] == errno.EPIPE):
247 247 pass
248 248 elif getattr(inst, "strerror", None):
249 249 if getattr(inst, "filename", None):
250 250 ui.error(_("abort: %s: %s\n") % (
251 251 encoding.strtolocal(inst.strerror),
252 252 stringutil.forcebytestr(inst.filename)))
253 253 else:
254 254 ui.error(_("abort: %s\n") % encoding.strtolocal(inst.strerror))
255 255 else:
256 256 raise
257 257 except OSError as inst:
258 258 if getattr(inst, "filename", None) is not None:
259 259 ui.error(_("abort: %s: '%s'\n") % (
260 260 encoding.strtolocal(inst.strerror),
261 261 stringutil.forcebytestr(inst.filename)))
262 262 else:
263 263 ui.error(_("abort: %s\n") % encoding.strtolocal(inst.strerror))
264 264 except MemoryError:
265 265 ui.error(_("abort: out of memory\n"))
266 266 except SystemExit as inst:
267 267 # Commands shouldn't sys.exit directly, but give a return code.
268 268 # Just in case catch this and and pass exit code to caller.
269 269 return inst.code
270 270 except socket.error as inst:
271 271 ui.error(_("abort: %s\n") % stringutil.forcebytestr(inst.args[-1]))
272 272
273 273 return -1
274 274
275 275 def checknewlabel(repo, lbl, kind):
276 276 # Do not use the "kind" parameter in ui output.
277 277 # It makes strings difficult to translate.
278 278 if lbl in ['tip', '.', 'null']:
279 279 raise error.Abort(_("the name '%s' is reserved") % lbl)
280 280 for c in (':', '\0', '\n', '\r'):
281 281 if c in lbl:
282 282 raise error.Abort(
283 283 _("%r cannot be used in a name") % pycompat.bytestr(c))
284 284 try:
285 285 int(lbl)
286 286 raise error.Abort(_("cannot use an integer as a name"))
287 287 except ValueError:
288 288 pass
289 289 if lbl.strip() != lbl:
290 290 raise error.Abort(_("leading or trailing whitespace in name %r") % lbl)
291 291
292 292 def checkfilename(f):
293 293 '''Check that the filename f is an acceptable filename for a tracked file'''
294 294 if '\r' in f or '\n' in f:
295 295 raise error.Abort(_("'\\n' and '\\r' disallowed in filenames: %r")
296 296 % pycompat.bytestr(f))
297 297
298 298 def checkportable(ui, f):
299 299 '''Check if filename f is portable and warn or abort depending on config'''
300 300 checkfilename(f)
301 301 abort, warn = checkportabilityalert(ui)
302 302 if abort or warn:
303 303 msg = util.checkwinfilename(f)
304 304 if msg:
305 305 msg = "%s: %s" % (msg, procutil.shellquote(f))
306 306 if abort:
307 307 raise error.Abort(msg)
308 308 ui.warn(_("warning: %s\n") % msg)
309 309
310 310 def checkportabilityalert(ui):
311 311 '''check if the user's config requests nothing, a warning, or abort for
312 312 non-portable filenames'''
313 313 val = ui.config('ui', 'portablefilenames')
314 314 lval = val.lower()
315 315 bval = stringutil.parsebool(val)
316 316 abort = pycompat.iswindows or lval == 'abort'
317 317 warn = bval or lval == 'warn'
318 318 if bval is None and not (warn or abort or lval == 'ignore'):
319 319 raise error.ConfigError(
320 320 _("ui.portablefilenames value is invalid ('%s')") % val)
321 321 return abort, warn
322 322
323 323 class casecollisionauditor(object):
324 324 def __init__(self, ui, abort, dirstate):
325 325 self._ui = ui
326 326 self._abort = abort
327 327 allfiles = '\0'.join(dirstate._map)
328 328 self._loweredfiles = set(encoding.lower(allfiles).split('\0'))
329 329 self._dirstate = dirstate
330 330 # The purpose of _newfiles is so that we don't complain about
331 331 # case collisions if someone were to call this object with the
332 332 # same filename twice.
333 333 self._newfiles = set()
334 334
335 335 def __call__(self, f):
336 336 if f in self._newfiles:
337 337 return
338 338 fl = encoding.lower(f)
339 339 if fl in self._loweredfiles and f not in self._dirstate:
340 340 msg = _('possible case-folding collision for %s') % f
341 341 if self._abort:
342 342 raise error.Abort(msg)
343 343 self._ui.warn(_("warning: %s\n") % msg)
344 344 self._loweredfiles.add(fl)
345 345 self._newfiles.add(f)
346 346
347 347 def filteredhash(repo, maxrev):
348 348 """build hash of filtered revisions in the current repoview.
349 349
350 350 Multiple caches perform up-to-date validation by checking that the
351 351 tiprev and tipnode stored in the cache file match the current repository.
352 352 However, this is not sufficient for validating repoviews because the set
353 353 of revisions in the view may change without the repository tiprev and
354 354 tipnode changing.
355 355
356 356 This function hashes all the revs filtered from the view and returns
357 357 that SHA-1 digest.
358 358 """
359 359 cl = repo.changelog
360 360 if not cl.filteredrevs:
361 361 return None
362 362 key = None
363 363 revs = sorted(r for r in cl.filteredrevs if r <= maxrev)
364 364 if revs:
365 365 s = hashlib.sha1()
366 366 for rev in revs:
367 367 s.update('%d;' % rev)
368 368 key = s.digest()
369 369 return key
370 370
371 371 def walkrepos(path, followsym=False, seen_dirs=None, recurse=False):
372 372 '''yield every hg repository under path, always recursively.
373 373 The recurse flag will only control recursion into repo working dirs'''
374 374 def errhandler(err):
375 375 if err.filename == path:
376 376 raise err
377 377 samestat = getattr(os.path, 'samestat', None)
378 378 if followsym and samestat is not None:
379 379 def adddir(dirlst, dirname):
380 380 dirstat = os.stat(dirname)
381 381 match = any(samestat(dirstat, lstdirstat) for lstdirstat in dirlst)
382 382 if not match:
383 383 dirlst.append(dirstat)
384 384 return not match
385 385 else:
386 386 followsym = False
387 387
388 388 if (seen_dirs is None) and followsym:
389 389 seen_dirs = []
390 390 adddir(seen_dirs, path)
391 391 for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler):
392 392 dirs.sort()
393 393 if '.hg' in dirs:
394 394 yield root # found a repository
395 395 qroot = os.path.join(root, '.hg', 'patches')
396 396 if os.path.isdir(os.path.join(qroot, '.hg')):
397 397 yield qroot # we have a patch queue repo here
398 398 if recurse:
399 399 # avoid recursing inside the .hg directory
400 400 dirs.remove('.hg')
401 401 else:
402 402 dirs[:] = [] # don't descend further
403 403 elif followsym:
404 404 newdirs = []
405 405 for d in dirs:
406 406 fname = os.path.join(root, d)
407 407 if adddir(seen_dirs, fname):
408 408 if os.path.islink(fname):
409 409 for hgname in walkrepos(fname, True, seen_dirs):
410 410 yield hgname
411 411 else:
412 412 newdirs.append(d)
413 413 dirs[:] = newdirs
414 414
415 415 def binnode(ctx):
416 416 """Return binary node id for a given basectx"""
417 417 node = ctx.node()
418 418 if node is None:
419 419 return wdirid
420 420 return node
421 421
422 422 def intrev(ctx):
423 423 """Return integer for a given basectx that can be used in comparison or
424 424 arithmetic operation"""
425 425 rev = ctx.rev()
426 426 if rev is None:
427 427 return wdirrev
428 428 return rev
429 429
430 430 def formatchangeid(ctx):
431 431 """Format changectx as '{rev}:{node|formatnode}', which is the default
432 432 template provided by logcmdutil.changesettemplater"""
433 433 repo = ctx.repo()
434 434 return formatrevnode(repo.ui, intrev(ctx), binnode(ctx))
435 435
436 436 def formatrevnode(ui, rev, node):
437 437 """Format given revision and node depending on the current verbosity"""
438 438 if ui.debugflag:
439 439 hexfunc = hex
440 440 else:
441 441 hexfunc = short
442 442 return '%d:%s' % (rev, hexfunc(node))
443 443
444 444 def resolvehexnodeidprefix(repo, prefix):
445 445 if (prefix.startswith('x') and
446 446 repo.ui.configbool('experimental', 'revisions.prefixhexnode')):
447 447 prefix = prefix[1:]
448 448 try:
449 449 # Uses unfiltered repo because it's faster when prefix is ambiguous/
450 450 # This matches the shortesthexnodeidprefix() function below.
451 451 node = repo.unfiltered().changelog._partialmatch(prefix)
452 452 except error.AmbiguousPrefixLookupError:
453 453 revset = repo.ui.config('experimental', 'revisions.disambiguatewithin')
454 454 if revset:
455 455 # Clear config to avoid infinite recursion
456 456 configoverrides = {('experimental',
457 457 'revisions.disambiguatewithin'): None}
458 458 with repo.ui.configoverride(configoverrides):
459 459 revs = repo.anyrevs([revset], user=True)
460 460 matches = []
461 461 for rev in revs:
462 462 node = repo.changelog.node(rev)
463 463 if hex(node).startswith(prefix):
464 464 matches.append(node)
465 465 if len(matches) == 1:
466 466 return matches[0]
467 467 raise
468 468 if node is None:
469 469 return
470 470 repo.changelog.rev(node) # make sure node isn't filtered
471 471 return node
472 472
473 473 def mayberevnum(repo, prefix):
474 474 """Checks if the given prefix may be mistaken for a revision number"""
475 475 try:
476 476 i = int(prefix)
477 477 # if we are a pure int, then starting with zero will not be
478 478 # confused as a rev; or, obviously, if the int is larger
479 479 # than the value of the tip rev
480 480 if prefix[0:1] == b'0' or i >= len(repo):
481 481 return False
482 482 return True
483 483 except ValueError:
484 484 return False
485 485
486 486 def shortesthexnodeidprefix(repo, node, minlength=1, cache=None):
487 487 """Find the shortest unambiguous prefix that matches hexnode.
488 488
489 489 If "cache" is not None, it must be a dictionary that can be used for
490 490 caching between calls to this method.
491 491 """
492 492 # _partialmatch() of filtered changelog could take O(len(repo)) time,
493 493 # which would be unacceptably slow. so we look for hash collision in
494 494 # unfiltered space, which means some hashes may be slightly longer.
495 495
496 496 def disambiguate(prefix):
497 497 """Disambiguate against revnums."""
498 498 if repo.ui.configbool('experimental', 'revisions.prefixhexnode'):
499 499 if mayberevnum(repo, prefix):
500 500 return 'x' + prefix
501 501 else:
502 502 return prefix
503 503
504 504 hexnode = hex(node)
505 505 for length in range(len(prefix), len(hexnode) + 1):
506 506 prefix = hexnode[:length]
507 507 if not mayberevnum(repo, prefix):
508 508 return prefix
509 509
510 510 cl = repo.unfiltered().changelog
511 511 revset = repo.ui.config('experimental', 'revisions.disambiguatewithin')
512 512 if revset:
513 513 revs = None
514 514 if cache is not None:
515 515 revs = cache.get('disambiguationrevset')
516 516 if revs is None:
517 517 revs = repo.anyrevs([revset], user=True)
518 518 if cache is not None:
519 519 cache['disambiguationrevset'] = revs
520 520 if cl.rev(node) in revs:
521 521 hexnode = hex(node)
522 522 nodetree = None
523 523 if cache is not None:
524 524 nodetree = cache.get('disambiguationnodetree')
525 525 if not nodetree:
526 526 try:
527 527 nodetree = parsers.nodetree(cl.index, len(revs))
528 528 except AttributeError:
529 529 # no native nodetree
530 530 pass
531 531 else:
532 532 for r in revs:
533 533 nodetree.insert(r)
534 534 if cache is not None:
535 535 cache['disambiguationnodetree'] = nodetree
536 536 if nodetree is not None:
537 537 length = max(nodetree.shortest(node), minlength)
538 538 prefix = hexnode[:length]
539 539 return disambiguate(prefix)
540 540 for length in range(minlength, len(hexnode) + 1):
541 541 matches = []
542 542 prefix = hexnode[:length]
543 543 for rev in revs:
544 544 otherhexnode = repo[rev].hex()
545 545 if prefix == otherhexnode[:length]:
546 546 matches.append(otherhexnode)
547 547 if len(matches) == 1:
548 548 return disambiguate(prefix)
549 549
550 550 try:
551 551 return disambiguate(cl.shortest(node, minlength))
552 552 except error.LookupError:
553 553 raise error.RepoLookupError()
554 554
555 555 def isrevsymbol(repo, symbol):
556 556 """Checks if a symbol exists in the repo.
557 557
558 558 See revsymbol() for details. Raises error.AmbiguousPrefixLookupError if the
559 559 symbol is an ambiguous nodeid prefix.
560 560 """
561 561 try:
562 562 revsymbol(repo, symbol)
563 563 return True
564 564 except error.RepoLookupError:
565 565 return False
566 566
567 567 def revsymbol(repo, symbol):
568 568 """Returns a context given a single revision symbol (as string).
569 569
570 570 This is similar to revsingle(), but accepts only a single revision symbol,
571 571 i.e. things like ".", "tip", "1234", "deadbeef", "my-bookmark" work, but
572 572 not "max(public())".
573 573 """
574 574 if not isinstance(symbol, bytes):
575 575 msg = ("symbol (%s of type %s) was not a string, did you mean "
576 576 "repo[symbol]?" % (symbol, type(symbol)))
577 577 raise error.ProgrammingError(msg)
578 578 try:
579 579 if symbol in ('.', 'tip', 'null'):
580 580 return repo[symbol]
581 581
582 582 try:
583 583 r = int(symbol)
584 584 if '%d' % r != symbol:
585 585 raise ValueError
586 586 l = len(repo.changelog)
587 587 if r < 0:
588 588 r += l
589 589 if r < 0 or r >= l and r != wdirrev:
590 590 raise ValueError
591 591 return repo[r]
592 592 except error.FilteredIndexError:
593 593 raise
594 594 except (ValueError, OverflowError, IndexError):
595 595 pass
596 596
597 597 if len(symbol) == 40:
598 598 try:
599 599 node = bin(symbol)
600 600 rev = repo.changelog.rev(node)
601 601 return repo[rev]
602 602 except error.FilteredLookupError:
603 603 raise
604 604 except (TypeError, LookupError):
605 605 pass
606 606
607 607 # look up bookmarks through the name interface
608 608 try:
609 609 node = repo.names.singlenode(repo, symbol)
610 610 rev = repo.changelog.rev(node)
611 611 return repo[rev]
612 612 except KeyError:
613 613 pass
614 614
615 615 node = resolvehexnodeidprefix(repo, symbol)
616 616 if node is not None:
617 617 rev = repo.changelog.rev(node)
618 618 return repo[rev]
619 619
620 620 raise error.RepoLookupError(_("unknown revision '%s'") % symbol)
621 621
622 622 except error.WdirUnsupported:
623 623 return repo[None]
624 624 except (error.FilteredIndexError, error.FilteredLookupError,
625 625 error.FilteredRepoLookupError):
626 626 raise _filterederror(repo, symbol)
627 627
628 628 def _filterederror(repo, changeid):
629 629 """build an exception to be raised about a filtered changeid
630 630
631 631 This is extracted in a function to help extensions (eg: evolve) to
632 632 experiment with various message variants."""
633 633 if repo.filtername.startswith('visible'):
634 634
635 635 # Check if the changeset is obsolete
636 636 unfilteredrepo = repo.unfiltered()
637 637 ctx = revsymbol(unfilteredrepo, changeid)
638 638
639 639 # If the changeset is obsolete, enrich the message with the reason
640 640 # that made this changeset not visible
641 641 if ctx.obsolete():
642 642 msg = obsutil._getfilteredreason(repo, changeid, ctx)
643 643 else:
644 644 msg = _("hidden revision '%s'") % changeid
645 645
646 646 hint = _('use --hidden to access hidden revisions')
647 647
648 648 return error.FilteredRepoLookupError(msg, hint=hint)
649 649 msg = _("filtered revision '%s' (not in '%s' subset)")
650 650 msg %= (changeid, repo.filtername)
651 651 return error.FilteredRepoLookupError(msg)
652 652
653 653 def revsingle(repo, revspec, default='.', localalias=None):
654 654 if not revspec and revspec != 0:
655 655 return repo[default]
656 656
657 657 l = revrange(repo, [revspec], localalias=localalias)
658 658 if not l:
659 659 raise error.Abort(_('empty revision set'))
660 660 return repo[l.last()]
661 661
662 662 def _pairspec(revspec):
663 663 tree = revsetlang.parse(revspec)
664 664 return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall')
665 665
666 666 def revpair(repo, revs):
667 667 if not revs:
668 668 return repo['.'], repo[None]
669 669
670 670 l = revrange(repo, revs)
671 671
672 672 if not l:
673 673 first = second = None
674 674 elif l.isascending():
675 675 first = l.min()
676 676 second = l.max()
677 677 elif l.isdescending():
678 678 first = l.max()
679 679 second = l.min()
680 680 else:
681 681 first = l.first()
682 682 second = l.last()
683 683
684 684 if first is None:
685 685 raise error.Abort(_('empty revision range'))
686 686 if (first == second and len(revs) >= 2
687 687 and not all(revrange(repo, [r]) for r in revs)):
688 688 raise error.Abort(_('empty revision on one side of range'))
689 689
690 690 # if top-level is range expression, the result must always be a pair
691 691 if first == second and len(revs) == 1 and not _pairspec(revs[0]):
692 692 return repo[first], repo[None]
693 693
694 694 return repo[first], repo[second]
695 695
696 696 def revrange(repo, specs, localalias=None):
697 697 """Execute 1 to many revsets and return the union.
698 698
699 699 This is the preferred mechanism for executing revsets using user-specified
700 700 config options, such as revset aliases.
701 701
702 702 The revsets specified by ``specs`` will be executed via a chained ``OR``
703 703 expression. If ``specs`` is empty, an empty result is returned.
704 704
705 705 ``specs`` can contain integers, in which case they are assumed to be
706 706 revision numbers.
707 707
708 708 It is assumed the revsets are already formatted. If you have arguments
709 709 that need to be expanded in the revset, call ``revsetlang.formatspec()``
710 710 and pass the result as an element of ``specs``.
711 711
712 712 Specifying a single revset is allowed.
713 713
714 714 Returns a ``revset.abstractsmartset`` which is a list-like interface over
715 715 integer revisions.
716 716 """
717 717 allspecs = []
718 718 for spec in specs:
719 719 if isinstance(spec, int):
720 720 spec = revsetlang.formatspec('rev(%d)', spec)
721 721 allspecs.append(spec)
722 722 return repo.anyrevs(allspecs, user=True, localalias=localalias)
723 723
724 724 def meaningfulparents(repo, ctx):
725 725 """Return list of meaningful (or all if debug) parentrevs for rev.
726 726
727 727 For merges (two non-nullrev revisions) both parents are meaningful.
728 728 Otherwise the first parent revision is considered meaningful if it
729 729 is not the preceding revision.
730 730 """
731 731 parents = ctx.parents()
732 732 if len(parents) > 1:
733 733 return parents
734 734 if repo.ui.debugflag:
735 735 return [parents[0], repo[nullrev]]
736 736 if parents[0].rev() >= intrev(ctx) - 1:
737 737 return []
738 738 return parents
739 739
740 740 def expandpats(pats):
741 741 '''Expand bare globs when running on windows.
742 742 On posix we assume it already has already been done by sh.'''
743 743 if not util.expandglobs:
744 744 return list(pats)
745 745 ret = []
746 746 for kindpat in pats:
747 747 kind, pat = matchmod._patsplit(kindpat, None)
748 748 if kind is None:
749 749 try:
750 750 globbed = glob.glob(pat)
751 751 except re.error:
752 752 globbed = [pat]
753 753 if globbed:
754 754 ret.extend(globbed)
755 755 continue
756 756 ret.append(kindpat)
757 757 return ret
758 758
759 759 def matchandpats(ctx, pats=(), opts=None, globbed=False, default='relpath',
760 760 badfn=None):
761 761 '''Return a matcher and the patterns that were used.
762 762 The matcher will warn about bad matches, unless an alternate badfn callback
763 763 is provided.'''
764 764 if pats == ("",):
765 765 pats = []
766 766 if opts is None:
767 767 opts = {}
768 768 if not globbed and default == 'relpath':
769 769 pats = expandpats(pats or [])
770 770
771 771 def bad(f, msg):
772 772 ctx.repo().ui.warn("%s: %s\n" % (m.rel(f), msg))
773 773
774 774 if badfn is None:
775 775 badfn = bad
776 776
777 777 m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
778 778 default, listsubrepos=opts.get('subrepos'), badfn=badfn)
779 779
780 780 if m.always():
781 781 pats = []
782 782 return m, pats
783 783
784 784 def match(ctx, pats=(), opts=None, globbed=False, default='relpath',
785 785 badfn=None):
786 786 '''Return a matcher that will warn about bad matches.'''
787 787 return matchandpats(ctx, pats, opts, globbed, default, badfn=badfn)[0]
788 788
789 789 def matchall(repo):
790 790 '''Return a matcher that will efficiently match everything.'''
791 791 return matchmod.always(repo.root, repo.getcwd())
792 792
793 793 def matchfiles(repo, files, badfn=None):
794 794 '''Return a matcher that will efficiently match exactly these files.'''
795 795 return matchmod.exact(repo.root, repo.getcwd(), files, badfn=badfn)
796 796
797 797 def parsefollowlinespattern(repo, rev, pat, msg):
798 798 """Return a file name from `pat` pattern suitable for usage in followlines
799 799 logic.
800 800 """
801 801 if not matchmod.patkind(pat):
802 802 return pathutil.canonpath(repo.root, repo.getcwd(), pat)
803 803 else:
804 804 ctx = repo[rev]
805 805 m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=ctx)
806 806 files = [f for f in ctx if m(f)]
807 807 if len(files) != 1:
808 808 raise error.ParseError(msg)
809 809 return files[0]
810 810
811 811 def origpath(ui, repo, filepath):
812 812 '''customize where .orig files are created
813 813
814 814 Fetch user defined path from config file: [ui] origbackuppath = <path>
815 815 Fall back to default (filepath with .orig suffix) if not specified
816 816 '''
817 817 origbackuppath = ui.config('ui', 'origbackuppath')
818 818 if not origbackuppath:
819 819 return filepath + ".orig"
820 820
821 821 # Convert filepath from an absolute path into a path inside the repo.
822 822 filepathfromroot = util.normpath(os.path.relpath(filepath,
823 823 start=repo.root))
824 824
825 825 origvfs = vfs.vfs(repo.wjoin(origbackuppath))
826 826 origbackupdir = origvfs.dirname(filepathfromroot)
827 827 if not origvfs.isdir(origbackupdir) or origvfs.islink(origbackupdir):
828 828 ui.note(_('creating directory: %s\n') % origvfs.join(origbackupdir))
829 829
830 830 # Remove any files that conflict with the backup file's path
831 831 for f in reversed(list(util.finddirs(filepathfromroot))):
832 832 if origvfs.isfileorlink(f):
833 833 ui.note(_('removing conflicting file: %s\n')
834 834 % origvfs.join(f))
835 835 origvfs.unlink(f)
836 836 break
837 837
838 838 origvfs.makedirs(origbackupdir)
839 839
840 840 if origvfs.isdir(filepathfromroot) and not origvfs.islink(filepathfromroot):
841 841 ui.note(_('removing conflicting directory: %s\n')
842 842 % origvfs.join(filepathfromroot))
843 843 origvfs.rmtree(filepathfromroot, forcibly=True)
844 844
845 845 return origvfs.join(filepathfromroot)
846 846
847 847 class _containsnode(object):
848 848 """proxy __contains__(node) to container.__contains__ which accepts revs"""
849 849
850 850 def __init__(self, repo, revcontainer):
851 851 self._torev = repo.changelog.rev
852 852 self._revcontains = revcontainer.__contains__
853 853
854 854 def __contains__(self, node):
855 855 return self._revcontains(self._torev(node))
856 856
857 857 def cleanupnodes(repo, replacements, operation, moves=None, metadata=None,
858 858 fixphase=False, targetphase=None, backup=True):
859 859 """do common cleanups when old nodes are replaced by new nodes
860 860
861 861 That includes writing obsmarkers or stripping nodes, and moving bookmarks.
862 862 (we might also want to move working directory parent in the future)
863 863
864 864 By default, bookmark moves are calculated automatically from 'replacements',
865 865 but 'moves' can be used to override that. Also, 'moves' may include
866 866 additional bookmark moves that should not have associated obsmarkers.
867 867
868 868 replacements is {oldnode: [newnode]} or a iterable of nodes if they do not
869 869 have replacements. operation is a string, like "rebase".
870 870
871 871 metadata is dictionary containing metadata to be stored in obsmarker if
872 872 obsolescence is enabled.
873 873 """
874 874 assert fixphase or targetphase is None
875 875 if not replacements and not moves:
876 876 return
877 877
878 878 # translate mapping's other forms
879 879 if not util.safehasattr(replacements, 'items'):
880 880 replacements = {(n,): () for n in replacements}
881 881 else:
882 882 # upgrading non tuple "source" to tuple ones for BC
883 883 repls = {}
884 884 for key, value in replacements.items():
885 885 if not isinstance(key, tuple):
886 886 key = (key,)
887 887 repls[key] = value
888 888 replacements = repls
889 889
890 890 # Calculate bookmark movements
891 891 if moves is None:
892 892 moves = {}
893 893 # Unfiltered repo is needed since nodes in replacements might be hidden.
894 894 unfi = repo.unfiltered()
895 895 for oldnodes, newnodes in replacements.items():
896 896 for oldnode in oldnodes:
897 897 if oldnode in moves:
898 898 continue
899 899 if len(newnodes) > 1:
900 900 # usually a split, take the one with biggest rev number
901 901 newnode = next(unfi.set('max(%ln)', newnodes)).node()
902 902 elif len(newnodes) == 0:
903 903 # move bookmark backwards
904 904 allreplaced = []
905 905 for rep in replacements:
906 906 allreplaced.extend(rep)
907 907 roots = list(unfi.set('max((::%n) - %ln)', oldnode,
908 908 allreplaced))
909 909 if roots:
910 910 newnode = roots[0].node()
911 911 else:
912 912 newnode = nullid
913 913 else:
914 914 newnode = newnodes[0]
915 915 moves[oldnode] = newnode
916 916
917 917 allnewnodes = [n for ns in replacements.values() for n in ns]
918 918 toretract = {}
919 919 toadvance = {}
920 920 if fixphase:
921 921 precursors = {}
922 922 for oldnodes, newnodes in replacements.items():
923 923 for oldnode in oldnodes:
924 924 for newnode in newnodes:
925 925 precursors.setdefault(newnode, []).append(oldnode)
926 926
927 927 allnewnodes.sort(key=lambda n: unfi[n].rev())
928 928 newphases = {}
929 929 def phase(ctx):
930 930 return newphases.get(ctx.node(), ctx.phase())
931 931 for newnode in allnewnodes:
932 932 ctx = unfi[newnode]
933 933 parentphase = max(phase(p) for p in ctx.parents())
934 934 if targetphase is None:
935 935 oldphase = max(unfi[oldnode].phase()
936 936 for oldnode in precursors[newnode])
937 937 newphase = max(oldphase, parentphase)
938 938 else:
939 939 newphase = max(targetphase, parentphase)
940 940 newphases[newnode] = newphase
941 941 if newphase > ctx.phase():
942 942 toretract.setdefault(newphase, []).append(newnode)
943 943 elif newphase < ctx.phase():
944 944 toadvance.setdefault(newphase, []).append(newnode)
945 945
946 946 with repo.transaction('cleanup') as tr:
947 947 # Move bookmarks
948 948 bmarks = repo._bookmarks
949 949 bmarkchanges = []
950 950 for oldnode, newnode in moves.items():
951 951 oldbmarks = repo.nodebookmarks(oldnode)
952 952 if not oldbmarks:
953 953 continue
954 954 from . import bookmarks # avoid import cycle
955 955 repo.ui.debug('moving bookmarks %r from %s to %s\n' %
956 956 (pycompat.rapply(pycompat.maybebytestr, oldbmarks),
957 957 hex(oldnode), hex(newnode)))
958 958 # Delete divergent bookmarks being parents of related newnodes
959 959 deleterevs = repo.revs('parents(roots(%ln & (::%n))) - parents(%n)',
960 960 allnewnodes, newnode, oldnode)
961 961 deletenodes = _containsnode(repo, deleterevs)
962 962 for name in oldbmarks:
963 963 bmarkchanges.append((name, newnode))
964 964 for b in bookmarks.divergent2delete(repo, deletenodes, name):
965 965 bmarkchanges.append((b, None))
966 966
967 967 if bmarkchanges:
968 968 bmarks.applychanges(repo, tr, bmarkchanges)
969 969
970 970 for phase, nodes in toretract.items():
971 971 phases.retractboundary(repo, tr, phase, nodes)
972 972 for phase, nodes in toadvance.items():
973 973 phases.advanceboundary(repo, tr, phase, nodes)
974 974
975 975 # Obsolete or strip nodes
976 976 if obsolete.isenabled(repo, obsolete.createmarkersopt):
977 977 # If a node is already obsoleted, and we want to obsolete it
978 978 # without a successor, skip that obssolete request since it's
979 979 # unnecessary. That's the "if s or not isobs(n)" check below.
980 980 # Also sort the node in topology order, that might be useful for
981 981 # some obsstore logic.
982 982 # NOTE: the filtering and sorting might belong to createmarkers.
983 983 isobs = unfi.obsstore.successors.__contains__
984 984 torev = unfi.changelog.rev
985 985 sortfunc = lambda ns: torev(ns[0][0])
986 986 rels = []
987 987 for ns, s in sorted(replacements.items(), key=sortfunc):
988 988 for n in ns:
989 989 if s or not isobs(n):
990 990 rel = (unfi[n], tuple(unfi[m] for m in s))
991 991 rels.append(rel)
992 992 if rels:
993 993 obsolete.createmarkers(repo, rels, operation=operation,
994 994 metadata=metadata)
995 995 else:
996 996 from . import repair # avoid import cycle
997 997 tostrip = list(n for ns in replacements for n in ns)
998 998 if tostrip:
999 999 repair.delayedstrip(repo.ui, repo, tostrip, operation,
1000 1000 backup=backup)
1001 1001
1002 1002 def addremove(repo, matcher, prefix, opts=None):
1003 1003 if opts is None:
1004 1004 opts = {}
1005 1005 m = matcher
1006 1006 dry_run = opts.get('dry_run')
1007 1007 try:
1008 1008 similarity = float(opts.get('similarity') or 0)
1009 1009 except ValueError:
1010 1010 raise error.Abort(_('similarity must be a number'))
1011 1011 if similarity < 0 or similarity > 100:
1012 1012 raise error.Abort(_('similarity must be between 0 and 100'))
1013 1013 similarity /= 100.0
1014 1014
1015 1015 ret = 0
1016 1016 join = lambda f: os.path.join(prefix, f)
1017 1017
1018 1018 wctx = repo[None]
1019 1019 for subpath in sorted(wctx.substate):
1020 1020 submatch = matchmod.subdirmatcher(subpath, m)
1021 1021 if opts.get('subrepos') or m.exact(subpath) or any(submatch.files()):
1022 1022 sub = wctx.sub(subpath)
1023 1023 try:
1024 1024 if sub.addremove(submatch, prefix, opts):
1025 1025 ret = 1
1026 1026 except error.LookupError:
1027 1027 repo.ui.status(_("skipping missing subrepository: %s\n")
1028 1028 % join(subpath))
1029 1029
1030 1030 rejected = []
1031 1031 def badfn(f, msg):
1032 1032 if f in m.files():
1033 1033 m.bad(f, msg)
1034 1034 rejected.append(f)
1035 1035
1036 1036 badmatch = matchmod.badmatch(m, badfn)
1037 1037 added, unknown, deleted, removed, forgotten = _interestingfiles(repo,
1038 1038 badmatch)
1039 1039
1040 1040 unknownset = set(unknown + forgotten)
1041 1041 toprint = unknownset.copy()
1042 1042 toprint.update(deleted)
1043 1043 for abs in sorted(toprint):
1044 1044 if repo.ui.verbose or not m.exact(abs):
1045 1045 if abs in unknownset:
1046 1046 status = _('adding %s\n') % m.uipath(abs)
1047 1047 label = 'addremove.added'
1048 1048 else:
1049 1049 status = _('removing %s\n') % m.uipath(abs)
1050 1050 label = 'addremove.removed'
1051 1051 repo.ui.status(status, label=label)
1052 1052
1053 1053 renames = _findrenames(repo, m, added + unknown, removed + deleted,
1054 1054 similarity)
1055 1055
1056 1056 if not dry_run:
1057 1057 _markchanges(repo, unknown + forgotten, deleted, renames)
1058 1058
1059 1059 for f in rejected:
1060 1060 if f in m.files():
1061 1061 return 1
1062 1062 return ret
1063 1063
1064 1064 def marktouched(repo, files, similarity=0.0):
1065 1065 '''Assert that files have somehow been operated upon. files are relative to
1066 1066 the repo root.'''
1067 1067 m = matchfiles(repo, files, badfn=lambda x, y: rejected.append(x))
1068 1068 rejected = []
1069 1069
1070 1070 added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m)
1071 1071
1072 1072 if repo.ui.verbose:
1073 1073 unknownset = set(unknown + forgotten)
1074 1074 toprint = unknownset.copy()
1075 1075 toprint.update(deleted)
1076 1076 for abs in sorted(toprint):
1077 1077 if abs in unknownset:
1078 1078 status = _('adding %s\n') % abs
1079 1079 else:
1080 1080 status = _('removing %s\n') % abs
1081 1081 repo.ui.status(status)
1082 1082
1083 1083 renames = _findrenames(repo, m, added + unknown, removed + deleted,
1084 1084 similarity)
1085 1085
1086 1086 _markchanges(repo, unknown + forgotten, deleted, renames)
1087 1087
1088 1088 for f in rejected:
1089 1089 if f in m.files():
1090 1090 return 1
1091 1091 return 0
1092 1092
1093 1093 def _interestingfiles(repo, matcher):
1094 1094 '''Walk dirstate with matcher, looking for files that addremove would care
1095 1095 about.
1096 1096
1097 1097 This is different from dirstate.status because it doesn't care about
1098 1098 whether files are modified or clean.'''
1099 1099 added, unknown, deleted, removed, forgotten = [], [], [], [], []
1100 1100 audit_path = pathutil.pathauditor(repo.root, cached=True)
1101 1101
1102 1102 ctx = repo[None]
1103 1103 dirstate = repo.dirstate
1104 1104 walkresults = dirstate.walk(matcher, subrepos=sorted(ctx.substate),
1105 1105 unknown=True, ignored=False, full=False)
1106 1106 for abs, st in walkresults.iteritems():
1107 1107 dstate = dirstate[abs]
1108 1108 if dstate == '?' and audit_path.check(abs):
1109 1109 unknown.append(abs)
1110 1110 elif dstate != 'r' and not st:
1111 1111 deleted.append(abs)
1112 1112 elif dstate == 'r' and st:
1113 1113 forgotten.append(abs)
1114 1114 # for finding renames
1115 1115 elif dstate == 'r' and not st:
1116 1116 removed.append(abs)
1117 1117 elif dstate == 'a':
1118 1118 added.append(abs)
1119 1119
1120 1120 return added, unknown, deleted, removed, forgotten
1121 1121
1122 1122 def _findrenames(repo, matcher, added, removed, similarity):
1123 1123 '''Find renames from removed files to added ones.'''
1124 1124 renames = {}
1125 1125 if similarity > 0:
1126 1126 for old, new, score in similar.findrenames(repo, added, removed,
1127 1127 similarity):
1128 1128 if (repo.ui.verbose or not matcher.exact(old)
1129 1129 or not matcher.exact(new)):
1130 1130 repo.ui.status(_('recording removal of %s as rename to %s '
1131 1131 '(%d%% similar)\n') %
1132 1132 (matcher.rel(old), matcher.rel(new),
1133 1133 score * 100))
1134 1134 renames[new] = old
1135 1135 return renames
1136 1136
1137 1137 def _markchanges(repo, unknown, deleted, renames):
1138 1138 '''Marks the files in unknown as added, the files in deleted as removed,
1139 1139 and the files in renames as copied.'''
1140 1140 wctx = repo[None]
1141 1141 with repo.wlock():
1142 1142 wctx.forget(deleted)
1143 1143 wctx.add(unknown)
1144 1144 for new, old in renames.iteritems():
1145 1145 wctx.copy(old, new)
1146 1146
1147 1147 def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None):
1148 1148 """Update the dirstate to reflect the intent of copying src to dst. For
1149 1149 different reasons it might not end with dst being marked as copied from src.
1150 1150 """
1151 1151 origsrc = repo.dirstate.copied(src) or src
1152 1152 if dst == origsrc: # copying back a copy?
1153 1153 if repo.dirstate[dst] not in 'mn' and not dryrun:
1154 1154 repo.dirstate.normallookup(dst)
1155 1155 else:
1156 1156 if repo.dirstate[origsrc] == 'a' and origsrc == src:
1157 1157 if not ui.quiet:
1158 1158 ui.warn(_("%s has not been committed yet, so no copy "
1159 1159 "data will be stored for %s.\n")
1160 1160 % (repo.pathto(origsrc, cwd), repo.pathto(dst, cwd)))
1161 1161 if repo.dirstate[dst] in '?r' and not dryrun:
1162 1162 wctx.add([dst])
1163 1163 elif not dryrun:
1164 1164 wctx.copy(origsrc, dst)
1165 1165
1166 1166 def writerequires(opener, requirements):
1167 1167 with opener('requires', 'w') as fp:
1168 1168 for r in sorted(requirements):
1169 1169 fp.write("%s\n" % r)
1170 1170
1171 1171 class filecachesubentry(object):
1172 1172 def __init__(self, path, stat):
1173 1173 self.path = path
1174 1174 self.cachestat = None
1175 1175 self._cacheable = None
1176 1176
1177 1177 if stat:
1178 1178 self.cachestat = filecachesubentry.stat(self.path)
1179 1179
1180 1180 if self.cachestat:
1181 1181 self._cacheable = self.cachestat.cacheable()
1182 1182 else:
1183 1183 # None means we don't know yet
1184 1184 self._cacheable = None
1185 1185
1186 1186 def refresh(self):
1187 1187 if self.cacheable():
1188 1188 self.cachestat = filecachesubentry.stat(self.path)
1189 1189
1190 1190 def cacheable(self):
1191 1191 if self._cacheable is not None:
1192 1192 return self._cacheable
1193 1193
1194 1194 # we don't know yet, assume it is for now
1195 1195 return True
1196 1196
1197 1197 def changed(self):
1198 1198 # no point in going further if we can't cache it
1199 1199 if not self.cacheable():
1200 1200 return True
1201 1201
1202 1202 newstat = filecachesubentry.stat(self.path)
1203 1203
1204 1204 # we may not know if it's cacheable yet, check again now
1205 1205 if newstat and self._cacheable is None:
1206 1206 self._cacheable = newstat.cacheable()
1207 1207
1208 1208 # check again
1209 1209 if not self._cacheable:
1210 1210 return True
1211 1211
1212 1212 if self.cachestat != newstat:
1213 1213 self.cachestat = newstat
1214 1214 return True
1215 1215 else:
1216 1216 return False
1217 1217
1218 1218 @staticmethod
1219 1219 def stat(path):
1220 1220 try:
1221 1221 return util.cachestat(path)
1222 1222 except OSError as e:
1223 1223 if e.errno != errno.ENOENT:
1224 1224 raise
1225 1225
1226 1226 class filecacheentry(object):
1227 1227 def __init__(self, paths, stat=True):
1228 1228 self._entries = []
1229 1229 for path in paths:
1230 1230 self._entries.append(filecachesubentry(path, stat))
1231 1231
1232 1232 def changed(self):
1233 1233 '''true if any entry has changed'''
1234 1234 for entry in self._entries:
1235 1235 if entry.changed():
1236 1236 return True
1237 1237 return False
1238 1238
1239 1239 def refresh(self):
1240 1240 for entry in self._entries:
1241 1241 entry.refresh()
1242 1242
1243 1243 class filecache(object):
1244 1244 """A property like decorator that tracks files under .hg/ for updates.
1245 1245
1246 1246 On first access, the files defined as arguments are stat()ed and the
1247 1247 results cached. The decorated function is called. The results are stashed
1248 1248 away in a ``_filecache`` dict on the object whose method is decorated.
1249 1249
1250 1250 On subsequent access, the cached result is returned.
1251 1251
1252 1252 On external property set operations, stat() calls are performed and the new
1253 1253 value is cached.
1254 1254
1255 1255 On property delete operations, cached data is removed.
1256 1256
1257 1257 When using the property API, cached data is always returned, if available:
1258 1258 no stat() is performed to check if the file has changed and if the function
1259 1259 needs to be called to reflect file changes.
1260 1260
1261 1261 Others can muck about with the state of the ``_filecache`` dict. e.g. they
1262 1262 can populate an entry before the property's getter is called. In this case,
1263 1263 entries in ``_filecache`` will be used during property operations,
1264 1264 if available. If the underlying file changes, it is up to external callers
1265 1265 to reflect this by e.g. calling ``delattr(obj, attr)`` to remove the cached
1266 1266 method result as well as possibly calling ``del obj._filecache[attr]`` to
1267 1267 remove the ``filecacheentry``.
1268 1268 """
1269 1269
1270 1270 def __init__(self, *paths):
1271 1271 self.paths = paths
1272 1272
1273 1273 def join(self, obj, fname):
1274 1274 """Used to compute the runtime path of a cached file.
1275 1275
1276 1276 Users should subclass filecache and provide their own version of this
1277 1277 function to call the appropriate join function on 'obj' (an instance
1278 1278 of the class that its member function was decorated).
1279 1279 """
1280 1280 raise NotImplementedError
1281 1281
1282 1282 def __call__(self, func):
1283 1283 self.func = func
1284 1284 self.sname = func.__name__
1285 1285 self.name = pycompat.sysbytes(self.sname)
1286 1286 return self
1287 1287
1288 1288 def __get__(self, obj, type=None):
1289 1289 # if accessed on the class, return the descriptor itself.
1290 1290 if obj is None:
1291 1291 return self
1292 1292 # do we need to check if the file changed?
1293 1293 if self.sname in obj.__dict__:
1294 1294 assert self.name in obj._filecache, self.name
1295 1295 return obj.__dict__[self.sname]
1296 1296
1297 1297 entry = obj._filecache.get(self.name)
1298 1298
1299 1299 if entry:
1300 1300 if entry.changed():
1301 1301 entry.obj = self.func(obj)
1302 1302 else:
1303 1303 paths = [self.join(obj, path) for path in self.paths]
1304 1304
1305 1305 # We stat -before- creating the object so our cache doesn't lie if
1306 1306 # a writer modified between the time we read and stat
1307 1307 entry = filecacheentry(paths, True)
1308 1308 entry.obj = self.func(obj)
1309 1309
1310 1310 obj._filecache[self.name] = entry
1311 1311
1312 1312 obj.__dict__[self.sname] = entry.obj
1313 1313 return entry.obj
1314 1314
1315 1315 def __set__(self, obj, value):
1316 1316 if self.name not in obj._filecache:
1317 1317 # we add an entry for the missing value because X in __dict__
1318 1318 # implies X in _filecache
1319 1319 paths = [self.join(obj, path) for path in self.paths]
1320 1320 ce = filecacheentry(paths, False)
1321 1321 obj._filecache[self.name] = ce
1322 1322 else:
1323 1323 ce = obj._filecache[self.name]
1324 1324
1325 1325 ce.obj = value # update cached copy
1326 1326 obj.__dict__[self.sname] = value # update copy returned by obj.x
1327 1327
1328 1328 def __delete__(self, obj):
1329 1329 try:
1330 1330 del obj.__dict__[self.sname]
1331 1331 except KeyError:
1332 1332 raise AttributeError(self.sname)
1333 1333
1334 1334 def extdatasource(repo, source):
1335 1335 """Gather a map of rev -> value dict from the specified source
1336 1336
1337 1337 A source spec is treated as a URL, with a special case shell: type
1338 1338 for parsing the output from a shell command.
1339 1339
1340 1340 The data is parsed as a series of newline-separated records where
1341 1341 each record is a revision specifier optionally followed by a space
1342 1342 and a freeform string value. If the revision is known locally, it
1343 1343 is converted to a rev, otherwise the record is skipped.
1344 1344
1345 1345 Note that both key and value are treated as UTF-8 and converted to
1346 1346 the local encoding. This allows uniformity between local and
1347 1347 remote data sources.
1348 1348 """
1349 1349
1350 1350 spec = repo.ui.config("extdata", source)
1351 1351 if not spec:
1352 1352 raise error.Abort(_("unknown extdata source '%s'") % source)
1353 1353
1354 1354 data = {}
1355 1355 src = proc = None
1356 1356 try:
1357 1357 if spec.startswith("shell:"):
1358 1358 # external commands should be run relative to the repo root
1359 1359 cmd = spec[6:]
1360 1360 proc = subprocess.Popen(procutil.tonativestr(cmd),
1361 1361 shell=True, bufsize=-1,
1362 1362 close_fds=procutil.closefds,
1363 1363 stdout=subprocess.PIPE,
1364 1364 cwd=procutil.tonativestr(repo.root))
1365 1365 src = proc.stdout
1366 1366 else:
1367 1367 # treat as a URL or file
1368 1368 src = url.open(repo.ui, spec)
1369 1369 for l in src:
1370 1370 if " " in l:
1371 1371 k, v = l.strip().split(" ", 1)
1372 1372 else:
1373 1373 k, v = l.strip(), ""
1374 1374
1375 1375 k = encoding.tolocal(k)
1376 1376 try:
1377 1377 data[revsingle(repo, k).rev()] = encoding.tolocal(v)
1378 1378 except (error.LookupError, error.RepoLookupError):
1379 1379 pass # we ignore data for nodes that don't exist locally
1380 1380 finally:
1381 1381 if proc:
1382 1382 proc.communicate()
1383 1383 if src:
1384 1384 src.close()
1385 1385 if proc and proc.returncode != 0:
1386 1386 raise error.Abort(_("extdata command '%s' failed: %s")
1387 1387 % (cmd, procutil.explainexit(proc.returncode)))
1388 1388
1389 1389 return data
1390 1390
1391 1391 def _locksub(repo, lock, envvar, cmd, environ=None, *args, **kwargs):
1392 1392 if lock is None:
1393 1393 raise error.LockInheritanceContractViolation(
1394 1394 'lock can only be inherited while held')
1395 1395 if environ is None:
1396 1396 environ = {}
1397 1397 with lock.inherit() as locker:
1398 1398 environ[envvar] = locker
1399 1399 return repo.ui.system(cmd, environ=environ, *args, **kwargs)
1400 1400
1401 1401 def wlocksub(repo, cmd, *args, **kwargs):
1402 1402 """run cmd as a subprocess that allows inheriting repo's wlock
1403 1403
1404 1404 This can only be called while the wlock is held. This takes all the
1405 1405 arguments that ui.system does, and returns the exit code of the
1406 1406 subprocess."""
1407 1407 return _locksub(repo, repo.currentwlock(), 'HG_WLOCK_LOCKER', cmd, *args,
1408 1408 **kwargs)
1409 1409
1410 1410 class progress(object):
1411 1411 def __init__(self, ui, topic, unit="", total=None):
1412 1412 self.ui = ui
1413 1413 self.pos = 0
1414 1414 self.topic = topic
1415 1415 self.unit = unit
1416 1416 self.total = total
1417 1417
1418 1418 def __enter__(self):
1419 1419 return self
1420 1420
1421 1421 def __exit__(self, exc_type, exc_value, exc_tb):
1422 1422 self.complete()
1423 1423
1424 1424 def update(self, pos, item="", total=None):
1425 1425 assert pos is not None
1426 1426 if total:
1427 1427 self.total = total
1428 1428 self.pos = pos
1429 1429 self._print(item)
1430 1430
1431 1431 def increment(self, step=1, item="", total=None):
1432 1432 self.update(self.pos + step, item, total)
1433 1433
1434 1434 def complete(self):
1435 1435 self.ui.progress(self.topic, None)
1436 1436
1437 1437 def _print(self, item):
1438 1438 self.ui.progress(self.topic, self.pos, item, self.unit,
1439 1439 self.total)
1440 1440
1441 1441 def gdinitconfig(ui):
1442 1442 """helper function to know if a repo should be created as general delta
1443 1443 """
1444 1444 # experimental config: format.generaldelta
1445 1445 return (ui.configbool('format', 'generaldelta')
1446 1446 or ui.configbool('format', 'usegeneraldelta')
1447 1447 or ui.configbool('format', 'sparse-revlog'))
1448 1448
1449 1449 def gddeltaconfig(ui):
1450 1450 """helper function to know if incoming delta should be optimised
1451 1451 """
1452 1452 # experimental config: format.generaldelta
1453 1453 return ui.configbool('format', 'generaldelta')
1454 1454
1455 1455 class simplekeyvaluefile(object):
1456 1456 """A simple file with key=value lines
1457 1457
1458 1458 Keys must be alphanumerics and start with a letter, values must not
1459 1459 contain '\n' characters"""
1460 1460 firstlinekey = '__firstline'
1461 1461
1462 1462 def __init__(self, vfs, path, keys=None):
1463 1463 self.vfs = vfs
1464 1464 self.path = path
1465 1465
1466 1466 def read(self, firstlinenonkeyval=False):
1467 1467 """Read the contents of a simple key-value file
1468 1468
1469 1469 'firstlinenonkeyval' indicates whether the first line of file should
1470 1470 be treated as a key-value pair or reuturned fully under the
1471 1471 __firstline key."""
1472 1472 lines = self.vfs.readlines(self.path)
1473 1473 d = {}
1474 1474 if firstlinenonkeyval:
1475 1475 if not lines:
1476 1476 e = _("empty simplekeyvalue file")
1477 1477 raise error.CorruptedState(e)
1478 1478 # we don't want to include '\n' in the __firstline
1479 1479 d[self.firstlinekey] = lines[0][:-1]
1480 1480 del lines[0]
1481 1481
1482 1482 try:
1483 1483 # the 'if line.strip()' part prevents us from failing on empty
1484 1484 # lines which only contain '\n' therefore are not skipped
1485 1485 # by 'if line'
1486 1486 updatedict = dict(line[:-1].split('=', 1) for line in lines
1487 1487 if line.strip())
1488 1488 if self.firstlinekey in updatedict:
1489 1489 e = _("%r can't be used as a key")
1490 1490 raise error.CorruptedState(e % self.firstlinekey)
1491 1491 d.update(updatedict)
1492 1492 except ValueError as e:
1493 1493 raise error.CorruptedState(str(e))
1494 1494 return d
1495 1495
1496 1496 def write(self, data, firstline=None):
1497 1497 """Write key=>value mapping to a file
1498 1498 data is a dict. Keys must be alphanumerical and start with a letter.
1499 1499 Values must not contain newline characters.
1500 1500
1501 1501 If 'firstline' is not None, it is written to file before
1502 1502 everything else, as it is, not in a key=value form"""
1503 1503 lines = []
1504 1504 if firstline is not None:
1505 1505 lines.append('%s\n' % firstline)
1506 1506
1507 1507 for k, v in data.items():
1508 1508 if k == self.firstlinekey:
1509 1509 e = "key name '%s' is reserved" % self.firstlinekey
1510 1510 raise error.ProgrammingError(e)
1511 1511 if not k[0:1].isalpha():
1512 1512 e = "keys must start with a letter in a key-value file"
1513 1513 raise error.ProgrammingError(e)
1514 1514 if not k.isalnum():
1515 1515 e = "invalid key name in a simple key-value file"
1516 1516 raise error.ProgrammingError(e)
1517 1517 if '\n' in v:
1518 1518 e = "invalid value in a simple key-value file"
1519 1519 raise error.ProgrammingError(e)
1520 1520 lines.append("%s=%s\n" % (k, v))
1521 1521 with self.vfs(self.path, mode='wb', atomictemp=True) as fp:
1522 1522 fp.write(''.join(lines))
1523 1523
1524 1524 _reportobsoletedsource = [
1525 1525 'debugobsolete',
1526 1526 'pull',
1527 1527 'push',
1528 1528 'serve',
1529 1529 'unbundle',
1530 1530 ]
1531 1531
1532 1532 _reportnewcssource = [
1533 1533 'pull',
1534 1534 'unbundle',
1535 1535 ]
1536 1536
1537 1537 def prefetchfiles(repo, revs, match):
1538 1538 """Invokes the registered file prefetch functions, allowing extensions to
1539 1539 ensure the corresponding files are available locally, before the command
1540 1540 uses them."""
1541 1541 if match:
1542 1542 # The command itself will complain about files that don't exist, so
1543 1543 # don't duplicate the message.
1544 1544 match = matchmod.badmatch(match, lambda fn, msg: None)
1545 1545 else:
1546 1546 match = matchall(repo)
1547 1547
1548 1548 fileprefetchhooks(repo, revs, match)
1549 1549
1550 1550 # a list of (repo, revs, match) prefetch functions
1551 1551 fileprefetchhooks = util.hooks()
1552 1552
1553 1553 # A marker that tells the evolve extension to suppress its own reporting
1554 1554 _reportstroubledchangesets = True
1555 1555
1556 1556 def registersummarycallback(repo, otr, txnname=''):
1557 1557 """register a callback to issue a summary after the transaction is closed
1558 1558 """
1559 1559 def txmatch(sources):
1560 1560 return any(txnname.startswith(source) for source in sources)
1561 1561
1562 1562 categories = []
1563 1563
1564 1564 def reportsummary(func):
1565 1565 """decorator for report callbacks."""
1566 1566 # The repoview life cycle is shorter than the one of the actual
1567 1567 # underlying repository. So the filtered object can die before the
1568 1568 # weakref is used leading to troubles. We keep a reference to the
1569 1569 # unfiltered object and restore the filtering when retrieving the
1570 1570 # repository through the weakref.
1571 1571 filtername = repo.filtername
1572 1572 reporef = weakref.ref(repo.unfiltered())
1573 1573 def wrapped(tr):
1574 1574 repo = reporef()
1575 1575 if filtername:
1576 1576 repo = repo.filtered(filtername)
1577 1577 func(repo, tr)
1578 1578 newcat = '%02i-txnreport' % len(categories)
1579 1579 otr.addpostclose(newcat, wrapped)
1580 1580 categories.append(newcat)
1581 1581 return wrapped
1582 1582
1583 1583 if txmatch(_reportobsoletedsource):
1584 1584 @reportsummary
1585 1585 def reportobsoleted(repo, tr):
1586 1586 obsoleted = obsutil.getobsoleted(repo, tr)
1587 1587 if obsoleted:
1588 1588 repo.ui.status(_('obsoleted %i changesets\n')
1589 1589 % len(obsoleted))
1590 1590
1591 1591 if (obsolete.isenabled(repo, obsolete.createmarkersopt) and
1592 1592 repo.ui.configbool('experimental', 'evolution.report-instabilities')):
1593 1593 instabilitytypes = [
1594 1594 ('orphan', 'orphan'),
1595 1595 ('phase-divergent', 'phasedivergent'),
1596 1596 ('content-divergent', 'contentdivergent'),
1597 1597 ]
1598 1598
1599 1599 def getinstabilitycounts(repo):
1600 1600 filtered = repo.changelog.filteredrevs
1601 1601 counts = {}
1602 1602 for instability, revset in instabilitytypes:
1603 1603 counts[instability] = len(set(obsolete.getrevs(repo, revset)) -
1604 1604 filtered)
1605 1605 return counts
1606 1606
1607 1607 oldinstabilitycounts = getinstabilitycounts(repo)
1608 1608 @reportsummary
1609 1609 def reportnewinstabilities(repo, tr):
1610 1610 newinstabilitycounts = getinstabilitycounts(repo)
1611 1611 for instability, revset in instabilitytypes:
1612 1612 delta = (newinstabilitycounts[instability] -
1613 1613 oldinstabilitycounts[instability])
1614 1614 msg = getinstabilitymessage(delta, instability)
1615 1615 if msg:
1616 1616 repo.ui.warn(msg)
1617 1617
1618 1618 if txmatch(_reportnewcssource):
1619 1619 @reportsummary
1620 1620 def reportnewcs(repo, tr):
1621 1621 """Report the range of new revisions pulled/unbundled."""
1622 1622 origrepolen = tr.changes.get('origrepolen', len(repo))
1623 1623 unfi = repo.unfiltered()
1624 1624 if origrepolen >= len(unfi):
1625 1625 return
1626 1626
1627 1627 # Compute the bounds of new visible revisions' range.
1628 1628 revs = smartset.spanset(repo, start=origrepolen)
1629 1629 if revs:
1630 1630 minrev, maxrev = repo[revs.min()], repo[revs.max()]
1631 1631
1632 1632 if minrev == maxrev:
1633 1633 revrange = minrev
1634 1634 else:
1635 1635 revrange = '%s:%s' % (minrev, maxrev)
1636 1636 draft = len(repo.revs('%ld and draft()', revs))
1637 1637 secret = len(repo.revs('%ld and secret()', revs))
1638 1638 if not (draft or secret):
1639 1639 msg = _('new changesets %s\n') % revrange
1640 1640 elif draft and secret:
1641 1641 msg = _('new changesets %s (%d drafts, %d secrets)\n')
1642 1642 msg %= (revrange, draft, secret)
1643 1643 elif draft:
1644 1644 msg = _('new changesets %s (%d drafts)\n')
1645 1645 msg %= (revrange, draft)
1646 1646 elif secret:
1647 1647 msg = _('new changesets %s (%d secrets)\n')
1648 1648 msg %= (revrange, secret)
1649 1649 else:
1650 1650 errormsg = 'entered unreachable condition'
1651 1651 raise error.ProgrammingError(errormsg)
1652 1652 repo.ui.status(msg)
1653 1653
1654 # search new changesets directly pulled as obsolete
1655 obsadded = unfi.revs('%d: and obsolete()', origrepolen)
1656 cl = repo.changelog
1657 extinctadded = [r for r in obsadded if r not in cl]
1658 if extinctadded:
1659 # They are not just obsolete, but obsolete and invisible
1660 # we call them "extinct" internally but the terms have not been
1661 # exposed to users.
1662 msg = '(%d other changesets obsolete on arrival)\n'
1663 repo.ui.status(msg % len(extinctadded))
1664
1654 1665 @reportsummary
1655 1666 def reportphasechanges(repo, tr):
1656 1667 """Report statistics of phase changes for changesets pre-existing
1657 1668 pull/unbundle.
1658 1669 """
1659 1670 origrepolen = tr.changes.get('origrepolen', len(repo))
1660 1671 phasetracking = tr.changes.get('phases', {})
1661 1672 if not phasetracking:
1662 1673 return
1663 1674 published = [
1664 1675 rev for rev, (old, new) in phasetracking.iteritems()
1665 1676 if new == phases.public and rev < origrepolen
1666 1677 ]
1667 1678 if not published:
1668 1679 return
1669 1680 repo.ui.status(_('%d local changesets published\n')
1670 1681 % len(published))
1671 1682
1672 1683 def getinstabilitymessage(delta, instability):
1673 1684 """function to return the message to show warning about new instabilities
1674 1685
1675 1686 exists as a separate function so that extension can wrap to show more
1676 1687 information like how to fix instabilities"""
1677 1688 if delta > 0:
1678 1689 return _('%i new %s changesets\n') % (delta, instability)
1679 1690
1680 1691 def nodesummaries(repo, nodes, maxnumnodes=4):
1681 1692 if len(nodes) <= maxnumnodes or repo.ui.verbose:
1682 1693 return ' '.join(short(h) for h in nodes)
1683 1694 first = ' '.join(short(h) for h in nodes[:maxnumnodes])
1684 1695 return _("%s and %d others") % (first, len(nodes) - maxnumnodes)
1685 1696
1686 1697 def enforcesinglehead(repo, tr, desc):
1687 1698 """check that no named branch has multiple heads"""
1688 1699 if desc in ('strip', 'repair'):
1689 1700 # skip the logic during strip
1690 1701 return
1691 1702 visible = repo.filtered('visible')
1692 1703 # possible improvement: we could restrict the check to affected branch
1693 1704 for name, heads in visible.branchmap().iteritems():
1694 1705 if len(heads) > 1:
1695 1706 msg = _('rejecting multiple heads on branch "%s"')
1696 1707 msg %= name
1697 1708 hint = _('%d heads: %s')
1698 1709 hint %= (len(heads), nodesummaries(repo, heads))
1699 1710 raise error.Abort(msg, hint=hint)
1700 1711
1701 1712 def wrapconvertsink(sink):
1702 1713 """Allow extensions to wrap the sink returned by convcmd.convertsink()
1703 1714 before it is used, whether or not the convert extension was formally loaded.
1704 1715 """
1705 1716 return sink
1706 1717
1707 1718 def unhidehashlikerevs(repo, specs, hiddentype):
1708 1719 """parse the user specs and unhide changesets whose hash or revision number
1709 1720 is passed.
1710 1721
1711 1722 hiddentype can be: 1) 'warn': warn while unhiding changesets
1712 1723 2) 'nowarn': don't warn while unhiding changesets
1713 1724
1714 1725 returns a repo object with the required changesets unhidden
1715 1726 """
1716 1727 if not repo.filtername or not repo.ui.configbool('experimental',
1717 1728 'directaccess'):
1718 1729 return repo
1719 1730
1720 1731 if repo.filtername not in ('visible', 'visible-hidden'):
1721 1732 return repo
1722 1733
1723 1734 symbols = set()
1724 1735 for spec in specs:
1725 1736 try:
1726 1737 tree = revsetlang.parse(spec)
1727 1738 except error.ParseError: # will be reported by scmutil.revrange()
1728 1739 continue
1729 1740
1730 1741 symbols.update(revsetlang.gethashlikesymbols(tree))
1731 1742
1732 1743 if not symbols:
1733 1744 return repo
1734 1745
1735 1746 revs = _getrevsfromsymbols(repo, symbols)
1736 1747
1737 1748 if not revs:
1738 1749 return repo
1739 1750
1740 1751 if hiddentype == 'warn':
1741 1752 unfi = repo.unfiltered()
1742 1753 revstr = ", ".join([pycompat.bytestr(unfi[l]) for l in revs])
1743 1754 repo.ui.warn(_("warning: accessing hidden changesets for write "
1744 1755 "operation: %s\n") % revstr)
1745 1756
1746 1757 # we have to use new filtername to separate branch/tags cache until we can
1747 1758 # disbale these cache when revisions are dynamically pinned.
1748 1759 return repo.filtered('visible-hidden', revs)
1749 1760
1750 1761 def _getrevsfromsymbols(repo, symbols):
1751 1762 """parse the list of symbols and returns a set of revision numbers of hidden
1752 1763 changesets present in symbols"""
1753 1764 revs = set()
1754 1765 unfi = repo.unfiltered()
1755 1766 unficl = unfi.changelog
1756 1767 cl = repo.changelog
1757 1768 tiprev = len(unficl)
1758 1769 allowrevnums = repo.ui.configbool('experimental', 'directaccess.revnums')
1759 1770 for s in symbols:
1760 1771 try:
1761 1772 n = int(s)
1762 1773 if n <= tiprev:
1763 1774 if not allowrevnums:
1764 1775 continue
1765 1776 else:
1766 1777 if n not in cl:
1767 1778 revs.add(n)
1768 1779 continue
1769 1780 except ValueError:
1770 1781 pass
1771 1782
1772 1783 try:
1773 1784 s = resolvehexnodeidprefix(unfi, s)
1774 1785 except (error.LookupError, error.WdirUnsupported):
1775 1786 s = None
1776 1787
1777 1788 if s is not None:
1778 1789 rev = unficl.rev(s)
1779 1790 if rev not in cl:
1780 1791 revs.add(rev)
1781 1792
1782 1793 return revs
1783 1794
1784 1795 def bookmarkrevs(repo, mark):
1785 1796 """
1786 1797 Select revisions reachable by a given bookmark
1787 1798 """
1788 1799 return repo.revs("ancestors(bookmark(%s)) - "
1789 1800 "ancestors(head() and not bookmark(%s)) - "
1790 1801 "ancestors(bookmark() and not bookmark(%s))",
1791 1802 mark, mark, mark)
@@ -1,1404 +1,1421 b''
1 1 ==================================================
2 2 Test obsmarkers interaction with bundle and strip
3 3 ==================================================
4 4
5 5 Setup a repository with various case
6 6 ====================================
7 7
8 8 Config setup
9 9 ------------
10 10
11 11 $ cat >> $HGRCPATH <<EOF
12 12 > [ui]
13 13 > # simpler log output
14 14 > logtemplate = "{node|short}: {desc}\n"
15 15 >
16 16 > [experimental]
17 17 > # enable evolution
18 18 > evolution=true
19 19 >
20 20 > # include obsmarkers in bundle
21 21 > evolution.bundle-obsmarker = yes
22 22 >
23 23 > [extensions]
24 24 > # needed for some tests
25 25 > strip =
26 26 > [defaults]
27 27 > # we'll query many hidden changeset
28 28 > debugobsolete = --hidden
29 29 > EOF
30 30
31 31 $ mkcommit() {
32 32 > echo "$1" > "$1"
33 33 > hg add "$1"
34 34 > hg ci -m "$1"
35 35 > }
36 36
37 37 $ getid() {
38 38 > hg log --hidden --template '{node}\n' --rev "$1"
39 39 > }
40 40
41 41 $ mktestrepo () {
42 42 > [ -n "$1" ] || exit 1
43 43 > cd $TESTTMP
44 44 > hg init $1
45 45 > cd $1
46 46 > mkcommit ROOT
47 47 > }
48 48
49 49 Function to compare the expected bundled obsmarkers with the actually bundled
50 50 obsmarkers. It also check the obsmarkers backed up during strip.
51 51
52 52 $ testrevs () {
53 53 > revs="$1"
54 54 > testname=`basename \`pwd\``
55 55 > revsname=`hg --hidden log -T '-{desc}' --rev "${revs}"`
56 56 > prefix="${TESTTMP}/${testname}${revsname}"
57 57 > markersfile="${prefix}-relevant-markers.txt"
58 58 > exclufile="${prefix}-exclusive-markers.txt"
59 59 > bundlefile="${prefix}-bundle.hg"
60 60 > contentfile="${prefix}-bundle-markers.hg"
61 61 > stripcontentfile="${prefix}-bundle-markers.hg"
62 62 > hg debugobsolete --hidden --rev "${revs}" | sed 's/^/ /' > "${markersfile}"
63 63 > hg debugobsolete --hidden --rev "${revs}" --exclusive | sed 's/^/ /' > "${exclufile}"
64 64 > echo '### Matched revisions###'
65 65 > hg log --hidden --rev "${revs}" | sort
66 66 > echo '### Relevant markers ###'
67 67 > cat "${markersfile}"
68 68 > printf "# bundling: "
69 69 > hg bundle --hidden --base "parents(roots(${revs}))" --rev "${revs}" "${bundlefile}"
70 70 > hg debugbundle --part-type obsmarkers "${bundlefile}" | sed 1,3d > "${contentfile}"
71 71 > echo '### Bundled markers ###'
72 72 > cat "${contentfile}"
73 73 > echo '### diff <relevant> <bundled> ###'
74 74 > cmp "${markersfile}" "${contentfile}" || diff -u "${markersfile}" "${contentfile}"
75 75 > echo '#################################'
76 76 > echo '### Exclusive markers ###'
77 77 > cat "${exclufile}"
78 78 > # if the matched revs do not have children, we also check the result of strip
79 79 > children=`hg log --hidden --rev "((${revs})::) - (${revs})"`
80 80 > if [ -z "$children" ];
81 81 > then
82 82 > printf "# stripping: "
83 83 > prestripfile="${prefix}-pre-strip.txt"
84 84 > poststripfile="${prefix}-post-strip.txt"
85 85 > strippedfile="${prefix}-stripped-markers.txt"
86 86 > hg debugobsolete --hidden | sort | sed 's/^/ /' > "${prestripfile}"
87 87 > hg strip --hidden --rev "${revs}"
88 88 > hg debugobsolete --hidden | sort | sed 's/^/ /' > "${poststripfile}"
89 89 > hg debugbundle --part-type obsmarkers .hg/strip-backup/* | sed 1,3d > "${stripcontentfile}"
90 90 > echo '### Backup markers ###'
91 91 > cat "${stripcontentfile}"
92 92 > echo '### diff <relevant> <backed-up> ###'
93 93 > cmp "${markersfile}" "${stripcontentfile}" || diff -u "${markersfile}" "${stripcontentfile}"
94 94 > echo '#################################'
95 95 > cat "${prestripfile}" "${poststripfile}" | sort | uniq -u > "${strippedfile}"
96 96 > echo '### Stripped markers ###'
97 97 > cat "${strippedfile}"
98 98 > echo '### diff <exclusive> <stripped> ###'
99 99 > cmp "${exclufile}" "${strippedfile}" || diff -u "${exclufile}" "${strippedfile}"
100 100 > echo '#################################'
101 101 > # restore and clean up repo for the next test
102 102 > hg unbundle .hg/strip-backup/* | sed 's/^/# unbundling: /'
103 103 > # clean up directory for the next test
104 104 > rm .hg/strip-backup/*
105 105 > fi
106 106 > }
107 107
108 108 root setup
109 109 -------------
110 110
111 111 simple chain
112 112 ============
113 113
114 114 . A0
115 115 . β‡ ΓΈβ‡ β—” A1
116 116 . |/
117 117 . ●
118 118
119 119 setup
120 120 -----
121 121
122 122 $ mktestrepo simple-chain
123 123 $ mkcommit 'C-A0'
124 124 $ hg up 'desc("ROOT")'
125 125 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
126 126 $ mkcommit 'C-A1'
127 127 created new head
128 128 $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'`
129 129 $ hg debugobsolete `getid 'desc("C-A0")'` a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1
130 130 obsoleted 1 changesets
131 131 $ hg debugobsolete a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 `getid 'desc("C-A1")'`
132 132
133 133 $ hg up 'desc("ROOT")'
134 134 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
135 135 $ hg log --hidden -G
136 136 o cf2c22470d67: C-A1
137 137 |
138 138 | x 84fcb0dfe17b: C-A0
139 139 |/
140 140 @ ea207398892e: ROOT
141 141
142 142 $ hg debugobsolete
143 143 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
144 144 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
145 145 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
146 146
147 147 Actual testing
148 148 --------------
149 149
150 150 $ testrevs 'desc("C-A0")'
151 151 ### Matched revisions###
152 152 84fcb0dfe17b: C-A0
153 153 ### Relevant markers ###
154 154 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
155 155 # bundling: 1 changesets found
156 156 ### Bundled markers ###
157 157 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
158 158 ### diff <relevant> <bundled> ###
159 159 #################################
160 160 ### Exclusive markers ###
161 161 # stripping: saved backup bundle to $TESTTMP/simple-chain/.hg/strip-backup/84fcb0dfe17b-6454bbdc-backup.hg
162 162 ### Backup markers ###
163 163 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
164 164 ### diff <relevant> <backed-up> ###
165 165 #################################
166 166 ### Stripped markers ###
167 167 ### diff <exclusive> <stripped> ###
168 168 #################################
169 169 # unbundling: adding changesets
170 170 # unbundling: adding manifests
171 171 # unbundling: adding file changes
172 172 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
173 # unbundling: (1 other changesets obsolete on arrival)
173 174 # unbundling: (run 'hg heads' to see heads)
174 175
175 176 $ testrevs 'desc("C-A1")'
176 177 ### Matched revisions###
177 178 cf2c22470d67: C-A1
178 179 ### Relevant markers ###
179 180 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
180 181 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
181 182 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
182 183 # bundling: 1 changesets found
183 184 ### Bundled markers ###
184 185 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
185 186 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
186 187 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
187 188 ### diff <relevant> <bundled> ###
188 189 #################################
189 190 ### Exclusive markers ###
190 191 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
191 192 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
192 193 # stripping: saved backup bundle to $TESTTMP/simple-chain/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg
193 194 ### Backup markers ###
194 195 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
195 196 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
196 197 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
197 198 ### diff <relevant> <backed-up> ###
198 199 #################################
199 200 ### Stripped markers ###
200 201 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
201 202 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
202 203 ### diff <exclusive> <stripped> ###
203 204 #################################
204 205 # unbundling: adding changesets
205 206 # unbundling: adding manifests
206 207 # unbundling: adding file changes
207 208 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
208 209 # unbundling: 2 new obsolescence markers
209 210 # unbundling: obsoleted 1 changesets
210 211 # unbundling: new changesets cf2c22470d67 (1 drafts)
211 212 # unbundling: (run 'hg heads' to see heads)
212 213
213 214 $ testrevs 'desc("C-A")'
214 215 ### Matched revisions###
215 216 84fcb0dfe17b: C-A0
216 217 cf2c22470d67: C-A1
217 218 ### Relevant markers ###
218 219 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
219 220 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
220 221 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
221 222 # bundling: 2 changesets found
222 223 ### Bundled markers ###
223 224 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
224 225 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
225 226 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
226 227 ### diff <relevant> <bundled> ###
227 228 #################################
228 229 ### Exclusive markers ###
229 230 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
230 231 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
231 232 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
232 233 # stripping: saved backup bundle to $TESTTMP/simple-chain/.hg/strip-backup/cf2c22470d67-fce4fc64-backup.hg
233 234 ### Backup markers ###
234 235 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
235 236 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
236 237 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
237 238 ### diff <relevant> <backed-up> ###
238 239 #################################
239 240 ### Stripped markers ###
240 241 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
241 242 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
242 243 a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
243 244 ### diff <exclusive> <stripped> ###
244 245 #################################
245 246 # unbundling: adding changesets
246 247 # unbundling: adding manifests
247 248 # unbundling: adding file changes
248 249 # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
249 250 # unbundling: 3 new obsolescence markers
250 251 # unbundling: new changesets cf2c22470d67 (1 drafts)
252 # unbundling: (1 other changesets obsolete on arrival)
251 253 # unbundling: (run 'hg heads' to see heads)
252 254
253 255 chain with prune children
254 256 =========================
255 257
256 258 . β‡ βŠ— B0
257 259 . |
258 260 . β‡ ΓΈβ‡ β—” A1
259 261 . |
260 262 . ●
261 263
262 264 setup
263 265 -----
264 266
265 267 $ mktestrepo prune
266 268 $ mkcommit 'C-A0'
267 269 $ mkcommit 'C-B0'
268 270 $ hg up 'desc("ROOT")'
269 271 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
270 272 $ mkcommit 'C-A1'
271 273 created new head
272 274 $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'`
273 275 $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'`
274 276 obsoleted 1 changesets
275 277 1 new orphan changesets
276 278 $ hg debugobsolete --record-parents `getid 'desc("C-B0")'`
277 279 obsoleted 1 changesets
278 280 $ hg up 'desc("ROOT")'
279 281 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
280 282 $ hg log --hidden -G
281 283 o cf2c22470d67: C-A1
282 284 |
283 285 | x 29f93b1df87b: C-B0
284 286 | |
285 287 | x 84fcb0dfe17b: C-A0
286 288 |/
287 289 @ ea207398892e: ROOT
288 290
289 291 $ hg debugobsolete
290 292 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
291 293 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
292 294 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
293 295
294 296 Actual testing
295 297 --------------
296 298
297 299 $ testrevs 'desc("C-A0")'
298 300 ### Matched revisions###
299 301 84fcb0dfe17b: C-A0
300 302 ### Relevant markers ###
301 303 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
302 304 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
303 305 # bundling: 1 changesets found
304 306 ### Bundled markers ###
305 307 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
306 308 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
307 309 ### diff <relevant> <bundled> ###
308 310 #################################
309 311 ### Exclusive markers ###
310 312
311 313 (The strip markers is considered exclusive to the pruned changeset even if it
312 314 is also considered "relevant" to its parent. This allows to strip prune
313 315 markers. This avoid leaving prune markers from dead-end that could be
314 316 problematic)
315 317
316 318 $ testrevs 'desc("C-B0")'
317 319 ### Matched revisions###
318 320 29f93b1df87b: C-B0
319 321 ### Relevant markers ###
320 322 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
321 323 # bundling: 1 changesets found
322 324 ### Bundled markers ###
323 325 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
324 326 ### diff <relevant> <bundled> ###
325 327 #################################
326 328 ### Exclusive markers ###
327 329 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
328 330 # stripping: saved backup bundle to $TESTTMP/prune/.hg/strip-backup/29f93b1df87b-7fb32101-backup.hg
329 331 ### Backup markers ###
330 332 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
331 333 ### diff <relevant> <backed-up> ###
332 334 #################################
333 335 ### Stripped markers ###
334 336 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
335 337 ### diff <exclusive> <stripped> ###
336 338 #################################
337 339 # unbundling: adding changesets
338 340 # unbundling: adding manifests
339 341 # unbundling: adding file changes
340 342 # unbundling: added 1 changesets with 1 changes to 1 files
341 343 # unbundling: 1 new obsolescence markers
344 # unbundling: (1 other changesets obsolete on arrival)
342 345 # unbundling: (run 'hg update' to get a working copy)
343 346
344 347 $ testrevs 'desc("C-A1")'
345 348 ### Matched revisions###
346 349 cf2c22470d67: C-A1
347 350 ### Relevant markers ###
348 351 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
349 352 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
350 353 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
351 354 # bundling: 1 changesets found
352 355 ### Bundled markers ###
353 356 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
354 357 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
355 358 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
356 359 ### diff <relevant> <bundled> ###
357 360 #################################
358 361 ### Exclusive markers ###
359 362 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
360 363 # stripping: saved backup bundle to $TESTTMP/prune/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg
361 364 ### Backup markers ###
362 365 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
363 366 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
364 367 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
365 368 ### diff <relevant> <backed-up> ###
366 369 #################################
367 370 ### Stripped markers ###
368 371 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
369 372 ### diff <exclusive> <stripped> ###
370 373 #################################
371 374 # unbundling: adding changesets
372 375 # unbundling: adding manifests
373 376 # unbundling: adding file changes
374 377 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
375 378 # unbundling: 1 new obsolescence markers
376 379 # unbundling: obsoleted 1 changesets
377 380 # unbundling: new changesets cf2c22470d67 (1 drafts)
378 381 # unbundling: (run 'hg heads' to see heads)
379 382
380 383 bundling multiple revisions
381 384
382 385 $ testrevs 'desc("C-A")'
383 386 ### Matched revisions###
384 387 84fcb0dfe17b: C-A0
385 388 cf2c22470d67: C-A1
386 389 ### Relevant markers ###
387 390 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
388 391 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
389 392 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
390 393 # bundling: 2 changesets found
391 394 ### Bundled markers ###
392 395 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
393 396 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
394 397 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
395 398 ### diff <relevant> <bundled> ###
396 399 #################################
397 400 ### Exclusive markers ###
398 401 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
399 402 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
400 403
401 404 $ testrevs 'desc("C-")'
402 405 ### Matched revisions###
403 406 29f93b1df87b: C-B0
404 407 84fcb0dfe17b: C-A0
405 408 cf2c22470d67: C-A1
406 409 ### Relevant markers ###
407 410 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
408 411 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
409 412 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
410 413 # bundling: 3 changesets found
411 414 ### Bundled markers ###
412 415 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
413 416 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
414 417 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
415 418 ### diff <relevant> <bundled> ###
416 419 #################################
417 420 ### Exclusive markers ###
418 421 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
419 422 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
420 423 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
421 424 # stripping: saved backup bundle to $TESTTMP/prune/.hg/strip-backup/cf2c22470d67-884c33b0-backup.hg
422 425 ### Backup markers ###
423 426 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
424 427 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
425 428 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
426 429 ### diff <relevant> <backed-up> ###
427 430 #################################
428 431 ### Stripped markers ###
429 432 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
430 433 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
431 434 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
432 435 ### diff <exclusive> <stripped> ###
433 436 #################################
434 437 # unbundling: adding changesets
435 438 # unbundling: adding manifests
436 439 # unbundling: adding file changes
437 440 # unbundling: added 3 changesets with 3 changes to 3 files (+1 heads)
438 441 # unbundling: 3 new obsolescence markers
439 442 # unbundling: new changesets cf2c22470d67 (1 drafts)
443 # unbundling: (2 other changesets obsolete on arrival)
440 444 # unbundling: (run 'hg heads' to see heads)
441 445
442 446 chain with precursors also pruned
443 447 =================================
444 448
445 449 . A0 (also pruned)
446 450 . β‡ ΓΈβ‡ β—” A1
447 451 . |
448 452 . ●
449 453
450 454 setup
451 455 -----
452 456
453 457 $ mktestrepo prune-inline
454 458 $ mkcommit 'C-A0'
455 459 $ hg up 'desc("ROOT")'
456 460 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
457 461 $ mkcommit 'C-A1'
458 462 created new head
459 463 $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'`
460 464 $ hg debugobsolete --record-parents `getid 'desc("C-A0")'`
461 465 obsoleted 1 changesets
462 466 $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'`
463 467 $ hg up 'desc("ROOT")'
464 468 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
465 469 $ hg log --hidden -G
466 470 o cf2c22470d67: C-A1
467 471 |
468 472 | x 84fcb0dfe17b: C-A0
469 473 |/
470 474 @ ea207398892e: ROOT
471 475
472 476 $ hg debugobsolete
473 477 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
474 478 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
475 479 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
476 480
477 481 Actual testing
478 482 --------------
479 483
480 484 $ testrevs 'desc("C-A0")'
481 485 ### Matched revisions###
482 486 84fcb0dfe17b: C-A0
483 487 ### Relevant markers ###
484 488 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
485 489 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
486 490 # bundling: 1 changesets found
487 491 ### Bundled markers ###
488 492 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
489 493 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
490 494 ### diff <relevant> <bundled> ###
491 495 #################################
492 496 ### Exclusive markers ###
493 497 # stripping: saved backup bundle to $TESTTMP/prune-inline/.hg/strip-backup/84fcb0dfe17b-6454bbdc-backup.hg
494 498 ### Backup markers ###
495 499 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
496 500 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
497 501 ### diff <relevant> <backed-up> ###
498 502 #################################
499 503 ### Stripped markers ###
500 504 ### diff <exclusive> <stripped> ###
501 505 #################################
502 506 # unbundling: adding changesets
503 507 # unbundling: adding manifests
504 508 # unbundling: adding file changes
505 509 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
510 # unbundling: (1 other changesets obsolete on arrival)
506 511 # unbundling: (run 'hg heads' to see heads)
507 512
508 513 $ testrevs 'desc("C-A1")'
509 514 ### Matched revisions###
510 515 cf2c22470d67: C-A1
511 516 ### Relevant markers ###
512 517 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
513 518 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
514 519 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
515 520 # bundling: 1 changesets found
516 521 ### Bundled markers ###
517 522 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
518 523 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
519 524 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
520 525 ### diff <relevant> <bundled> ###
521 526 #################################
522 527 ### Exclusive markers ###
523 528 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
524 529 # stripping: saved backup bundle to $TESTTMP/prune-inline/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg
525 530 ### Backup markers ###
526 531 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
527 532 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
528 533 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
529 534 ### diff <relevant> <backed-up> ###
530 535 #################################
531 536 ### Stripped markers ###
532 537 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
533 538 ### diff <exclusive> <stripped> ###
534 539 #################################
535 540 # unbundling: adding changesets
536 541 # unbundling: adding manifests
537 542 # unbundling: adding file changes
538 543 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
539 544 # unbundling: 1 new obsolescence markers
540 545 # unbundling: new changesets cf2c22470d67 (1 drafts)
541 546 # unbundling: (run 'hg heads' to see heads)
542 547
543 548 $ testrevs 'desc("C-A")'
544 549 ### Matched revisions###
545 550 84fcb0dfe17b: C-A0
546 551 cf2c22470d67: C-A1
547 552 ### Relevant markers ###
548 553 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
549 554 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
550 555 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
551 556 # bundling: 2 changesets found
552 557 ### Bundled markers ###
553 558 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
554 559 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
555 560 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
556 561 ### diff <relevant> <bundled> ###
557 562 #################################
558 563 ### Exclusive markers ###
559 564 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
560 565 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
561 566 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
562 567 # stripping: saved backup bundle to $TESTTMP/prune-inline/.hg/strip-backup/cf2c22470d67-fce4fc64-backup.hg
563 568 ### Backup markers ###
564 569 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
565 570 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
566 571 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
567 572 ### diff <relevant> <backed-up> ###
568 573 #################################
569 574 ### Stripped markers ###
570 575 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
571 576 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
572 577 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
573 578 ### diff <exclusive> <stripped> ###
574 579 #################################
575 580 # unbundling: adding changesets
576 581 # unbundling: adding manifests
577 582 # unbundling: adding file changes
578 583 # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads)
579 584 # unbundling: 3 new obsolescence markers
580 585 # unbundling: new changesets cf2c22470d67 (1 drafts)
586 # unbundling: (1 other changesets obsolete on arrival)
581 587 # unbundling: (run 'hg heads' to see heads)
582 588
583 589 chain with missing prune
584 590 ========================
585 591
586 592 . βŠ— B
587 593 . |
588 594 . β‡ β—Œβ‡ β—” A1
589 595 . |
590 596 . ●
591 597
592 598 setup
593 599 -----
594 600
595 601 $ mktestrepo missing-prune
596 602 $ mkcommit 'C-A0'
597 603 $ mkcommit 'C-B0'
598 604 $ hg up 'desc("ROOT")'
599 605 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
600 606 $ mkcommit 'C-A1'
601 607 created new head
602 608 $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'`
603 609 $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'`
604 610 obsoleted 1 changesets
605 611 1 new orphan changesets
606 612 $ hg debugobsolete --record-parents `getid 'desc("C-B0")'`
607 613 obsoleted 1 changesets
608 614
609 615 (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
610 616
611 617 $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
612 618
613 619 $ hg up 'desc("ROOT")'
614 620 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
615 621 $ hg log --hidden -G
616 622 o cf2c22470d67: C-A1
617 623 |
618 624 @ ea207398892e: ROOT
619 625
620 626 $ hg debugobsolete
621 627 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
622 628 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
623 629 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
624 630
625 631 Actual testing
626 632 --------------
627 633
628 634 $ testrevs 'desc("C-A1")'
629 635 ### Matched revisions###
630 636 cf2c22470d67: C-A1
631 637 ### Relevant markers ###
632 638 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
633 639 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
634 640 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
635 641 # bundling: 1 changesets found
636 642 ### Bundled markers ###
637 643 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
638 644 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
639 645 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
640 646 ### diff <relevant> <bundled> ###
641 647 #################################
642 648 ### Exclusive markers ###
643 649 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
644 650 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
645 651 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
646 652 # stripping: saved backup bundle to $TESTTMP/missing-prune/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg
647 653 ### Backup markers ###
648 654 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
649 655 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
650 656 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
651 657 ### diff <relevant> <backed-up> ###
652 658 #################################
653 659 ### Stripped markers ###
654 660 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
655 661 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
656 662 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
657 663 ### diff <exclusive> <stripped> ###
658 664 #################################
659 665 # unbundling: adding changesets
660 666 # unbundling: adding manifests
661 667 # unbundling: adding file changes
662 668 # unbundling: added 1 changesets with 1 changes to 1 files
663 669 # unbundling: 3 new obsolescence markers
664 670 # unbundling: new changesets cf2c22470d67 (1 drafts)
665 671 # unbundling: (run 'hg update' to get a working copy)
666 672
667 673 chain with precursors also pruned
668 674 =================================
669 675
670 676 . A0 (also pruned)
671 677 . β‡ β—Œβ‡ β—” A1
672 678 . |
673 679 . ●
674 680
675 681 setup
676 682 -----
677 683
678 684 $ mktestrepo prune-inline-missing
679 685 $ mkcommit 'C-A0'
680 686 $ hg up 'desc("ROOT")'
681 687 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
682 688 $ mkcommit 'C-A1'
683 689 created new head
684 690 $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'`
685 691 $ hg debugobsolete --record-parents `getid 'desc("C-A0")'`
686 692 obsoleted 1 changesets
687 693 $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'`
688 694
689 695 (it is annoying to create prune with parent data without the changeset, so we strip it after the fact)
690 696
691 697 $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no
692 698
693 699 $ hg up 'desc("ROOT")'
694 700 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
695 701 $ hg log --hidden -G
696 702 o cf2c22470d67: C-A1
697 703 |
698 704 @ ea207398892e: ROOT
699 705
700 706 $ hg debugobsolete
701 707 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
702 708 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
703 709 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
704 710
705 711 Actual testing
706 712 --------------
707 713
708 714 $ testrevs 'desc("C-A1")'
709 715 ### Matched revisions###
710 716 cf2c22470d67: C-A1
711 717 ### Relevant markers ###
712 718 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
713 719 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
714 720 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
715 721 # bundling: 1 changesets found
716 722 ### Bundled markers ###
717 723 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
718 724 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
719 725 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
720 726 ### diff <relevant> <bundled> ###
721 727 #################################
722 728 ### Exclusive markers ###
723 729 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
724 730 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
725 731 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
726 732 # stripping: saved backup bundle to $TESTTMP/prune-inline-missing/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg
727 733 ### Backup markers ###
728 734 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
729 735 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
730 736 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
731 737 ### diff <relevant> <backed-up> ###
732 738 #################################
733 739 ### Stripped markers ###
734 740 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
735 741 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
736 742 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
737 743 ### diff <exclusive> <stripped> ###
738 744 #################################
739 745 # unbundling: adding changesets
740 746 # unbundling: adding manifests
741 747 # unbundling: adding file changes
742 748 # unbundling: added 1 changesets with 1 changes to 1 files
743 749 # unbundling: 3 new obsolescence markers
744 750 # unbundling: new changesets cf2c22470d67 (1 drafts)
745 751 # unbundling: (run 'hg update' to get a working copy)
746 752
747 753 Chain with fold and split
748 754 =========================
749 755
750 756 setup
751 757 -----
752 758
753 759 $ mktestrepo split-fold
754 760 $ mkcommit 'C-A'
755 761 $ hg up 'desc("ROOT")'
756 762 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
757 763 $ mkcommit 'C-B'
758 764 created new head
759 765 $ hg up 'desc("ROOT")'
760 766 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
761 767 $ mkcommit 'C-C'
762 768 created new head
763 769 $ hg up 'desc("ROOT")'
764 770 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
765 771 $ mkcommit 'C-D'
766 772 created new head
767 773 $ hg up 'desc("ROOT")'
768 774 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
769 775 $ mkcommit 'C-E'
770 776 created new head
771 777 $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A")'`
772 778 $ hg debugobsolete `getid 'desc("C-A")'` `getid 'desc("C-B")'` `getid 'desc("C-C")'` # record split
773 779 obsoleted 1 changesets
774 780 $ hg debugobsolete `getid 'desc("C-A")'` `getid 'desc("C-D")'` # other divergent
775 781 3 new content-divergent changesets
776 782 $ hg debugobsolete `getid 'desc("C-A")'` b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0
777 783 $ hg debugobsolete b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 `getid 'desc("C-E")'`
778 784 1 new content-divergent changesets
779 785 $ hg debugobsolete `getid 'desc("C-B")'` `getid 'desc("C-E")'`
780 786 obsoleted 1 changesets
781 787 $ hg debugobsolete `getid 'desc("C-C")'` `getid 'desc("C-E")'`
782 788 obsoleted 1 changesets
783 789 $ hg debugobsolete `getid 'desc("C-D")'` `getid 'desc("C-E")'`
784 790 obsoleted 1 changesets
785 791 $ hg debugobsolete c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 `getid 'desc("C-E")'`
786 792
787 793 $ hg up 'desc("ROOT")'
788 794 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
789 795 $ hg log --hidden -G
790 796 o 2f20ff6509f0: C-E
791 797 |
792 798 | x 06dc9da25ef0: C-D
793 799 |/
794 800 | x 27ec657ca21d: C-C
795 801 |/
796 802 | x a9b9da38ed96: C-B
797 803 |/
798 804 | x 9ac430e15fca: C-A
799 805 |/
800 806 @ ea207398892e: ROOT
801 807
802 808 $ hg debugobsolete
803 809 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
804 810 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
805 811 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
806 812 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
807 813 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
808 814 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
809 815 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
810 816 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
811 817 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
812 818
813 819 Actual testing
814 820 --------------
815 821
816 822 $ testrevs 'desc("C-A")'
817 823 ### Matched revisions###
818 824 9ac430e15fca: C-A
819 825 ### Relevant markers ###
820 826 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
821 827 # bundling: 1 changesets found
822 828 ### Bundled markers ###
823 829 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
824 830 ### diff <relevant> <bundled> ###
825 831 #################################
826 832 ### Exclusive markers ###
827 833 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/9ac430e15fca-81204eba-backup.hg
828 834 ### Backup markers ###
829 835 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
830 836 ### diff <relevant> <backed-up> ###
831 837 #################################
832 838 ### Stripped markers ###
833 839 ### diff <exclusive> <stripped> ###
834 840 #################################
835 841 # unbundling: adding changesets
836 842 # unbundling: adding manifests
837 843 # unbundling: adding file changes
838 844 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
845 # unbundling: (1 other changesets obsolete on arrival)
839 846 # unbundling: (run 'hg heads' to see heads)
840 847
841 848 $ testrevs 'desc("C-B")'
842 849 ### Matched revisions###
843 850 a9b9da38ed96: C-B
844 851 ### Relevant markers ###
845 852 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
846 853 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
847 854 # bundling: 1 changesets found
848 855 ### Bundled markers ###
849 856 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
850 857 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
851 858 ### diff <relevant> <bundled> ###
852 859 #################################
853 860 ### Exclusive markers ###
854 861 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/a9b9da38ed96-7465d6e9-backup.hg
855 862 ### Backup markers ###
856 863 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
857 864 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
858 865 ### diff <relevant> <backed-up> ###
859 866 #################################
860 867 ### Stripped markers ###
861 868 ### diff <exclusive> <stripped> ###
862 869 #################################
863 870 # unbundling: adding changesets
864 871 # unbundling: adding manifests
865 872 # unbundling: adding file changes
866 873 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
874 # unbundling: (1 other changesets obsolete on arrival)
867 875 # unbundling: (run 'hg heads' to see heads)
868 876
869 877 $ testrevs 'desc("C-C")'
870 878 ### Matched revisions###
871 879 27ec657ca21d: C-C
872 880 ### Relevant markers ###
873 881 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
874 882 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
875 883 # bundling: 1 changesets found
876 884 ### Bundled markers ###
877 885 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
878 886 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
879 887 ### diff <relevant> <bundled> ###
880 888 #################################
881 889 ### Exclusive markers ###
882 890 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/27ec657ca21d-d5dd1c7c-backup.hg
883 891 ### Backup markers ###
884 892 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
885 893 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
886 894 ### diff <relevant> <backed-up> ###
887 895 #################################
888 896 ### Stripped markers ###
889 897 ### diff <exclusive> <stripped> ###
890 898 #################################
891 899 # unbundling: adding changesets
892 900 # unbundling: adding manifests
893 901 # unbundling: adding file changes
894 902 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
903 # unbundling: (1 other changesets obsolete on arrival)
895 904 # unbundling: (run 'hg heads' to see heads)
896 905
897 906 $ testrevs 'desc("C-D")'
898 907 ### Matched revisions###
899 908 06dc9da25ef0: C-D
900 909 ### Relevant markers ###
901 910 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
902 911 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
903 912 # bundling: 1 changesets found
904 913 ### Bundled markers ###
905 914 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
906 915 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
907 916 ### diff <relevant> <bundled> ###
908 917 #################################
909 918 ### Exclusive markers ###
910 919 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/06dc9da25ef0-9b1c0a91-backup.hg
911 920 ### Backup markers ###
912 921 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
913 922 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
914 923 ### diff <relevant> <backed-up> ###
915 924 #################################
916 925 ### Stripped markers ###
917 926 ### diff <exclusive> <stripped> ###
918 927 #################################
919 928 # unbundling: adding changesets
920 929 # unbundling: adding manifests
921 930 # unbundling: adding file changes
922 931 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
932 # unbundling: (1 other changesets obsolete on arrival)
923 933 # unbundling: (run 'hg heads' to see heads)
924 934
925 935 $ testrevs 'desc("C-E")'
926 936 ### Matched revisions###
927 937 2f20ff6509f0: C-E
928 938 ### Relevant markers ###
929 939 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
930 940 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
931 941 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
932 942 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
933 943 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
934 944 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
935 945 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
936 946 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
937 947 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
938 948 # bundling: 1 changesets found
939 949 ### Bundled markers ###
940 950 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
941 951 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
942 952 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
943 953 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
944 954 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
945 955 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
946 956 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
947 957 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
948 958 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
949 959 ### diff <relevant> <bundled> ###
950 960 #################################
951 961 ### Exclusive markers ###
952 962 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
953 963 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
954 964 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
955 965 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
956 966 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
957 967 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
958 968 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/2f20ff6509f0-8adeb22d-backup.hg
959 969 3 new content-divergent changesets
960 970 ### Backup markers ###
961 971 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
962 972 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
963 973 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
964 974 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
965 975 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
966 976 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
967 977 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
968 978 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
969 979 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
970 980 ### diff <relevant> <backed-up> ###
971 981 #################################
972 982 ### Stripped markers ###
973 983 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
974 984 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
975 985 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
976 986 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
977 987 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
978 988 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
979 989 ### diff <exclusive> <stripped> ###
980 990 #################################
981 991 # unbundling: adding changesets
982 992 # unbundling: adding manifests
983 993 # unbundling: adding file changes
984 994 # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads)
985 995 # unbundling: 6 new obsolescence markers
986 996 # unbundling: obsoleted 3 changesets
987 997 # unbundling: new changesets 2f20ff6509f0 (1 drafts)
988 998 # unbundling: (run 'hg heads' to see heads)
989 999
990 1000 Bundle multiple revisions
991 1001
992 1002 * each part of the split
993 1003
994 1004 $ testrevs 'desc("C-B") + desc("C-C")'
995 1005 ### Matched revisions###
996 1006 27ec657ca21d: C-C
997 1007 a9b9da38ed96: C-B
998 1008 ### Relevant markers ###
999 1009 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1000 1010 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1001 1011 # bundling: 2 changesets found
1002 1012 ### Bundled markers ###
1003 1013 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1004 1014 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1005 1015 ### diff <relevant> <bundled> ###
1006 1016 #################################
1007 1017 ### Exclusive markers ###
1008 1018 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/a9b9da38ed96-0daf625a-backup.hg
1009 1019 ### Backup markers ###
1010 1020 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1011 1021 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1012 1022 ### diff <relevant> <backed-up> ###
1013 1023 #################################
1014 1024 ### Stripped markers ###
1015 1025 ### diff <exclusive> <stripped> ###
1016 1026 #################################
1017 1027 # unbundling: adding changesets
1018 1028 # unbundling: adding manifests
1019 1029 # unbundling: adding file changes
1020 1030 # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads)
1031 # unbundling: (2 other changesets obsolete on arrival)
1021 1032 # unbundling: (run 'hg heads' to see heads)
1022 1033
1023 1034 * top one and other divergent
1024 1035
1025 1036 $ testrevs 'desc("C-E") + desc("C-D")'
1026 1037 ### Matched revisions###
1027 1038 06dc9da25ef0: C-D
1028 1039 2f20ff6509f0: C-E
1029 1040 ### Relevant markers ###
1030 1041 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1031 1042 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1032 1043 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1033 1044 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1034 1045 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1035 1046 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1036 1047 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1037 1048 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1038 1049 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1039 1050 # bundling: 2 changesets found
1040 1051 ### Bundled markers ###
1041 1052 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1042 1053 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1043 1054 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1044 1055 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1045 1056 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1046 1057 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1047 1058 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1048 1059 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1049 1060 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1050 1061 ### diff <relevant> <bundled> ###
1051 1062 #################################
1052 1063 ### Exclusive markers ###
1053 1064 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1054 1065 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1055 1066 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1056 1067 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1057 1068 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1058 1069 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1059 1070 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1060 1071 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/2f20ff6509f0-bf1b80f4-backup.hg
1061 1072 ### Backup markers ###
1062 1073 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1063 1074 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1064 1075 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1065 1076 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1066 1077 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1067 1078 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1068 1079 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1069 1080 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1070 1081 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1071 1082 ### diff <relevant> <backed-up> ###
1072 1083 #################################
1073 1084 ### Stripped markers ###
1074 1085 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1075 1086 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1076 1087 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1077 1088 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1078 1089 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1079 1090 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1080 1091 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1081 1092 ### diff <exclusive> <stripped> ###
1082 1093 #################################
1083 1094 # unbundling: adding changesets
1084 1095 # unbundling: adding manifests
1085 1096 # unbundling: adding file changes
1086 1097 # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads)
1087 1098 # unbundling: 7 new obsolescence markers
1088 1099 # unbundling: obsoleted 2 changesets
1089 1100 # unbundling: new changesets 2f20ff6509f0 (1 drafts)
1101 # unbundling: (1 other changesets obsolete on arrival)
1090 1102 # unbundling: (run 'hg heads' to see heads)
1091 1103
1092 1104 * top one and initial precursors
1093 1105
1094 1106 $ testrevs 'desc("C-E") + desc("C-A")'
1095 1107 ### Matched revisions###
1096 1108 2f20ff6509f0: C-E
1097 1109 9ac430e15fca: C-A
1098 1110 ### Relevant markers ###
1099 1111 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1100 1112 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1101 1113 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1102 1114 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1103 1115 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1104 1116 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1105 1117 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1106 1118 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1107 1119 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1108 1120 # bundling: 2 changesets found
1109 1121 ### Bundled markers ###
1110 1122 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1111 1123 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1112 1124 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1113 1125 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1114 1126 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1115 1127 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1116 1128 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1117 1129 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1118 1130 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1119 1131 ### diff <relevant> <bundled> ###
1120 1132 #################################
1121 1133 ### Exclusive markers ###
1122 1134 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1123 1135 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1124 1136 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1125 1137 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1126 1138 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1127 1139 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1128 1140 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/9ac430e15fca-36b6476a-backup.hg
1129 1141 3 new content-divergent changesets
1130 1142 ### Backup markers ###
1131 1143 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1132 1144 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1133 1145 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1134 1146 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1135 1147 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1136 1148 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1137 1149 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1138 1150 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1139 1151 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1140 1152 ### diff <relevant> <backed-up> ###
1141 1153 #################################
1142 1154 ### Stripped markers ###
1143 1155 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1144 1156 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1145 1157 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1146 1158 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1147 1159 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1148 1160 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1149 1161 ### diff <exclusive> <stripped> ###
1150 1162 #################################
1151 1163 # unbundling: adding changesets
1152 1164 # unbundling: adding manifests
1153 1165 # unbundling: adding file changes
1154 1166 # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads)
1155 1167 # unbundling: 6 new obsolescence markers
1156 1168 # unbundling: obsoleted 3 changesets
1157 1169 # unbundling: new changesets 2f20ff6509f0 (1 drafts)
1170 # unbundling: (1 other changesets obsolete on arrival)
1158 1171 # unbundling: (run 'hg heads' to see heads)
1159 1172
1160 1173 * top one and one of the split
1161 1174
1162 1175 $ testrevs 'desc("C-E") + desc("C-C")'
1163 1176 ### Matched revisions###
1164 1177 27ec657ca21d: C-C
1165 1178 2f20ff6509f0: C-E
1166 1179 ### Relevant markers ###
1167 1180 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1168 1181 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1169 1182 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1170 1183 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1171 1184 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1172 1185 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1173 1186 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1174 1187 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1175 1188 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1176 1189 # bundling: 2 changesets found
1177 1190 ### Bundled markers ###
1178 1191 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1179 1192 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1180 1193 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1181 1194 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1182 1195 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1183 1196 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1184 1197 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1185 1198 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1186 1199 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1187 1200 ### diff <relevant> <bundled> ###
1188 1201 #################################
1189 1202 ### Exclusive markers ###
1190 1203 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1191 1204 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1192 1205 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1193 1206 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1194 1207 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1195 1208 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1196 1209 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1197 1210 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/2f20ff6509f0-5fdfcd7d-backup.hg
1198 1211 ### Backup markers ###
1199 1212 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1200 1213 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1201 1214 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1202 1215 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1203 1216 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1204 1217 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1205 1218 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1206 1219 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1207 1220 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1208 1221 ### diff <relevant> <backed-up> ###
1209 1222 #################################
1210 1223 ### Stripped markers ###
1211 1224 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1212 1225 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1213 1226 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1214 1227 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1215 1228 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1216 1229 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1217 1230 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1218 1231 ### diff <exclusive> <stripped> ###
1219 1232 #################################
1220 1233 # unbundling: adding changesets
1221 1234 # unbundling: adding manifests
1222 1235 # unbundling: adding file changes
1223 1236 # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads)
1224 1237 # unbundling: 7 new obsolescence markers
1225 1238 # unbundling: obsoleted 2 changesets
1226 1239 # unbundling: new changesets 2f20ff6509f0 (1 drafts)
1240 # unbundling: (1 other changesets obsolete on arrival)
1227 1241 # unbundling: (run 'hg heads' to see heads)
1228 1242
1229 1243 * all
1230 1244
1231 1245 $ testrevs 'desc("C-")'
1232 1246 ### Matched revisions###
1233 1247 06dc9da25ef0: C-D
1234 1248 27ec657ca21d: C-C
1235 1249 2f20ff6509f0: C-E
1236 1250 9ac430e15fca: C-A
1237 1251 a9b9da38ed96: C-B
1238 1252 ### Relevant markers ###
1239 1253 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1240 1254 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1241 1255 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1242 1256 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1243 1257 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1244 1258 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1245 1259 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1246 1260 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1247 1261 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1248 1262 # bundling: 5 changesets found
1249 1263 ### Bundled markers ###
1250 1264 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1251 1265 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1252 1266 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1253 1267 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1254 1268 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1255 1269 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1256 1270 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1257 1271 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1258 1272 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1259 1273 ### diff <relevant> <bundled> ###
1260 1274 #################################
1261 1275 ### Exclusive markers ###
1262 1276 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1263 1277 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1264 1278 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1265 1279 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1266 1280 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1267 1281 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1268 1282 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1269 1283 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1270 1284 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1271 1285 # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/a9b9da38ed96-eeb4258f-backup.hg
1272 1286 ### Backup markers ###
1273 1287 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1274 1288 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1275 1289 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1276 1290 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1277 1291 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1278 1292 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1279 1293 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1280 1294 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1281 1295 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1282 1296 ### diff <relevant> <backed-up> ###
1283 1297 #################################
1284 1298 ### Stripped markers ###
1285 1299 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1286 1300 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1287 1301 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1288 1302 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1289 1303 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1290 1304 a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1291 1305 a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1292 1306 b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1293 1307 c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1294 1308 ### diff <exclusive> <stripped> ###
1295 1309 #################################
1296 1310 # unbundling: adding changesets
1297 1311 # unbundling: adding manifests
1298 1312 # unbundling: adding file changes
1299 1313 # unbundling: added 5 changesets with 5 changes to 5 files (+4 heads)
1300 1314 # unbundling: 9 new obsolescence markers
1301 1315 # unbundling: new changesets 2f20ff6509f0 (1 drafts)
1316 # unbundling: (4 other changesets obsolete on arrival)
1302 1317 # unbundling: (run 'hg heads' to see heads)
1303 1318
1304 1319 changeset pruned on its own
1305 1320 ===========================
1306 1321
1307 1322 . βŠ— B
1308 1323 . |
1309 1324 . β—• A
1310 1325 . |
1311 1326 . ●
1312 1327
1313 1328 setup
1314 1329 -----
1315 1330
1316 1331 $ mktestrepo lonely-prune
1317 1332 $ hg up 'desc("ROOT")'
1318 1333 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1319 1334 $ mkcommit 'C-A'
1320 1335 $ mkcommit 'C-B'
1321 1336 $ hg debugobsolete --record-parent `getid 'desc("C-B")'`
1322 1337 obsoleted 1 changesets
1323 1338
1324 1339 $ hg up 'desc("ROOT")'
1325 1340 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1326 1341 $ hg log --hidden -G
1327 1342 x cefb651fc2fd: C-B
1328 1343 |
1329 1344 o 9ac430e15fca: C-A
1330 1345 |
1331 1346 @ ea207398892e: ROOT
1332 1347
1333 1348 $ hg debugobsolete
1334 1349 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1335 1350
1336 1351 Actual testing
1337 1352 --------------
1338 1353 $ testrevs 'desc("C-A")'
1339 1354 ### Matched revisions###
1340 1355 9ac430e15fca: C-A
1341 1356 ### Relevant markers ###
1342 1357 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1343 1358 # bundling: 1 changesets found
1344 1359 ### Bundled markers ###
1345 1360 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1346 1361 ### diff <relevant> <bundled> ###
1347 1362 #################################
1348 1363 ### Exclusive markers ###
1349 1364 $ testrevs 'desc("C-B")'
1350 1365 ### Matched revisions###
1351 1366 cefb651fc2fd: C-B
1352 1367 ### Relevant markers ###
1353 1368 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1354 1369 # bundling: 1 changesets found
1355 1370 ### Bundled markers ###
1356 1371 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1357 1372 ### diff <relevant> <bundled> ###
1358 1373 #################################
1359 1374 ### Exclusive markers ###
1360 1375 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1361 1376 # stripping: saved backup bundle to $TESTTMP/lonely-prune/.hg/strip-backup/cefb651fc2fd-345c8dfa-backup.hg
1362 1377 ### Backup markers ###
1363 1378 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1364 1379 ### diff <relevant> <backed-up> ###
1365 1380 #################################
1366 1381 ### Stripped markers ###
1367 1382 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1368 1383 ### diff <exclusive> <stripped> ###
1369 1384 #################################
1370 1385 # unbundling: adding changesets
1371 1386 # unbundling: adding manifests
1372 1387 # unbundling: adding file changes
1373 1388 # unbundling: added 1 changesets with 1 changes to 1 files
1374 1389 # unbundling: 1 new obsolescence markers
1390 # unbundling: (1 other changesets obsolete on arrival)
1375 1391 # unbundling: (run 'hg update' to get a working copy)
1376 1392 $ testrevs 'desc("C-")'
1377 1393 ### Matched revisions###
1378 1394 9ac430e15fca: C-A
1379 1395 cefb651fc2fd: C-B
1380 1396 ### Relevant markers ###
1381 1397 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1382 1398 # bundling: 2 changesets found
1383 1399 ### Bundled markers ###
1384 1400 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1385 1401 ### diff <relevant> <bundled> ###
1386 1402 #################################
1387 1403 ### Exclusive markers ###
1388 1404 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1389 1405 # stripping: saved backup bundle to $TESTTMP/lonely-prune/.hg/strip-backup/9ac430e15fca-b9855b02-backup.hg
1390 1406 ### Backup markers ###
1391 1407 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1392 1408 ### diff <relevant> <backed-up> ###
1393 1409 #################################
1394 1410 ### Stripped markers ###
1395 1411 cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1396 1412 ### diff <exclusive> <stripped> ###
1397 1413 #################################
1398 1414 # unbundling: adding changesets
1399 1415 # unbundling: adding manifests
1400 1416 # unbundling: adding file changes
1401 1417 # unbundling: added 2 changesets with 2 changes to 2 files
1402 1418 # unbundling: 1 new obsolescence markers
1403 1419 # unbundling: new changesets 9ac430e15fca (1 drafts)
1420 # unbundling: (1 other changesets obsolete on arrival)
1404 1421 # unbundling: (run 'hg update' to get a working copy)
@@ -1,181 +1,182 b''
1 1 Test changesets filtering during exchanges (some tests are still in
2 2 test-obsolete.t)
3 3
4 4 $ cat >> $HGRCPATH << EOF
5 5 > [experimental]
6 6 > evolution.createmarkers=True
7 7 > EOF
8 8
9 9 Push does not corrupt remote
10 10 ----------------------------
11 11
12 12 Create a DAG where a changeset reuses a revision from a file first used in an
13 13 extinct changeset.
14 14
15 15 $ hg init local
16 16 $ cd local
17 17 $ echo 'base' > base
18 18 $ hg commit -Am base
19 19 adding base
20 20 $ echo 'A' > A
21 21 $ hg commit -Am A
22 22 adding A
23 23 $ hg up 0
24 24 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 25 $ hg revert -ar 1
26 26 adding A
27 27 $ hg commit -Am "A'"
28 28 created new head
29 29 $ hg log -G --template='{desc} {node}'
30 30 @ A' f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
31 31 |
32 32 | o A 9d73aac1b2ed7d53835eaeec212ed41ea47da53a
33 33 |/
34 34 o base d20a80d4def38df63a4b330b7fb688f3d4cae1e3
35 35
36 36 $ hg debugobsolete 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
37 37 obsoleted 1 changesets
38 38
39 39 Push it. The bundle should not refer to the extinct changeset.
40 40
41 41 $ hg init ../other
42 42 $ hg push ../other
43 43 pushing to ../other
44 44 searching for changes
45 45 adding changesets
46 46 adding manifests
47 47 adding file changes
48 48 added 2 changesets with 2 changes to 2 files
49 49 $ hg -R ../other verify
50 50 checking changesets
51 51 checking manifests
52 52 crosschecking files in changesets and manifests
53 53 checking files
54 54 checked 2 changesets with 2 changes to 2 files
55 55
56 56 Adding a changeset going extinct locally
57 57 ------------------------------------------
58 58
59 59 Pull a changeset that will immediatly goes extinct (because you already have a
60 60 marker to obsolete him)
61 61 (test resolution of issue3788)
62 62
63 63 $ hg phase --draft --force f89bcc95eba5
64 64 $ hg phase -R ../other --draft --force f89bcc95eba5
65 65 $ hg commit --amend -m "A''"
66 66 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
67 67 $ hg pull ../other
68 68 pulling from ../other
69 69 searching for changes
70 70 adding changesets
71 71 adding manifests
72 72 adding file changes
73 73 added 1 changesets with 0 changes to 1 files (+1 heads)
74 74 1 new phase-divergent changesets
75 75 new changesets f89bcc95eba5
76 76 (run 'hg heads' to see heads, 'hg merge' to merge)
77 77
78 78 check that bundle is not affected
79 79
80 80 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5.hg
81 81 1 changesets found
82 82 $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
83 83 $ hg unbundle ../f89bcc95eba5.hg
84 84 adding changesets
85 85 adding manifests
86 86 adding file changes
87 87 added 1 changesets with 0 changes to 1 files (+1 heads)
88 (1 other changesets obsolete on arrival)
88 89 (run 'hg heads' to see heads)
89 90
90 91 check-that bundle can contain markers:
91 92
92 93 $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5-obs.hg --config experimental.evolution.bundle-obsmarker=1
93 94 1 changesets found
94 95 $ hg debugbundle ../f89bcc95eba5.hg
95 96 Stream params: {Compression: BZ}
96 97 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
97 98 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
98 99 cache:rev-branch-cache -- {} (mandatory: False)
99 100 $ hg debugbundle ../f89bcc95eba5-obs.hg
100 101 Stream params: {Compression: BZ}
101 102 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
102 103 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
103 104 cache:rev-branch-cache -- {} (mandatory: False)
104 105 obsmarkers -- {} (mandatory: True)
105 106 version: 1 (70 bytes)
106 107 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
107 108
108 109 $ cd ..
109 110
110 111 pull does not fetch excessive changesets when common node is hidden (issue4982)
111 112 -------------------------------------------------------------------------------
112 113
113 114 initial repo with server and client matching
114 115
115 116 $ hg init pull-hidden-common
116 117 $ cd pull-hidden-common
117 118 $ touch foo
118 119 $ hg -q commit -A -m initial
119 120 $ echo 1 > foo
120 121 $ hg commit -m 1
121 122 $ echo 2a > foo
122 123 $ hg commit -m 2a
123 124 $ cd ..
124 125 $ hg clone --pull pull-hidden-common pull-hidden-common-client
125 126 requesting all changes
126 127 adding changesets
127 128 adding manifests
128 129 adding file changes
129 130 added 3 changesets with 3 changes to 1 files
130 131 new changesets 96ee1d7354c4:6a29ed9c68de
131 132 updating to branch default
132 133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 134
134 135 server obsoletes the old head
135 136
136 137 $ cd pull-hidden-common
137 138 $ hg -q up -r 1
138 139 $ echo 2b > foo
139 140 $ hg -q commit -m 2b
140 141 $ hg debugobsolete 6a29ed9c68defff1a139e5c6fa9696fb1a75783d bec0734cd68e84477ba7fc1d13e6cff53ab70129
141 142 obsoleted 1 changesets
142 143 $ cd ..
143 144
144 145 client only pulls down 1 changeset
145 146
146 147 $ cd pull-hidden-common-client
147 148 $ hg pull --debug
148 149 pulling from $TESTTMP/pull-hidden-common
149 150 query 1; heads
150 151 searching for changes
151 152 taking quick initial sample
152 153 query 2; still undecided: 2, sample size is: 2
153 154 2 total queries in *.????s (glob)
154 155 1 changesets found
155 156 list of changesets:
156 157 bec0734cd68e84477ba7fc1d13e6cff53ab70129
157 158 listing keys for "bookmarks"
158 159 bundle2-output-bundle: "HG20", 4 parts total
159 160 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
160 161 bundle2-output-part: "listkeys" (params: 1 mandatory) empty payload
161 162 bundle2-output-part: "phase-heads" 24 bytes payload
162 163 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
163 164 bundle2-input-bundle: with-transaction
164 165 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
165 166 adding changesets
166 167 add changeset bec0734cd68e
167 168 adding manifests
168 169 adding file changes
169 170 adding foo revisions
170 171 added 1 changesets with 1 changes to 1 files (+1 heads)
171 172 bundle2-input-part: total payload size 476
172 173 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
173 174 bundle2-input-part: "phase-heads" supported
174 175 bundle2-input-part: total payload size 24
175 176 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
176 177 bundle2-input-part: total payload size 39
177 178 bundle2-input-bundle: 3 parts total
178 179 checking for updated bookmarks
179 180 updating the branch cache
180 181 new changesets bec0734cd68e
181 182 (run 'hg heads' to see heads, 'hg merge' to merge)
@@ -1,317 +1,318 b''
1 1 Check that obsolete properly strip heads
2 2 $ cat >> $HGRCPATH << EOF
3 3 > [phases]
4 4 > # public changeset are not obsolete
5 5 > publish=false
6 6 > [ui]
7 7 > logtemplate='{node|short} ({phase}) {desc|firstline}\n'
8 8 > [experimental]
9 9 > evolution.createmarkers=True
10 10 > EOF
11 11 $ mkcommit() {
12 12 > echo "$1" > "$1"
13 13 > hg add "$1"
14 14 > hg ci -m "add $1"
15 15 > }
16 16 $ getid() {
17 17 > hg id --debug -ir "desc('$1')"
18 18 > }
19 19
20 20
21 21 $ hg init remote
22 22 $ cd remote
23 23 $ mkcommit base
24 24 $ hg phase --public .
25 25 $ cd ..
26 26 $ cp -R remote base
27 27 $ hg clone remote local
28 28 updating to branch default
29 29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 30 $ cd local
31 31
32 32 New head replaces old head
33 33 ==========================
34 34
35 35 setup
36 36 (we add the 1 flags to prevent bumped error during the test)
37 37
38 38 $ mkcommit old
39 39 $ hg push
40 40 pushing to $TESTTMP/remote
41 41 searching for changes
42 42 adding changesets
43 43 adding manifests
44 44 adding file changes
45 45 added 1 changesets with 1 changes to 1 files
46 46 $ hg up -q '.^'
47 47 $ mkcommit new
48 48 created new head
49 49 $ hg debugobsolete --flags 1 `getid old` `getid new`
50 50 obsoleted 1 changesets
51 51 $ hg log -G --hidden
52 52 @ 71e3228bffe1 (draft) add new
53 53 |
54 54 | x c70b08862e08 (draft) add old
55 55 |/
56 56 o b4952fcf48cf (public) add base
57 57
58 58 $ cp -R ../remote ../backup1
59 59
60 60 old exists remotely as draft. It is obsoleted by new that we now push.
61 61 Push should not warn about creating new head
62 62
63 63 $ hg push
64 64 pushing to $TESTTMP/remote
65 65 searching for changes
66 66 adding changesets
67 67 adding manifests
68 68 adding file changes
69 69 added 1 changesets with 1 changes to 1 files (+1 heads)
70 70
71 71 old head is now public (public local version)
72 72 =============================================
73 73
74 74 setup
75 75
76 76 $ rm -fr ../remote
77 77 $ cp -R ../backup1 ../remote
78 78 $ hg -R ../remote phase --public c70b08862e08
79 79 $ hg pull -v
80 80 pulling from $TESTTMP/remote
81 81 searching for changes
82 82 no changes found
83 83 1 local changesets published
84 84 $ hg log -G --hidden
85 85 @ 71e3228bffe1 (draft) add new
86 86 |
87 87 | o c70b08862e08 (public) add old
88 88 |/
89 89 o b4952fcf48cf (public) add base
90 90
91 91
92 92 Abort: old will still be an head because it's public.
93 93
94 94 $ hg push
95 95 pushing to $TESTTMP/remote
96 96 searching for changes
97 97 abort: push creates new remote head 71e3228bffe1!
98 98 (merge or see 'hg help push' for details about pushing new heads)
99 99 [255]
100 100
101 101 old head is now public (public remote version)
102 102 ==============================================
103 103
104 104 TODO: Not implemented yet.
105 105
106 106 # setup
107 107 #
108 108 # $ rm -fr ../remote
109 109 # $ cp -R ../backup1 ../remote
110 110 # $ hg -R ../remote phase --public c70b08862e08
111 111 # $ hg phase --draft --force c70b08862e08
112 112 # $ hg log -G --hidden
113 113 # @ 71e3228bffe1 (draft) add new
114 114 # |
115 115 # | x c70b08862e08 (draft) add old
116 116 # |/
117 117 # o b4952fcf48cf (public) add base
118 118 #
119 119 #
120 120 #
121 121 # Abort: old will still be an head because it's public.
122 122 #
123 123 # $ hg push
124 124 # pushing to $TESTTMP/remote
125 125 # searching for changes
126 126 # abort: push creates new remote head 71e3228bffe1!
127 127 # (merge or see 'hg help push' for details about pushing new heads)
128 128 # [255]
129 129
130 130 old head is obsolete but replacement is not pushed
131 131 ==================================================
132 132
133 133 setup
134 134
135 135 $ rm -fr ../remote
136 136 $ cp -R ../backup1 ../remote
137 137 $ hg phase --draft --force '(0::) - 0'
138 138 $ hg up -q '.^'
139 139 $ mkcommit other
140 140 created new head
141 141 $ hg log -G --hidden
142 142 @ d7d41ccbd4de (draft) add other
143 143 |
144 144 | o 71e3228bffe1 (draft) add new
145 145 |/
146 146 | x c70b08862e08 (draft) add old
147 147 |/
148 148 o b4952fcf48cf (public) add base
149 149
150 150
151 151 old exists remotely as draft. It is obsoleted by new but we don't push new.
152 152 Push should abort on new head
153 153
154 154 $ hg push -r 'desc("other")'
155 155 pushing to $TESTTMP/remote
156 156 searching for changes
157 157 abort: push creates new remote head d7d41ccbd4de!
158 158 (merge or see 'hg help push' for details about pushing new heads)
159 159 [255]
160 160
161 161
162 162
163 163 Both precursors and successors are already know remotely. Descendant adds heads
164 164 ===============================================================================
165 165
166 166 setup. (The obsolete marker is known locally only
167 167
168 168 $ cd ..
169 169 $ rm -rf local
170 170 $ hg clone remote local
171 171 updating to branch default
172 172 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 173 $ cd local
174 174 $ mkcommit old
175 175 old already tracked!
176 176 nothing changed
177 177 [1]
178 178 $ hg up -q '.^'
179 179 $ mkcommit new
180 180 created new head
181 181 $ hg push -f
182 182 pushing to $TESTTMP/remote
183 183 searching for changes
184 184 adding changesets
185 185 adding manifests
186 186 adding file changes
187 187 added 1 changesets with 1 changes to 1 files (+1 heads)
188 188 $ mkcommit desc1
189 189 $ hg up -q '.^'
190 190 $ mkcommit desc2
191 191 created new head
192 192 $ hg debugobsolete `getid old` `getid new`
193 193 obsoleted 1 changesets
194 194 $ hg log -G --hidden
195 195 @ 5fe37041cc2b (draft) add desc2
196 196 |
197 197 | o a3ef1d111c5f (draft) add desc1
198 198 |/
199 199 o 71e3228bffe1 (draft) add new
200 200 |
201 201 | x c70b08862e08 (draft) add old
202 202 |/
203 203 o b4952fcf48cf (public) add base
204 204
205 205 $ hg log -G --hidden -R ../remote
206 206 o 71e3228bffe1 (draft) add new
207 207 |
208 208 | o c70b08862e08 (draft) add old
209 209 |/
210 210 @ b4952fcf48cf (public) add base
211 211
212 212 $ cp -R ../remote ../backup2
213 213
214 214 Push should not warn about adding new heads. We create one, but we'll delete
215 215 one anyway.
216 216
217 217 $ hg push
218 218 pushing to $TESTTMP/remote
219 219 searching for changes
220 220 adding changesets
221 221 adding manifests
222 222 adding file changes
223 223 added 2 changesets with 2 changes to 2 files (+1 heads)
224 224
225 225
226 226 Remote head is unknown but obsoleted by a local changeset
227 227 =========================================================
228 228
229 229 setup
230 230
231 231 $ rm -fr ../remote
232 232 $ cp -R ../backup1 ../remote
233 233 $ cd ..
234 234 $ rm -rf local
235 235 $ hg clone remote local -r 0
236 236 adding changesets
237 237 adding manifests
238 238 adding file changes
239 239 added 1 changesets with 1 changes to 1 files
240 240 new changesets b4952fcf48cf
241 241 updating to branch default
242 242 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 243 $ cd local
244 244 $ mkcommit new
245 245 $ hg -R ../remote id --debug -r tip
246 246 c70b08862e0838ea6d7c59c85da2f1ed6c8d67da tip
247 247 $ hg id --debug -r tip
248 248 71e3228bffe1886550777233d6c97bb5a6b2a650 tip
249 249 $ hg debugobsolete c70b08862e0838ea6d7c59c85da2f1ed6c8d67da 71e3228bffe1886550777233d6c97bb5a6b2a650
250 250 $ hg log -G --hidden
251 251 @ 71e3228bffe1 (draft) add new
252 252 |
253 253 o b4952fcf48cf (public) add base
254 254
255 255 $ hg log -G --hidden -R ../remote
256 256 o c70b08862e08 (draft) add old
257 257 |
258 258 @ b4952fcf48cf (public) add base
259 259
260 260
261 261 We do not have enought data to take the right decision, we should fail
262 262
263 263 $ hg push
264 264 pushing to $TESTTMP/remote
265 265 searching for changes
266 266 remote has heads on branch 'default' that are not known locally: c70b08862e08
267 267 abort: push creates new remote head 71e3228bffe1!
268 268 (pull and merge or see 'hg help push' for details about pushing new heads)
269 269 [255]
270 270
271 271 Pulling the missing data makes it work
272 272
273 273 $ hg pull
274 274 pulling from $TESTTMP/remote
275 275 searching for changes
276 276 adding changesets
277 277 adding manifests
278 278 adding file changes
279 279 added 1 changesets with 1 changes to 1 files (+1 heads)
280 (1 other changesets obsolete on arrival)
280 281 (run 'hg heads' to see heads)
281 282 $ hg push
282 283 pushing to $TESTTMP/remote
283 284 searching for changes
284 285 adding changesets
285 286 adding manifests
286 287 adding file changes
287 288 added 1 changesets with 1 changes to 1 files (+1 heads)
288 289
289 290 Old head is pruned without parent data and new unrelated head added
290 291 ===================================================================
291 292
292 293 setup
293 294
294 295 $ cd ..
295 296 $ rm -R remote local
296 297 $ cp -R backup1 remote
297 298 $ hg clone remote local -qr c70b08862e08
298 299 $ cd local
299 300 $ hg up -q '.^'
300 301 $ mkcommit new-unrelated
301 302 created new head
302 303 $ hg debugobsolete `getid old`
303 304 obsoleted 1 changesets
304 305 $ hg log -G --hidden
305 306 @ 350a93b716be (draft) add new-unrelated
306 307 |
307 308 | x c70b08862e08 (draft) add old
308 309 |/
309 310 o b4952fcf48cf (public) add base
310 311
311 312
312 313 $ hg push
313 314 pushing to $TESTTMP/remote
314 315 searching for changes
315 316 abort: push creates new remote head 350a93b716be!
316 317 (merge or see 'hg help push' for details about pushing new heads)
317 318 [255]
@@ -1,541 +1,543 b''
1 1 =============================
2 2 Test distributed obsolescence
3 3 =============================
4 4
5 5 This file test various cases where data (changeset, phase, obsmarkers) is
6 6 added to the repository in a specific order. Usually, this order is unlikely
7 7 to happen in the local case but can easily happen in the distributed case.
8 8
9 9 $ unset HGUSER
10 10 $ unset EMAIL
11 11 $ . $TESTDIR/testlib/obsmarker-common.sh
12 12 $ cat >> $HGRCPATH << EOF
13 13 > [extensions]
14 14 > rebase =
15 15 > [experimental]
16 16 > evolution = all
17 17 > [phases]
18 18 > publish = False
19 19 > [ui]
20 20 > logtemplate= {rev}:{node|short} {desc}{if(obsfate, " [{join(obsfate, "; ")}]")}\n
21 21 > EOF
22 22
23 23 Check distributed chain building
24 24 ================================
25 25
26 26 Test case where a changeset is marked as a successor of another local
27 27 changeset while the successor has already been obsoleted remotely.
28 28
29 29 The chain of evolution should seamlessly connect and all but the new version
30 30 (created remotely) should be seen as obsolete.
31 31
32 32 Initial setup
33 33
34 34 $ mkdir distributed-chain-building
35 35 $ cd distributed-chain-building
36 36 $ hg init server
37 37 $ cd server
38 38 $ cat << EOF >> .hg/hgrc
39 39 > [ui]
40 40 > username = server
41 41 > EOF
42 42 $ mkcommit ROOT
43 43 $ mkcommit c_A0
44 44 $ hg up 'desc("ROOT")'
45 45 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
46 46 $ mkcommit c_A1
47 47 created new head
48 48 $ hg up 'desc("ROOT")'
49 49 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
50 50 $ mkcommit c_B0
51 51 created new head
52 52 $ hg debugobsolete `getid 'desc("c_A0")'` `getid 'desc("c_A1")'`
53 53 obsoleted 1 changesets
54 54 $ hg log -G --hidden -v
55 55 @ 3:e5d7dda7cd28 c_B0
56 56 |
57 57 | o 2:7f6b0a6f5c25 c_A1
58 58 |/
59 59 | x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)]
60 60 |/
61 61 o 0:e82fb8d02bbf ROOT
62 62
63 63 $ hg debugobsolete
64 64 e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
65 65 $ cd ..
66 66
67 67 duplicate the repo for the client:
68 68
69 69 $ cp -R server client
70 70 $ cat << EOF >> client/.hg/hgrc
71 71 > [paths]
72 72 > default = ../server/
73 73 > [ui]
74 74 > username = client
75 75 > EOF
76 76
77 77 server side: create new revision on the server (obsoleting another one)
78 78
79 79 $ cd server
80 80 $ hg up 'desc("ROOT")'
81 81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 82 $ mkcommit c_B1
83 83 created new head
84 84 $ hg debugobsolete `getid 'desc("c_B0")'` `getid 'desc("c_B1")'`
85 85 obsoleted 1 changesets
86 86 $ hg log -G
87 87 @ 4:391a2bf12b1b c_B1
88 88 |
89 89 | o 2:7f6b0a6f5c25 c_A1
90 90 |/
91 91 o 0:e82fb8d02bbf ROOT
92 92
93 93 $ hg log -G --hidden -v
94 94 @ 4:391a2bf12b1b c_B1
95 95 |
96 96 | x 3:e5d7dda7cd28 c_B0 [rewritten as 4:391a2bf12b1b by server (at 1970-01-01 00:00 +0000)]
97 97 |/
98 98 | o 2:7f6b0a6f5c25 c_A1
99 99 |/
100 100 | x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)]
101 101 |/
102 102 o 0:e82fb8d02bbf ROOT
103 103
104 104 $ hg debugobsolete
105 105 e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
106 106 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 391a2bf12b1b8b05a72400ae36b26d50a091dc22 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
107 107 $ cd ..
108 108
109 109 client side: create a marker between two common changesets
110 110 (client is not aware of the server activity yet)
111 111
112 112 $ cd client
113 113 $ hg debugobsolete `getid 'desc("c_A1")'` `getid 'desc("c_B0")'`
114 114 obsoleted 1 changesets
115 115 $ hg log -G
116 116 @ 3:e5d7dda7cd28 c_B0
117 117 |
118 118 o 0:e82fb8d02bbf ROOT
119 119
120 120 $ hg log -G --hidden -v
121 121 @ 3:e5d7dda7cd28 c_B0
122 122 |
123 123 | x 2:7f6b0a6f5c25 c_A1 [rewritten as 3:e5d7dda7cd28 by client (at 1970-01-01 00:00 +0000)]
124 124 |/
125 125 | x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)]
126 126 |/
127 127 o 0:e82fb8d02bbf ROOT
128 128
129 129 $ hg debugobsolete
130 130 e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
131 131 7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'}
132 132
133 133 client side: pull from the server
134 134 (the new successors should take over)
135 135
136 136 $ hg up 'desc("ROOT")'
137 137 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
138 138 $ hg pull
139 139 pulling from $TESTTMP/distributed-chain-building/server
140 140 searching for changes
141 141 adding changesets
142 142 adding manifests
143 143 adding file changes
144 144 added 1 changesets with 1 changes to 1 files (+1 heads)
145 145 1 new obsolescence markers
146 146 obsoleted 1 changesets
147 147 new changesets 391a2bf12b1b (1 drafts)
148 148 (run 'hg heads' to see heads)
149 149 $ hg log -G
150 150 o 4:391a2bf12b1b c_B1
151 151 |
152 152 @ 0:e82fb8d02bbf ROOT
153 153
154 154 $ hg log -G --hidden -v
155 155 o 4:391a2bf12b1b c_B1
156 156 |
157 157 | x 3:e5d7dda7cd28 c_B0 [rewritten as 4:391a2bf12b1b by server (at 1970-01-01 00:00 +0000)]
158 158 |/
159 159 | x 2:7f6b0a6f5c25 c_A1 [rewritten as 3:e5d7dda7cd28 by client (at 1970-01-01 00:00 +0000)]
160 160 |/
161 161 | x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)]
162 162 |/
163 163 @ 0:e82fb8d02bbf ROOT
164 164
165 165 $ hg debugobsolete
166 166 e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
167 167 7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'}
168 168 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 391a2bf12b1b8b05a72400ae36b26d50a091dc22 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
169 169
170 170 server side: receive client push
171 171 (the other way around, pushing to the server, the obsolete changesets stay
172 172 obsolete on the server side but the marker is sent out.)
173 173
174 174 $ hg rollback
175 175 repository tip rolled back to revision 3 (undo pull)
176 176 $ hg push -f
177 177 pushing to $TESTTMP/distributed-chain-building/server
178 178 searching for changes
179 179 adding changesets
180 180 adding manifests
181 181 adding file changes
182 182 added 0 changesets with 0 changes to 1 files
183 183 1 new obsolescence markers
184 184 obsoleted 1 changesets
185 185 $ hg -R ../server/ log -G
186 186 @ 4:391a2bf12b1b c_B1
187 187 |
188 188 o 0:e82fb8d02bbf ROOT
189 189
190 190 $ hg -R ../server/ log -G --hidden -v
191 191 @ 4:391a2bf12b1b c_B1
192 192 |
193 193 | x 3:e5d7dda7cd28 c_B0 [rewritten as 4:391a2bf12b1b by server (at 1970-01-01 00:00 +0000)]
194 194 |/
195 195 | x 2:7f6b0a6f5c25 c_A1 [rewritten as 3:e5d7dda7cd28 by client (at 1970-01-01 00:00 +0000)]
196 196 |/
197 197 | x 1:e1b46f0f979f c_A0 [rewritten as 2:7f6b0a6f5c25 by server (at 1970-01-01 00:00 +0000)]
198 198 |/
199 199 o 0:e82fb8d02bbf ROOT
200 200
201 201 $ hg debugobsolete
202 202 e1b46f0f979f52748347ff8729c59f2ef56e6fe2 7f6b0a6f5c25345a83870963efd827c1798a5959 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'server'}
203 203 7f6b0a6f5c25345a83870963efd827c1798a5959 e5d7dda7cd28e6b3f79437e5b8122a38ece0255c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'client'}
204 204 $ cd ..
205 205
206 206 Check getting changesets after getting the markers
207 207 =================================================
208 208
209 209 This test case covers the scenario where commits are received -after- we
210 210 received some obsolescence markers turning them obsolete.
211 211
212 212 For example, we pull some successors from a repository (with associated
213 213 predecessors marker chain) and then later we pull some intermediate
214 214 precedessors changeset from another repository. Obsolescence markers must
215 215 apply to the intermediate changeset. They have to be obsolete (and hidden).
216 216
217 217 Avoiding pulling the changeset in the first place is a tricky decision because
218 218 there could be non-obsolete ancestors that need to be pulled, but the
219 219 discovery cannot currently find these (this is not the case in this tests). In
220 220 addition, we could also have to pull the changeset because they have children.
221 221 In this case, they would not be hidden (yet) because of the orphan descendant,
222 222 but they would still have to be obsolete. (This is not tested in this case
223 223 either).
224 224
225 225 $ mkdir distributed-chain-building
226 226 $ cd distributed-chain-building
227 227 $ hg init server
228 228 $ cd server
229 229 $ cat << EOF >> .hg/hgrc
230 230 > [ui]
231 231 > username = server
232 232 > EOF
233 233 $ mkcommit ROOT
234 234 $ cd ..
235 235 $ hg clone server repo-Alice
236 236 updating to branch default
237 237 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 238 $ cat << EOF >> repo-Alice/.hg/hgrc
239 239 > [ui]
240 240 > username = alice
241 241 > EOF
242 242 $ hg clone server repo-Bob
243 243 updating to branch default
244 244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 245 $ cat << EOF >> repo-Bob/.hg/hgrc
246 246 > [ui]
247 247 > username = bob
248 248 > EOF
249 249 $ hg clone server repo-Celeste
250 250 updating to branch default
251 251 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 252 $ cat << EOF >> repo-Celeste/.hg/hgrc
253 253 > [ui]
254 254 > username = celeste
255 255 > EOF
256 256
257 257 Create some changesets locally
258 258
259 259 $ cd repo-Alice
260 260 $ mkcommit c_A0
261 261 $ mkcommit c_B0
262 262 $ cd ..
263 263
264 264 Bob pulls from Alice and rewrites them
265 265
266 266 $ cd repo-Bob
267 267 $ hg pull ../repo-Alice
268 268 pulling from ../repo-Alice
269 269 searching for changes
270 270 adding changesets
271 271 adding manifests
272 272 adding file changes
273 273 added 2 changesets with 2 changes to 2 files
274 274 new changesets d33b0a3a6464:ef908e42ce65 (2 drafts)
275 275 (run 'hg update' to get a working copy)
276 276 $ hg up 'desc("c_A")'
277 277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 278 $ hg commit --amend -m 'c_A1'
279 279 1 new orphan changesets
280 280 $ hg rebase -r 'desc("c_B0")' -d . # no easy way to rewrite the message with the rebase
281 281 rebasing 2:ef908e42ce65 "c_B0"
282 282 $ hg up
283 283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 284 $ hg commit --amend -m 'c_B1'
285 285 $ hg log -G
286 286 @ 5:956063ac4557 c_B1
287 287 |
288 288 o 3:5b5708a437f2 c_A1
289 289 |
290 290 o 0:e82fb8d02bbf ROOT
291 291
292 292 $ hg log -G --hidden -v
293 293 @ 5:956063ac4557 c_B1
294 294 |
295 295 | x 4:5ffb9e311b35 c_B0 [rewritten using amend as 5:956063ac4557 by bob (at 1970-01-01 00:00 +0000)]
296 296 |/
297 297 o 3:5b5708a437f2 c_A1
298 298 |
299 299 | x 2:ef908e42ce65 c_B0 [rewritten using rebase as 4:5ffb9e311b35 by bob (at 1970-01-01 00:00 +0000)]
300 300 | |
301 301 | x 1:d33b0a3a6464 c_A0 [rewritten using amend as 3:5b5708a437f2 by bob (at 1970-01-01 00:00 +0000)]
302 302 |/
303 303 o 0:e82fb8d02bbf ROOT
304 304
305 305 $ hg debugobsolete
306 306 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
307 307 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'}
308 308 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
309 309 $ cd ..
310 310
311 311 Celeste pulls from Bob and rewrites them again
312 312
313 313 $ cd repo-Celeste
314 314 $ hg pull ../repo-Bob
315 315 pulling from ../repo-Bob
316 316 searching for changes
317 317 adding changesets
318 318 adding manifests
319 319 adding file changes
320 320 added 2 changesets with 2 changes to 2 files
321 321 3 new obsolescence markers
322 322 new changesets 5b5708a437f2:956063ac4557 (2 drafts)
323 323 (run 'hg update' to get a working copy)
324 324 $ hg up 'desc("c_A")'
325 325 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 326 $ hg commit --amend -m 'c_A2'
327 327 1 new orphan changesets
328 328 $ hg rebase -r 'desc("c_B1")' -d . # no easy way to rewrite the message with the rebase
329 329 rebasing 2:956063ac4557 "c_B1"
330 330 $ hg up
331 331 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 332 $ hg commit --amend -m 'c_B2'
333 333 $ hg log -G
334 334 @ 5:77ae25d99ff0 c_B2
335 335 |
336 336 o 3:9866d64649a5 c_A2
337 337 |
338 338 o 0:e82fb8d02bbf ROOT
339 339
340 340 $ hg log -G --hidden -v
341 341 @ 5:77ae25d99ff0 c_B2
342 342 |
343 343 | x 4:3cf8de21cc22 c_B1 [rewritten using amend as 5:77ae25d99ff0 by celeste (at 1970-01-01 00:00 +0000)]
344 344 |/
345 345 o 3:9866d64649a5 c_A2
346 346 |
347 347 | x 2:956063ac4557 c_B1 [rewritten using rebase as 4:3cf8de21cc22 by celeste (at 1970-01-01 00:00 +0000)]
348 348 | |
349 349 | x 1:5b5708a437f2 c_A1 [rewritten using amend as 3:9866d64649a5 by celeste (at 1970-01-01 00:00 +0000)]
350 350 |/
351 351 o 0:e82fb8d02bbf ROOT
352 352
353 353 $ hg debugobsolete
354 354 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
355 355 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
356 356 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'}
357 357 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
358 358 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'}
359 359 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
360 360
361 361 Celeste now pushes to the server
362 362
363 363 (note: it would be enough to just have direct Celeste -> Alice exchange here.
364 364 However using a central server seems more common)
365 365
366 366 $ hg push
367 367 pushing to $TESTTMP/distributed-chain-building/distributed-chain-building/server
368 368 searching for changes
369 369 adding changesets
370 370 adding manifests
371 371 adding file changes
372 372 added 2 changesets with 2 changes to 2 files
373 373 6 new obsolescence markers
374 374 $ cd ..
375 375
376 376 Now Alice pulls from the server, then from Bob
377 377
378 378 Alice first retrieves the new evolution of its changesets and associated markers
379 379 from the server (note: could be from Celeste directly)
380 380
381 381 $ cd repo-Alice
382 382 $ hg up 'desc(ROOT)'
383 383 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
384 384 $ hg pull
385 385 pulling from $TESTTMP/distributed-chain-building/distributed-chain-building/server
386 386 searching for changes
387 387 adding changesets
388 388 adding manifests
389 389 adding file changes
390 390 added 2 changesets with 0 changes to 2 files (+1 heads)
391 391 6 new obsolescence markers
392 392 obsoleted 2 changesets
393 393 new changesets 9866d64649a5:77ae25d99ff0 (2 drafts)
394 394 (run 'hg heads' to see heads)
395 395 $ hg debugobsolete
396 396 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
397 397 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
398 398 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
399 399 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'}
400 400 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
401 401 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'}
402 402
403 403 Then, she pulls from Bob, pulling predecessors of the changeset she has
404 404 already pulled. The changesets are not obsoleted in the Bob repo yet. Their
405 405 successors do not exist in Bob repository yet.
406 406
407 407 $ hg pull ../repo-Bob
408 408 pulling from ../repo-Bob
409 409 searching for changes
410 410 adding changesets
411 411 adding manifests
412 412 adding file changes
413 413 added 2 changesets with 0 changes to 2 files (+1 heads)
414 (2 other changesets obsolete on arrival)
414 415 (run 'hg heads' to see heads)
415 416 $ hg log -G
416 417 o 4:77ae25d99ff0 c_B2
417 418 |
418 419 o 3:9866d64649a5 c_A2
419 420 |
420 421 @ 0:e82fb8d02bbf ROOT
421 422
422 423 $ hg debugobsolete
423 424 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
424 425 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
425 426 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
426 427 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'}
427 428 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
428 429 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'}
429 430
430 431 Same tests, but change coming from a bundle
431 432 (testing with a bundle is interesting because absolutely no discovery or
432 433 decision is made in that case, so receiving the changesets are not an option).
433 434
434 435 $ hg rollback
435 436 repository tip rolled back to revision 4 (undo pull)
436 437 $ hg log -G
437 438 o 4:77ae25d99ff0 c_B2
438 439 |
439 440 o 3:9866d64649a5 c_A2
440 441 |
441 442 @ 0:e82fb8d02bbf ROOT
442 443
443 444 $ hg debugobsolete
444 445 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
445 446 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
446 447 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
447 448 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'}
448 449 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
449 450 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'}
450 451 $ hg -R ../repo-Bob bundle ../step-1.hg
451 452 searching for changes
452 453 2 changesets found
453 454 $ hg unbundle ../step-1.hg
454 455 adding changesets
455 456 adding manifests
456 457 adding file changes
457 458 added 2 changesets with 0 changes to 2 files (+1 heads)
459 (2 other changesets obsolete on arrival)
458 460 (run 'hg heads' to see heads)
459 461 $ hg log -G
460 462 o 4:77ae25d99ff0 c_B2
461 463 |
462 464 o 3:9866d64649a5 c_A2
463 465 |
464 466 @ 0:e82fb8d02bbf ROOT
465 467
466 468 $ hg log -G --hidden -v
467 469 x 6:956063ac4557 c_B1 [rewritten using amend, rebase as 4:77ae25d99ff0 by celeste (at 1970-01-01 00:00 +0000)]
468 470 |
469 471 x 5:5b5708a437f2 c_A1 [rewritten using amend as 3:9866d64649a5 by celeste (at 1970-01-01 00:00 +0000)]
470 472 |
471 473 | o 4:77ae25d99ff0 c_B2
472 474 | |
473 475 | o 3:9866d64649a5 c_A2
474 476 |/
475 477 | x 2:ef908e42ce65 c_B0 [rewritten using amend, rebase as 6:956063ac4557 by bob (at 1970-01-01 00:00 +0000)]
476 478 | |
477 479 | x 1:d33b0a3a6464 c_A0 [rewritten using amend as 5:5b5708a437f2 by bob (at 1970-01-01 00:00 +0000)]
478 480 |/
479 481 @ 0:e82fb8d02bbf ROOT
480 482
481 483 $ hg debugobsolete
482 484 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 77ae25d99ff07889e181126b1171b94bec8e5227 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
483 485 5b5708a437f27665db42c5a261a539a1bcb2a8c2 9866d64649a5d9c5991fe119c7b2c33898114e10 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'celeste'}
484 486 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 956063ac4557828781733b2d5677a351ce856f59 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
485 487 956063ac4557828781733b2d5677a351ce856f59 3cf8de21cc2282186857d2266eb6b1f9cb85ecf3 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'celeste'}
486 488 d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}
487 489 ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'}
488 490
489 491 $ cd ..
490 492
491 493 Test pull report consistency
492 494 ============================
493 495
494 496 obsolete but visible should be reported
495 497 ---------------------------------------
496 498
497 499 Setup
498 500
499 501 $ hg init repo-a
500 502 $ cat << EOF >> repo-a/.hg/hgrc
501 503 > [ui]
502 504 > username=test
503 505 > EOF
504 506 $ cd repo-a
505 507 $ hg debugbuilddag ..
506 508 $ hg debugobsolete `getid tip`
507 509 obsoleted 1 changesets
508 510 $ cd ../
509 511 $ hg clone --pull repo-a repo-b
510 512 requesting all changes
511 513 adding changesets
512 514 adding manifests
513 515 adding file changes
514 516 added 1 changesets with 0 changes to 0 files
515 517 new changesets 1ea73414a91b (1 drafts)
516 518 updating to branch default
517 519 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
518 520 $ hg -R repo-a up tip --hidden
519 521 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
520 522 updated to hidden changeset 66f7d451a68b
521 523 (hidden revision '66f7d451a68b' is pruned)
522 524 $ hg -R repo-a branch foo
523 525 marked working directory as branch foo
524 526 (branches are permanent and global, did you want a bookmark?)
525 527 $ hg -R repo-a commit -m foo
526 528 1 new orphan changesets
527 529
528 530 Actual test
529 531 (BROKEN)
530 532
531 533 $ hg -R repo-b pull
532 534 pulling from $TESTTMP/distributed-chain-building/distributed-chain-building/repo-a
533 535 searching for changes
534 536 adding changesets
535 537 adding manifests
536 538 adding file changes
537 539 added 2 changesets with 0 changes to 0 files
538 540 1 new obsolescence markers
539 541 1 new orphan changesets
540 542 new changesets 66f7d451a68b:95d586532b49 (2 drafts)
541 543 (run 'hg update' to get a working copy)
@@ -1,1620 +1,1621 b''
1 1 $ cat >> $HGRCPATH << EOF
2 2 > [phases]
3 3 > # public changeset are not obsolete
4 4 > publish=false
5 5 > [ui]
6 6 > logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if(instabilities, ' {instabilities}')}) [{tags} {bookmarks}] {desc|firstline}{if(obsfate, " [{join(obsfate, "; ")}]")}\n"
7 7 > EOF
8 8 $ mkcommit() {
9 9 > echo "$1" > "$1"
10 10 > hg add "$1"
11 11 > hg ci -m "add $1"
12 12 > }
13 13 $ getid() {
14 14 > hg log -T "{node}\n" --hidden -r "desc('$1')"
15 15 > }
16 16
17 17 $ cat > debugkeys.py <<EOF
18 18 > def reposetup(ui, repo):
19 19 > class debugkeysrepo(repo.__class__):
20 20 > def listkeys(self, namespace):
21 21 > ui.write(b'listkeys %s\n' % (namespace,))
22 22 > return super(debugkeysrepo, self).listkeys(namespace)
23 23 >
24 24 > if repo.local():
25 25 > repo.__class__ = debugkeysrepo
26 26 > EOF
27 27
28 28 $ hg init tmpa
29 29 $ cd tmpa
30 30 $ mkcommit kill_me
31 31
32 32 Checking that the feature is properly disabled
33 33
34 34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
35 35 abort: creating obsolete markers is not enabled on this repo
36 36 [255]
37 37
38 38 Enabling it
39 39
40 40 $ cat >> $HGRCPATH << EOF
41 41 > [experimental]
42 42 > evolution=exchange
43 43 > evolution.createmarkers=True
44 44 > EOF
45 45
46 46 Killing a single changeset without replacement
47 47
48 48 $ hg debugobsolete 0
49 49 abort: changeset references must be full hexadecimal node identifiers
50 50 [255]
51 51 $ hg debugobsolete '00'
52 52 abort: changeset references must be full hexadecimal node identifiers
53 53 [255]
54 54 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
55 55 obsoleted 1 changesets
56 56 $ hg debugobsolete
57 57 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'}
58 58
59 59 (test that mercurial is not confused)
60 60
61 61 $ hg up null --quiet # having 0 as parent prevents it to be hidden
62 62 $ hg tip
63 63 -1:000000000000 (public) [tip ]
64 64 $ hg up --hidden tip --quiet
65 65 updated to hidden changeset 97b7c2d76b18
66 66 (hidden revision '97b7c2d76b18' is pruned)
67 67
68 68 Killing a single changeset with itself should fail
69 69 (simple local safeguard)
70 70
71 71 $ hg debugobsolete `getid kill_me` `getid kill_me`
72 72 abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0
73 73 [255]
74 74
75 75 $ cd ..
76 76
77 77 Killing a single changeset with replacement
78 78 (and testing the format option)
79 79
80 80 $ hg init tmpb
81 81 $ cd tmpb
82 82 $ mkcommit a
83 83 $ mkcommit b
84 84 $ mkcommit original_c
85 85 $ hg up "desc('b')"
86 86 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
87 87 $ mkcommit new_c
88 88 created new head
89 89 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
90 90 $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120'
91 91 obsoleted 1 changesets
92 92 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
93 93 2:245bde4270cd add original_c
94 94 $ hg debugrevlog -cd
95 95 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
96 96 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
97 97 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
98 98 2 1 -1 118 193 118 118 59 0 76 192 0 1 0
99 99 3 1 -1 193 260 193 193 59 0 66 258 0 2 0
100 100 $ hg debugobsolete
101 101 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
102 102
103 103 (check for version number of the obsstore)
104 104
105 105 $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
106 106 \x00 (no-eol) (esc)
107 107
108 108 do it again (it read the obsstore before adding new changeset)
109 109
110 110 $ hg up '.^'
111 111 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
112 112 $ mkcommit new_2_c
113 113 created new head
114 114 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
115 115 obsoleted 1 changesets
116 116 $ hg debugobsolete
117 117 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
118 118 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
119 119
120 120 Register two markers with a missing node
121 121
122 122 $ hg up '.^'
123 123 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
124 124 $ mkcommit new_3_c
125 125 created new head
126 126 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
127 127 obsoleted 1 changesets
128 128 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
129 129 $ hg debugobsolete
130 130 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
131 131 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
132 132 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
133 133 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
134 134
135 135 Test the --index option of debugobsolete command
136 136 $ hg debugobsolete --index
137 137 0 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
138 138 1 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
139 139 2 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
140 140 3 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
141 141
142 142 Refuse pathological nullid successors
143 143 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
144 144 transaction abort!
145 145 rollback completed
146 146 abort: bad obsolescence marker detected: invalid successors nullid
147 147 [255]
148 148
149 149 Check that graphlog detect that a changeset is obsolete:
150 150
151 151 $ hg log -G
152 152 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
153 153 |
154 154 o 1:7c3bad9141dc (draft) [ ] add b
155 155 |
156 156 o 0:1f0dee641bb7 (draft) [ ] add a
157 157
158 158
159 159 check that heads does not report them
160 160
161 161 $ hg heads
162 162 5:5601fb93a350 (draft) [tip ] add new_3_c
163 163 $ hg heads --hidden
164 164 5:5601fb93a350 (draft) [tip ] add new_3_c
165 165 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c [rewritten as 5:5601fb93a350]
166 166 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c [rewritten as 4:ca819180edb9]
167 167 2:245bde4270cd (draft *obsolete*) [ ] add original_c [rewritten as 3:cdbce2fbb163]
168 168
169 169
170 170 check that summary does not report them
171 171
172 172 $ hg init ../sink
173 173 $ echo '[paths]' >> .hg/hgrc
174 174 $ echo 'default=../sink' >> .hg/hgrc
175 175 $ hg summary --remote
176 176 parent: 5:5601fb93a350 tip
177 177 add new_3_c
178 178 branch: default
179 179 commit: (clean)
180 180 update: (current)
181 181 phases: 3 draft
182 182 remote: 3 outgoing
183 183
184 184 $ hg summary --remote --hidden
185 185 parent: 5:5601fb93a350 tip
186 186 add new_3_c
187 187 branch: default
188 188 commit: (clean)
189 189 update: 3 new changesets, 4 branch heads (merge)
190 190 phases: 6 draft
191 191 remote: 3 outgoing
192 192
193 193 check that various commands work well with filtering
194 194
195 195 $ hg tip
196 196 5:5601fb93a350 (draft) [tip ] add new_3_c
197 197 $ hg log -r 6
198 198 abort: unknown revision '6'!
199 199 [255]
200 200 $ hg log -r 4
201 201 abort: hidden revision '4' was rewritten as: 5601fb93a350!
202 202 (use --hidden to access hidden revisions)
203 203 [255]
204 204 $ hg debugrevspec 'rev(6)'
205 205 $ hg debugrevspec 'rev(4)'
206 206 $ hg debugrevspec 'null'
207 207 -1
208 208
209 209 Check that public changeset are not accounted as obsolete:
210 210
211 211 $ hg --hidden phase --public 2
212 212 1 new phase-divergent changesets
213 213 $ hg log -G
214 214 @ 5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c
215 215 |
216 216 | o 2:245bde4270cd (public) [ ] add original_c
217 217 |/
218 218 o 1:7c3bad9141dc (public) [ ] add b
219 219 |
220 220 o 0:1f0dee641bb7 (public) [ ] add a
221 221
222 222
223 223 And that bumped changeset are detected
224 224 --------------------------------------
225 225
226 226 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
227 227 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
228 228 the public changeset
229 229
230 230 $ hg log --hidden -r 'phasedivergent()'
231 231 5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c
232 232
233 233 And that we can't push bumped changeset
234 234
235 235 $ hg push ../tmpa -r 0 --force #(make repo related)
236 236 pushing to ../tmpa
237 237 searching for changes
238 238 warning: repository is unrelated
239 239 adding changesets
240 240 adding manifests
241 241 adding file changes
242 242 added 1 changesets with 1 changes to 1 files (+1 heads)
243 243 $ hg push ../tmpa
244 244 pushing to ../tmpa
245 245 searching for changes
246 246 abort: push includes phase-divergent changeset: 5601fb93a350!
247 247 [255]
248 248
249 249 Fixing "bumped" situation
250 250 We need to create a clone of 5 and add a special marker with a flag
251 251
252 252 $ hg summary
253 253 parent: 5:5601fb93a350 tip (phase-divergent)
254 254 add new_3_c
255 255 branch: default
256 256 commit: (clean)
257 257 update: 1 new changesets, 2 branch heads (merge)
258 258 phases: 1 draft
259 259 phase-divergent: 1 changesets
260 260 $ hg up '5^'
261 261 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
262 262 $ hg revert -ar 5
263 263 adding new_3_c
264 264 $ hg ci -m 'add n3w_3_c'
265 265 created new head
266 266 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
267 267 obsoleted 1 changesets
268 268 $ hg log -r 'phasedivergent()'
269 269 $ hg log -G
270 270 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
271 271 |
272 272 | o 2:245bde4270cd (public) [ ] add original_c
273 273 |/
274 274 o 1:7c3bad9141dc (public) [ ] add b
275 275 |
276 276 o 0:1f0dee641bb7 (public) [ ] add a
277 277
278 278
279 279 Basic exclusive testing
280 280
281 281 $ hg log -G --hidden
282 282 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
283 283 |
284 284 | x 5:5601fb93a350 (draft *obsolete*) [ ] add new_3_c [rewritten as 6:6f9641995072]
285 285 |/
286 286 | x 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c [rewritten as 5:5601fb93a350]
287 287 |/
288 288 | x 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c [rewritten as 4:ca819180edb9]
289 289 |/
290 290 | o 2:245bde4270cd (public) [ ] add original_c
291 291 |/
292 292 o 1:7c3bad9141dc (public) [ ] add b
293 293 |
294 294 o 0:1f0dee641bb7 (public) [ ] add a
295 295
296 296 $ hg debugobsolete --rev 6f9641995072
297 297 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
298 298 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
299 299 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
300 300 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
301 301 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
302 302 $ hg debugobsolete --rev 6f9641995072 --exclusive
303 303 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
304 304 $ hg debugobsolete --rev 5601fb93a350 --hidden
305 305 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
306 306 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
307 307 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
308 308 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
309 309 $ hg debugobsolete --rev 5601fb93a350 --hidden --exclusive
310 310 $ hg debugobsolete --rev 5601fb93a350+6f9641995072 --hidden --exclusive
311 311 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
312 312 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
313 313 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
314 314
315 315 $ cd ..
316 316
317 317 Revision 0 is hidden
318 318 --------------------
319 319
320 320 $ hg init rev0hidden
321 321 $ cd rev0hidden
322 322
323 323 $ mkcommit kill0
324 324 $ hg up -q null
325 325 $ hg debugobsolete `getid kill0`
326 326 obsoleted 1 changesets
327 327 $ mkcommit a
328 328 $ mkcommit b
329 329
330 330 Should pick the first visible revision as "repo" node
331 331
332 332 $ hg archive ../archive-null
333 333 $ cat ../archive-null/.hg_archival.txt
334 334 repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e
335 335 node: 7c3bad9141dcb46ff89abf5f61856facd56e476c
336 336 branch: default
337 337 latesttag: null
338 338 latesttagdistance: 2
339 339 changessincelatesttag: 2
340 340
341 341
342 342 $ cd ..
343 343
344 344 Can disable transaction summary report
345 345
346 346 $ hg init transaction-summary
347 347 $ cd transaction-summary
348 348 $ mkcommit a
349 349 $ mkcommit b
350 350 $ hg up -q null
351 351 $ hg --config experimental.evolution.report-instabilities=false debugobsolete `getid a`
352 352 obsoleted 1 changesets
353 353 $ cd ..
354 354
355 355 Exchange Test
356 356 ============================
357 357
358 358 Destination repo does not have any data
359 359 ---------------------------------------
360 360
361 361 Simple incoming test
362 362
363 363 $ hg init tmpc
364 364 $ cd tmpc
365 365 $ hg incoming ../tmpb
366 366 comparing with ../tmpb
367 367 0:1f0dee641bb7 (public) [ ] add a
368 368 1:7c3bad9141dc (public) [ ] add b
369 369 2:245bde4270cd (public) [ ] add original_c
370 370 6:6f9641995072 (draft) [tip ] add n3w_3_c
371 371
372 372 Try to pull markers
373 373 (extinct changeset are excluded but marker are pushed)
374 374
375 375 $ hg pull ../tmpb
376 376 pulling from ../tmpb
377 377 requesting all changes
378 378 adding changesets
379 379 adding manifests
380 380 adding file changes
381 381 added 4 changesets with 4 changes to 4 files (+1 heads)
382 382 5 new obsolescence markers
383 383 new changesets 1f0dee641bb7:6f9641995072 (1 drafts)
384 384 (run 'hg heads' to see heads, 'hg merge' to merge)
385 385 $ hg debugobsolete
386 386 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
387 387 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
388 388 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
389 389 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
390 390 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
391 391
392 392 Rollback//Transaction support
393 393
394 394 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
395 395 $ hg debugobsolete
396 396 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
397 397 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
398 398 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
399 399 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
400 400 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
401 401 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'}
402 402 $ hg rollback -n
403 403 repository tip rolled back to revision 3 (undo debugobsolete)
404 404 $ hg rollback
405 405 repository tip rolled back to revision 3 (undo debugobsolete)
406 406 $ hg debugobsolete
407 407 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
408 408 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
409 409 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
410 410 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
411 411 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
412 412
413 413 $ cd ..
414 414
415 415 Try to push markers
416 416
417 417 $ hg init tmpd
418 418 $ hg -R tmpb push tmpd
419 419 pushing to tmpd
420 420 searching for changes
421 421 adding changesets
422 422 adding manifests
423 423 adding file changes
424 424 added 4 changesets with 4 changes to 4 files (+1 heads)
425 425 5 new obsolescence markers
426 426 $ hg -R tmpd debugobsolete | sort
427 427 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
428 428 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
429 429 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
430 430 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
431 431 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
432 432
433 433 Check obsolete keys are exchanged only if source has an obsolete store
434 434
435 435 $ hg init empty
436 436 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
437 437 pushing to tmpd
438 438 listkeys phases
439 439 listkeys bookmarks
440 440 no changes found
441 441 listkeys phases
442 442 [1]
443 443
444 444 clone support
445 445 (markers are copied and extinct changesets are included to allow hardlinks)
446 446
447 447 $ hg clone tmpb clone-dest
448 448 updating to branch default
449 449 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 450 $ hg -R clone-dest log -G --hidden
451 451 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
452 452 |
453 453 | x 5:5601fb93a350 (draft *obsolete*) [ ] add new_3_c [rewritten as 6:6f9641995072]
454 454 |/
455 455 | x 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c [rewritten as 5:5601fb93a350]
456 456 |/
457 457 | x 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c [rewritten as 4:ca819180edb9]
458 458 |/
459 459 | o 2:245bde4270cd (public) [ ] add original_c
460 460 |/
461 461 o 1:7c3bad9141dc (public) [ ] add b
462 462 |
463 463 o 0:1f0dee641bb7 (public) [ ] add a
464 464
465 465 $ hg -R clone-dest debugobsolete
466 466 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
467 467 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
468 468 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
469 469 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
470 470 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
471 471
472 472
473 473 Destination repo have existing data
474 474 ---------------------------------------
475 475
476 476 On pull
477 477
478 478 $ hg init tmpe
479 479 $ cd tmpe
480 480 $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00
481 481 $ hg pull ../tmpb
482 482 pulling from ../tmpb
483 483 requesting all changes
484 484 adding changesets
485 485 adding manifests
486 486 adding file changes
487 487 added 4 changesets with 4 changes to 4 files (+1 heads)
488 488 5 new obsolescence markers
489 489 new changesets 1f0dee641bb7:6f9641995072 (1 drafts)
490 490 (run 'hg heads' to see heads, 'hg merge' to merge)
491 491 $ hg debugobsolete
492 492 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
493 493 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
494 494 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
495 495 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
496 496 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
497 497 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
498 498
499 499
500 500 On push
501 501
502 502 $ hg push ../tmpc
503 503 pushing to ../tmpc
504 504 searching for changes
505 505 no changes found
506 506 1 new obsolescence markers
507 507 [1]
508 508 $ hg -R ../tmpc debugobsolete
509 509 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
510 510 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
511 511 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
512 512 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
513 513 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
514 514 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
515 515
516 516 detect outgoing obsolete and unstable
517 517 ---------------------------------------
518 518
519 519
520 520 $ hg log -G
521 521 o 3:6f9641995072 (draft) [tip ] add n3w_3_c
522 522 |
523 523 | o 2:245bde4270cd (public) [ ] add original_c
524 524 |/
525 525 o 1:7c3bad9141dc (public) [ ] add b
526 526 |
527 527 o 0:1f0dee641bb7 (public) [ ] add a
528 528
529 529 $ hg up 'desc("n3w_3_c")'
530 530 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
531 531 $ mkcommit original_d
532 532 $ mkcommit original_e
533 533 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
534 534 obsoleted 1 changesets
535 535 1 new orphan changesets
536 536 $ hg debugobsolete | grep `getid original_d`
537 537 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
538 538 $ hg log -r 'obsolete()'
539 539 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
540 540 $ hg summary
541 541 parent: 5:cda648ca50f5 tip (orphan)
542 542 add original_e
543 543 branch: default
544 544 commit: (clean)
545 545 update: 1 new changesets, 2 branch heads (merge)
546 546 phases: 3 draft
547 547 orphan: 1 changesets
548 548 $ hg log -G -r '::orphan()'
549 549 @ 5:cda648ca50f5 (draft orphan) [tip ] add original_e
550 550 |
551 551 x 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
552 552 |
553 553 o 3:6f9641995072 (draft) [ ] add n3w_3_c
554 554 |
555 555 o 1:7c3bad9141dc (public) [ ] add b
556 556 |
557 557 o 0:1f0dee641bb7 (public) [ ] add a
558 558
559 559
560 560 refuse to push obsolete changeset
561 561
562 562 $ hg push ../tmpc/ -r 'desc("original_d")'
563 563 pushing to ../tmpc/
564 564 searching for changes
565 565 abort: push includes obsolete changeset: 94b33453f93b!
566 566 [255]
567 567
568 568 refuse to push unstable changeset
569 569
570 570 $ hg push ../tmpc/
571 571 pushing to ../tmpc/
572 572 searching for changes
573 573 abort: push includes orphan changeset: cda648ca50f5!
574 574 [255]
575 575
576 576 Test that extinct changeset are properly detected
577 577
578 578 $ hg log -r 'extinct()'
579 579
580 580 Don't try to push extinct changeset
581 581
582 582 $ hg init ../tmpf
583 583 $ hg out ../tmpf
584 584 comparing with ../tmpf
585 585 searching for changes
586 586 0:1f0dee641bb7 (public) [ ] add a
587 587 1:7c3bad9141dc (public) [ ] add b
588 588 2:245bde4270cd (public) [ ] add original_c
589 589 3:6f9641995072 (draft) [ ] add n3w_3_c
590 590 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
591 591 5:cda648ca50f5 (draft orphan) [tip ] add original_e
592 592 $ hg push ../tmpf -f # -f because be push unstable too
593 593 pushing to ../tmpf
594 594 searching for changes
595 595 adding changesets
596 596 adding manifests
597 597 adding file changes
598 598 added 6 changesets with 6 changes to 6 files (+1 heads)
599 599 7 new obsolescence markers
600 600 1 new orphan changesets
601 601
602 602 no warning displayed
603 603
604 604 $ hg push ../tmpf
605 605 pushing to ../tmpf
606 606 searching for changes
607 607 no changes found
608 608 [1]
609 609
610 610 Do not warn about new head when the new head is a successors of a remote one
611 611
612 612 $ hg log -G
613 613 @ 5:cda648ca50f5 (draft orphan) [tip ] add original_e
614 614 |
615 615 x 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
616 616 |
617 617 o 3:6f9641995072 (draft) [ ] add n3w_3_c
618 618 |
619 619 | o 2:245bde4270cd (public) [ ] add original_c
620 620 |/
621 621 o 1:7c3bad9141dc (public) [ ] add b
622 622 |
623 623 o 0:1f0dee641bb7 (public) [ ] add a
624 624
625 625 $ hg up -q 'desc(n3w_3_c)'
626 626 $ mkcommit obsolete_e
627 627 created new head
628 628 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` \
629 629 > -u 'test <test@example.net>'
630 630 obsoleted 1 changesets
631 631 $ hg outgoing ../tmpf # parasite hg outgoing testin
632 632 comparing with ../tmpf
633 633 searching for changes
634 634 6:3de5eca88c00 (draft) [tip ] add obsolete_e
635 635 $ hg push ../tmpf
636 636 pushing to ../tmpf
637 637 searching for changes
638 638 adding changesets
639 639 adding manifests
640 640 adding file changes
641 641 added 1 changesets with 1 changes to 1 files (+1 heads)
642 642 1 new obsolescence markers
643 643 obsoleted 1 changesets
644 644
645 645 test relevance computation
646 646 ---------------------------------------
647 647
648 648 Checking simple case of "marker relevance".
649 649
650 650
651 651 Reminder of the repo situation
652 652
653 653 $ hg log --hidden --graph
654 654 @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e
655 655 |
656 656 | x 5:cda648ca50f5 (draft *obsolete*) [ ] add original_e [rewritten as 6:3de5eca88c00 by test <test@example.net>]
657 657 | |
658 658 | x 4:94b33453f93b (draft *obsolete*) [ ] add original_d [pruned]
659 659 |/
660 660 o 3:6f9641995072 (draft) [ ] add n3w_3_c
661 661 |
662 662 | o 2:245bde4270cd (public) [ ] add original_c
663 663 |/
664 664 o 1:7c3bad9141dc (public) [ ] add b
665 665 |
666 666 o 0:1f0dee641bb7 (public) [ ] add a
667 667
668 668
669 669 List of all markers
670 670
671 671 $ hg debugobsolete
672 672 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
673 673 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
674 674 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
675 675 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
676 676 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
677 677 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
678 678 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
679 679 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob)
680 680
681 681 List of changesets with no chain
682 682
683 683 $ hg debugobsolete --hidden --rev ::2
684 684
685 685 List of changesets that are included on marker chain
686 686
687 687 $ hg debugobsolete --hidden --rev 6
688 688 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob)
689 689
690 690 List of changesets with a longer chain, (including a pruned children)
691 691
692 692 $ hg debugobsolete --hidden --rev 3
693 693 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
694 694 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
695 695 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
696 696 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
697 697 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
698 698 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
699 699 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
700 700
701 701 List of both
702 702
703 703 $ hg debugobsolete --hidden --rev 3::6
704 704 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
705 705 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
706 706 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
707 707 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
708 708 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
709 709 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
710 710 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob)
711 711 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
712 712
713 713 List of all markers in JSON
714 714
715 715 $ hg debugobsolete -Tjson
716 716 [
717 717 {
718 718 "date": [1339, 0],
719 719 "flag": 0,
720 720 "metadata": {"user": "test"},
721 721 "prednode": "1339133913391339133913391339133913391339",
722 722 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
723 723 },
724 724 {
725 725 "date": [1339, 0],
726 726 "flag": 0,
727 727 "metadata": {"user": "test"},
728 728 "prednode": "1337133713371337133713371337133713371337",
729 729 "succnodes": ["5601fb93a350734d935195fee37f4054c529ff39"]
730 730 },
731 731 {
732 732 "date": [121, 120],
733 733 "flag": 12,
734 734 "metadata": {"user": "test"},
735 735 "prednode": "245bde4270cd1072a27757984f9cda8ba26f08ca",
736 736 "succnodes": ["cdbce2fbb16313928851e97e0d85413f3f7eb77f"]
737 737 },
738 738 {
739 739 "date": [1338, 0],
740 740 "flag": 1,
741 741 "metadata": {"user": "test"},
742 742 "prednode": "5601fb93a350734d935195fee37f4054c529ff39",
743 743 "succnodes": ["6f96419950729f3671185b847352890f074f7557"]
744 744 },
745 745 {
746 746 "date": [1338, 0],
747 747 "flag": 0,
748 748 "metadata": {"user": "test"},
749 749 "prednode": "ca819180edb99ed25ceafb3e9584ac287e240b00",
750 750 "succnodes": ["1337133713371337133713371337133713371337"]
751 751 },
752 752 {
753 753 "date": [1337, 0],
754 754 "flag": 0,
755 755 "metadata": {"user": "test"},
756 756 "prednode": "cdbce2fbb16313928851e97e0d85413f3f7eb77f",
757 757 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
758 758 },
759 759 {
760 760 "date": [0, 0],
761 761 "flag": 0,
762 762 "metadata": {"user": "test"},
763 763 "parentnodes": ["6f96419950729f3671185b847352890f074f7557"],
764 764 "prednode": "94b33453f93bdb8d457ef9b770851a618bf413e1",
765 765 "succnodes": []
766 766 },
767 767 {
768 768 "date": *, (glob)
769 769 "flag": 0,
770 770 "metadata": {"user": "test <test@example.net>"},
771 771 "prednode": "cda648ca50f50482b7055c0b0c4c117bba6733d9",
772 772 "succnodes": ["3de5eca88c00aa039da7399a220f4a5221faa585"]
773 773 }
774 774 ]
775 775
776 776 Template keywords
777 777
778 778 $ hg debugobsolete -r6 -T '{succnodes % "{node|short}"} {date|shortdate}\n'
779 779 3de5eca88c00 ????-??-?? (glob)
780 780 $ hg debugobsolete -r6 -T '{join(metadata % "{key}={value}", " ")}\n'
781 781 user=test <test@example.net>
782 782 $ hg debugobsolete -r6 -T '{metadata}\n{metadata}\n'
783 783 'user': 'test <test@example.net>'
784 784 'user': 'test <test@example.net>'
785 785 $ hg debugobsolete -r6 -T '{succnodes}\n{succnodes}\n'
786 786 3de5eca88c00aa039da7399a220f4a5221faa585
787 787 3de5eca88c00aa039da7399a220f4a5221faa585
788 788 $ hg debugobsolete -r6 -T '{flag} {get(metadata, "user")}\n'
789 789 0 test <test@example.net>
790 790
791 791 Test the debug output for exchange
792 792 ----------------------------------
793 793
794 794 $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' # bundle2
795 795 pulling from ../tmpb
796 796 searching for changes
797 797 no changes found
798 798 obsmarker-exchange: 346 bytes received
799 799
800 800 check hgweb does not explode
801 801 ====================================
802 802
803 803 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
804 804 adding changesets
805 805 adding manifests
806 806 adding file changes
807 807 added 62 changesets with 63 changes to 9 files (+60 heads)
808 808 new changesets 50c51b361e60:c15e9edfca13 (62 drafts)
809 809 (run 'hg heads .' to see heads, 'hg merge' to merge)
810 810 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
811 811 > do
812 812 > hg debugobsolete $node
813 813 > done
814 814 obsoleted 1 changesets
815 815 obsoleted 1 changesets
816 816 obsoleted 1 changesets
817 817 obsoleted 1 changesets
818 818 obsoleted 1 changesets
819 819 obsoleted 1 changesets
820 820 obsoleted 1 changesets
821 821 obsoleted 1 changesets
822 822 obsoleted 1 changesets
823 823 obsoleted 1 changesets
824 824 obsoleted 1 changesets
825 825 obsoleted 1 changesets
826 826 obsoleted 1 changesets
827 827 obsoleted 1 changesets
828 828 obsoleted 1 changesets
829 829 obsoleted 1 changesets
830 830 obsoleted 1 changesets
831 831 obsoleted 1 changesets
832 832 obsoleted 1 changesets
833 833 obsoleted 1 changesets
834 834 obsoleted 1 changesets
835 835 obsoleted 1 changesets
836 836 obsoleted 1 changesets
837 837 obsoleted 1 changesets
838 838 obsoleted 1 changesets
839 839 obsoleted 1 changesets
840 840 obsoleted 1 changesets
841 841 obsoleted 1 changesets
842 842 obsoleted 1 changesets
843 843 obsoleted 1 changesets
844 844 obsoleted 1 changesets
845 845 obsoleted 1 changesets
846 846 obsoleted 1 changesets
847 847 obsoleted 1 changesets
848 848 obsoleted 1 changesets
849 849 obsoleted 1 changesets
850 850 obsoleted 1 changesets
851 851 obsoleted 1 changesets
852 852 obsoleted 1 changesets
853 853 obsoleted 1 changesets
854 854 obsoleted 1 changesets
855 855 obsoleted 1 changesets
856 856 obsoleted 1 changesets
857 857 obsoleted 1 changesets
858 858 obsoleted 1 changesets
859 859 obsoleted 1 changesets
860 860 obsoleted 1 changesets
861 861 obsoleted 1 changesets
862 862 obsoleted 1 changesets
863 863 obsoleted 1 changesets
864 864 obsoleted 1 changesets
865 865 obsoleted 1 changesets
866 866 obsoleted 1 changesets
867 867 obsoleted 1 changesets
868 868 obsoleted 1 changesets
869 869 obsoleted 1 changesets
870 870 obsoleted 1 changesets
871 871 obsoleted 1 changesets
872 872 obsoleted 1 changesets
873 873 obsoleted 1 changesets
874 874 $ hg up tip
875 875 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
876 876
877 877 #if serve
878 878
879 879 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
880 880 $ cat hg.pid >> $DAEMON_PIDS
881 881
882 882 check changelog view
883 883
884 884 $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/'
885 885 200 Script output follows
886 886
887 887 check graph view
888 888
889 889 $ get-with-headers.py --headeronly localhost:$HGPORT 'graph'
890 890 200 Script output follows
891 891
892 892 check filelog view
893 893
894 894 $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
895 895 200 Script output follows
896 896
897 897 check filelog view for hidden commits (obsolete ones are hidden here)
898 898
899 899 $ get-with-headers.py localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar' | grep obsolete
900 900 [1]
901 901
902 902 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
903 903 200 Script output follows
904 904 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
905 905 404 Not Found
906 906 [1]
907 907
908 908 check that web.view config option:
909 909
910 910 $ killdaemons.py hg.pid
911 911 $ cat >> .hg/hgrc << EOF
912 912 > [web]
913 913 > view=all
914 914 > EOF
915 915 $ wait
916 916 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
917 917 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
918 918 200 Script output follows
919 919 $ killdaemons.py hg.pid
920 920
921 921 Checking _enable=False warning if obsolete marker exists
922 922
923 923 $ echo '[experimental]' >> $HGRCPATH
924 924 $ echo "evolution=" >> $HGRCPATH
925 925 $ hg log -r tip
926 926 68:c15e9edfca13 (draft) [tip ] add celestine
927 927
928 928 reenable for later test
929 929
930 930 $ echo '[experimental]' >> $HGRCPATH
931 931 $ echo "evolution.exchange=True" >> $HGRCPATH
932 932 $ echo "evolution.createmarkers=True" >> $HGRCPATH
933 933
934 934 $ rm access.log errors.log
935 935 #endif
936 936
937 937 Several troubles on the same changeset (create an unstable and bumped changeset)
938 938
939 939 $ hg debugobsolete `getid obsolete_e`
940 940 obsoleted 1 changesets
941 941 2 new orphan changesets
942 942 $ hg debugobsolete `getid original_c` `getid babar`
943 943 1 new phase-divergent changesets
944 944 $ hg log --config ui.logtemplate= -r 'phasedivergent() and orphan()'
945 945 changeset: 7:50c51b361e60
946 946 user: test
947 947 date: Thu Jan 01 00:00:00 1970 +0000
948 948 instability: orphan, phase-divergent
949 949 summary: add babar
950 950
951 951
952 952 test the "obsolete" templatekw
953 953
954 954 $ hg log -r 'obsolete()'
955 955 6:3de5eca88c00 (draft *obsolete*) [ ] add obsolete_e [pruned]
956 956
957 957 test the "troubles" templatekw
958 958
959 959 $ hg log -r 'phasedivergent() and orphan()'
960 960 7:50c51b361e60 (draft orphan phase-divergent) [ ] add babar
961 961
962 962 test the default cmdline template
963 963
964 964 $ hg log -T default -r 'phasedivergent()'
965 965 changeset: 7:50c51b361e60
966 966 user: test
967 967 date: Thu Jan 01 00:00:00 1970 +0000
968 968 instability: orphan, phase-divergent
969 969 summary: add babar
970 970
971 971 $ hg log -T default -r 'obsolete()'
972 972 changeset: 6:3de5eca88c00
973 973 parent: 3:6f9641995072
974 974 user: test
975 975 date: Thu Jan 01 00:00:00 1970 +0000
976 976 obsolete: pruned
977 977 summary: add obsolete_e
978 978
979 979
980 980 test the obsolete labels
981 981
982 982 $ hg log --config ui.logtemplate= --color=debug -r 'phasedivergent()'
983 983 [log.changeset changeset.draft changeset.unstable instability.orphan instability.phase-divergent|changeset: 7:50c51b361e60]
984 984 [log.user|user: test]
985 985 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
986 986 [log.instability|instability: orphan, phase-divergent]
987 987 [log.summary|summary: add babar]
988 988
989 989
990 990 $ hg log -T default -r 'phasedivergent()' --color=debug
991 991 [log.changeset changeset.draft changeset.unstable instability.orphan instability.phase-divergent|changeset: 7:50c51b361e60]
992 992 [log.user|user: test]
993 993 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
994 994 [log.instability|instability: orphan, phase-divergent]
995 995 [log.summary|summary: add babar]
996 996
997 997
998 998 $ hg log --config ui.logtemplate= --color=debug -r "obsolete()"
999 999 [log.changeset changeset.draft changeset.obsolete|changeset: 6:3de5eca88c00]
1000 1000 [log.parent changeset.draft|parent: 3:6f9641995072]
1001 1001 [log.user|user: test]
1002 1002 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1003 1003 [log.obsfate|obsolete: pruned]
1004 1004 [log.summary|summary: add obsolete_e]
1005 1005
1006 1006
1007 1007 $ hg log -T default -r 'obsolete()' --color=debug
1008 1008 [log.changeset changeset.draft changeset.obsolete|changeset: 6:3de5eca88c00]
1009 1009 [log.parent changeset.draft|parent: 3:6f9641995072]
1010 1010 [log.user|user: test]
1011 1011 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
1012 1012 [log.obsfate|obsolete: pruned]
1013 1013 [log.summary|summary: add obsolete_e]
1014 1014
1015 1015
1016 1016 test summary output
1017 1017
1018 1018 $ hg up -r 'phasedivergent() and orphan()'
1019 1019 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1020 1020 $ hg summary
1021 1021 parent: 7:50c51b361e60 (orphan, phase-divergent)
1022 1022 add babar
1023 1023 branch: default
1024 1024 commit: (clean)
1025 1025 update: 2 new changesets (update)
1026 1026 phases: 4 draft
1027 1027 orphan: 2 changesets
1028 1028 phase-divergent: 1 changesets
1029 1029 $ hg up -r 'obsolete()'
1030 1030 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1031 1031 $ hg summary
1032 1032 parent: 6:3de5eca88c00 (obsolete)
1033 1033 add obsolete_e
1034 1034 branch: default
1035 1035 commit: (clean)
1036 1036 update: 3 new changesets (update)
1037 1037 phases: 4 draft
1038 1038 orphan: 2 changesets
1039 1039 phase-divergent: 1 changesets
1040 1040
1041 1041 test debugwhyunstable output
1042 1042
1043 1043 $ hg debugwhyunstable 50c51b361e60
1044 1044 orphan: obsolete parent 3de5eca88c00aa039da7399a220f4a5221faa585
1045 1045 phase-divergent: immutable predecessor 245bde4270cd1072a27757984f9cda8ba26f08ca
1046 1046
1047 1047 test whyunstable template keyword
1048 1048
1049 1049 $ hg log -r 50c51b361e60 -T '{whyunstable}\n'
1050 1050 orphan: obsolete parent 3de5eca88c00
1051 1051 phase-divergent: immutable predecessor 245bde4270cd
1052 1052 $ hg log -r 50c51b361e60 -T '{whyunstable % "{instability}: {reason} {node|shortest}\n"}'
1053 1053 orphan: obsolete parent 3de5
1054 1054 phase-divergent: immutable predecessor 245b
1055 1055
1056 1056 #if serve
1057 1057
1058 1058 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1059 1059 $ cat hg.pid >> $DAEMON_PIDS
1060 1060
1061 1061 check obsolete changeset
1062 1062
1063 1063 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=paper' | grep '<span class="obsolete">'
1064 1064 <span class="phase">draft</span> <span class="obsolete">obsolete</span>
1065 1065 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=coal' | grep '<span class="obsolete">'
1066 1066 <span class="phase">draft</span> <span class="obsolete">obsolete</span>
1067 1067 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=gitweb' | grep '<span class="logtags">'
1068 1068 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="obsoletetag" title="obsolete">obsolete</span> </span>
1069 1069 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=monoblue' | grep '<span class="logtags">'
1070 1070 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="obsoletetag" title="obsolete">obsolete</span> </span>
1071 1071 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(obsolete())&style=spartan' | grep 'class="obsolete"'
1072 1072 <th class="obsolete">obsolete:</th>
1073 1073 <td class="obsolete">pruned by &#116;&#101;&#115;&#116; <span class="age">Thu, 01 Jan 1970 00:00:00 +0000</span></td>
1074 1074
1075 1075 check changeset with instabilities
1076 1076
1077 1077 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=paper' | grep '<span class="instability">'
1078 1078 <span class="phase">draft</span> <span class="instability">orphan</span> <span class="instability">phase-divergent</span>
1079 1079 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=coal' | grep '<span class="instability">'
1080 1080 <span class="phase">draft</span> <span class="instability">orphan</span> <span class="instability">phase-divergent</span>
1081 1081 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=gitweb' | grep '<span class="logtags">'
1082 1082 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="instabilitytag" title="orphan">orphan</span> <span class="instabilitytag" title="phase-divergent">phase-divergent</span> </span>
1083 1083 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=monoblue' | grep '<span class="logtags">'
1084 1084 <span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="instabilitytag" title="orphan">orphan</span> <span class="instabilitytag" title="phase-divergent">phase-divergent</span> </span>
1085 1085 $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())&style=spartan' | grep 'class="unstable"'
1086 1086 <th class="unstable">unstable:</th>
1087 1087 <td class="unstable">orphan: obsolete parent <a href="/rev/3de5eca88c00?style=spartan">3de5eca88c00</a></td>
1088 1088 <th class="unstable">unstable:</th>
1089 1089 <td class="unstable">phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=spartan">245bde4270cd</a></td>
1090 1090
1091 1091 check explanation for an orphan and phase-divergent changeset
1092 1092
1093 1093 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=paper' | egrep '(orphan|phase-divergent):'
1094 1094 <td>orphan: obsolete parent <a href="/rev/3de5eca88c00?style=paper">3de5eca88c00</a><br>
1095 1095 phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=paper">245bde4270cd</a></td>
1096 1096 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=coal' | egrep '(orphan|phase-divergent):'
1097 1097 <td>orphan: obsolete parent <a href="/rev/3de5eca88c00?style=coal">3de5eca88c00</a><br>
1098 1098 phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=coal">245bde4270cd</a></td>
1099 1099 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=gitweb' | egrep '(orphan|phase-divergent):'
1100 1100 <td>orphan: obsolete parent <a class="list" href="/rev/3de5eca88c00?style=gitweb">3de5eca88c00</a></td>
1101 1101 <td>phase-divergent: immutable predecessor <a class="list" href="/rev/245bde4270cd?style=gitweb">245bde4270cd</a></td>
1102 1102 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=monoblue' | egrep '(orphan|phase-divergent):'
1103 1103 <dd>orphan: obsolete parent <a href="/rev/3de5eca88c00?style=monoblue">3de5eca88c00</a></dd>
1104 1104 <dd>phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=monoblue">245bde4270cd</a></dd>
1105 1105 $ get-with-headers.py localhost:$HGPORT 'rev/50c51b361e60?style=spartan' | egrep '(orphan|phase-divergent):'
1106 1106 <td class="unstable">orphan: obsolete parent <a href="/rev/3de5eca88c00?style=spartan">3de5eca88c00</a></td>
1107 1107 <td class="unstable">phase-divergent: immutable predecessor <a href="/rev/245bde4270cd?style=spartan">245bde4270cd</a></td>
1108 1108
1109 1109 $ killdaemons.py
1110 1110
1111 1111 $ rm hg.pid access.log errors.log
1112 1112
1113 1113 #endif
1114 1114
1115 1115 Test incoming/outcoming with changesets obsoleted remotely, known locally
1116 1116 ===============================================================================
1117 1117
1118 1118 This test issue 3805
1119 1119
1120 1120 $ hg init repo-issue3805
1121 1121 $ cd repo-issue3805
1122 1122 $ echo "base" > base
1123 1123 $ hg ci -Am "base"
1124 1124 adding base
1125 1125 $ echo "foo" > foo
1126 1126 $ hg ci -Am "A"
1127 1127 adding foo
1128 1128 $ hg clone . ../other-issue3805
1129 1129 updating to branch default
1130 1130 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1131 1131 $ echo "bar" >> foo
1132 1132 $ hg ci --amend
1133 1133 $ cd ../other-issue3805
1134 1134 $ hg log -G
1135 1135 @ 1:29f0c6921ddd (draft) [tip ] A
1136 1136 |
1137 1137 o 0:d20a80d4def3 (draft) [ ] base
1138 1138
1139 1139 $ hg log -G -R ../repo-issue3805
1140 1140 @ 2:323a9c3ddd91 (draft) [tip ] A
1141 1141 |
1142 1142 o 0:d20a80d4def3 (draft) [ ] base
1143 1143
1144 1144 $ hg incoming
1145 1145 comparing with $TESTTMP/tmpe/repo-issue3805
1146 1146 searching for changes
1147 1147 2:323a9c3ddd91 (draft) [tip ] A
1148 1148 $ hg incoming --bundle ../issue3805.hg
1149 1149 comparing with $TESTTMP/tmpe/repo-issue3805
1150 1150 searching for changes
1151 1151 2:323a9c3ddd91 (draft) [tip ] A
1152 1152 $ hg outgoing
1153 1153 comparing with $TESTTMP/tmpe/repo-issue3805
1154 1154 searching for changes
1155 1155 1:29f0c6921ddd (draft) [tip ] A
1156 1156
1157 1157 #if serve
1158 1158
1159 1159 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1160 1160 $ cat hg.pid >> $DAEMON_PIDS
1161 1161
1162 1162 $ hg incoming http://localhost:$HGPORT
1163 1163 comparing with http://localhost:$HGPORT/
1164 1164 searching for changes
1165 1165 2:323a9c3ddd91 (draft) [tip ] A
1166 1166 $ hg outgoing http://localhost:$HGPORT
1167 1167 comparing with http://localhost:$HGPORT/
1168 1168 searching for changes
1169 1169 1:29f0c6921ddd (draft) [tip ] A
1170 1170
1171 1171 $ killdaemons.py
1172 1172
1173 1173 #endif
1174 1174
1175 1175 This test issue 3814
1176 1176
1177 1177 (nothing to push but locally hidden changeset)
1178 1178
1179 1179 $ cd ..
1180 1180 $ hg init repo-issue3814
1181 1181 $ cd repo-issue3805
1182 1182 $ hg push -r 323a9c3ddd91 ../repo-issue3814
1183 1183 pushing to ../repo-issue3814
1184 1184 searching for changes
1185 1185 adding changesets
1186 1186 adding manifests
1187 1187 adding file changes
1188 1188 added 2 changesets with 2 changes to 2 files
1189 1189 1 new obsolescence markers
1190 1190 $ hg out ../repo-issue3814
1191 1191 comparing with ../repo-issue3814
1192 1192 searching for changes
1193 1193 no changes found
1194 1194 [1]
1195 1195
1196 1196 Test that a local tag blocks a changeset from being hidden
1197 1197
1198 1198 $ hg tag -l visible -r 1 --hidden
1199 1199 $ hg log -G
1200 1200 @ 2:323a9c3ddd91 (draft) [tip ] A
1201 1201 |
1202 1202 | x 1:29f0c6921ddd (draft *obsolete*) [visible ] A [rewritten using amend as 2:323a9c3ddd91]
1203 1203 |/
1204 1204 o 0:d20a80d4def3 (draft) [ ] base
1205 1205
1206 1206 Test that removing a local tag does not cause some commands to fail
1207 1207
1208 1208 $ hg tag -l -r tip tiptag
1209 1209 $ hg tags
1210 1210 tiptag 2:323a9c3ddd91
1211 1211 tip 2:323a9c3ddd91
1212 1212 visible 1:29f0c6921ddd
1213 1213 $ hg --config extensions.strip= strip -r tip --no-backup
1214 1214 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1215 1215 $ hg tags
1216 1216 visible 1:29f0c6921ddd
1217 1217 tip 1:29f0c6921ddd
1218 1218
1219 1219 Test bundle overlay onto hidden revision
1220 1220
1221 1221 $ cd ..
1222 1222 $ hg init repo-bundleoverlay
1223 1223 $ cd repo-bundleoverlay
1224 1224 $ echo "A" > foo
1225 1225 $ hg ci -Am "A"
1226 1226 adding foo
1227 1227 $ echo "B" >> foo
1228 1228 $ hg ci -m "B"
1229 1229 $ hg up 0
1230 1230 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1231 1231 $ echo "C" >> foo
1232 1232 $ hg ci -m "C"
1233 1233 created new head
1234 1234 $ hg log -G
1235 1235 @ 2:c186d7714947 (draft) [tip ] C
1236 1236 |
1237 1237 | o 1:44526ebb0f98 (draft) [ ] B
1238 1238 |/
1239 1239 o 0:4b34ecfb0d56 (draft) [ ] A
1240 1240
1241 1241
1242 1242 $ hg clone -r1 . ../other-bundleoverlay
1243 1243 adding changesets
1244 1244 adding manifests
1245 1245 adding file changes
1246 1246 added 2 changesets with 2 changes to 1 files
1247 1247 new changesets 4b34ecfb0d56:44526ebb0f98 (2 drafts)
1248 1248 updating to branch default
1249 1249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1250 1250 $ cd ../other-bundleoverlay
1251 1251 $ echo "B+" >> foo
1252 1252 $ hg ci --amend -m "B+"
1253 1253 $ hg log -G --hidden
1254 1254 @ 2:b7d587542d40 (draft) [tip ] B+
1255 1255 |
1256 1256 | x 1:44526ebb0f98 (draft *obsolete*) [ ] B [rewritten using amend as 2:b7d587542d40]
1257 1257 |/
1258 1258 o 0:4b34ecfb0d56 (draft) [ ] A
1259 1259
1260 1260
1261 1261 #if repobundlerepo
1262 1262 $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
1263 1263 comparing with ../repo-bundleoverlay
1264 1264 searching for changes
1265 1265 1:44526ebb0f98 (draft) [ ] B
1266 1266 2:c186d7714947 (draft) [tip ] C
1267 1267 $ hg log -G -R ../bundleoverlay.hg
1268 1268 o 3:c186d7714947 (draft) [tip ] C
1269 1269 |
1270 1270 | @ 2:b7d587542d40 (draft) [ ] B+
1271 1271 |/
1272 1272 o 0:4b34ecfb0d56 (draft) [ ] A
1273 1273
1274 1274 #endif
1275 1275
1276 1276 #if serve
1277 1277
1278 1278 Test issue 4506
1279 1279
1280 1280 $ cd ..
1281 1281 $ hg init repo-issue4506
1282 1282 $ cd repo-issue4506
1283 1283 $ echo "0" > foo
1284 1284 $ hg add foo
1285 1285 $ hg ci -m "content-0"
1286 1286
1287 1287 $ hg up null
1288 1288 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1289 1289 $ echo "1" > bar
1290 1290 $ hg add bar
1291 1291 $ hg ci -m "content-1"
1292 1292 created new head
1293 1293 $ hg up 0
1294 1294 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1295 1295 $ hg graft 1
1296 1296 grafting 1:1c9eddb02162 "content-1" (tip)
1297 1297
1298 1298 $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
1299 1299 obsoleted 1 changesets
1300 1300
1301 1301 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1302 1302 $ cat hg.pid >> $DAEMON_PIDS
1303 1303
1304 1304 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1'
1305 1305 404 Not Found
1306 1306 [1]
1307 1307 $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar'
1308 1308 200 Script output follows
1309 1309 $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar'
1310 1310 200 Script output follows
1311 1311
1312 1312 $ killdaemons.py
1313 1313
1314 1314 #endif
1315 1315
1316 1316 Test heads computation on pending index changes with obsolescence markers
1317 1317 $ cd ..
1318 1318 $ cat >$TESTTMP/test_extension.py << EOF
1319 1319 > from __future__ import absolute_import
1320 1320 > from mercurial.i18n import _
1321 1321 > from mercurial import cmdutil, pycompat, registrar
1322 1322 > from mercurial.utils import stringutil
1323 1323 >
1324 1324 > cmdtable = {}
1325 1325 > command = registrar.command(cmdtable)
1326 1326 > @command(b"amendtransient",[], _(b'hg amendtransient [rev]'))
1327 1327 > def amend(ui, repo, *pats, **opts):
1328 1328 > opts = pycompat.byteskwargs(opts)
1329 1329 > opts[b'message'] = b'Test'
1330 1330 > opts[b'logfile'] = None
1331 1331 > cmdutil.amend(ui, repo, repo[b'.'], {}, pats, opts)
1332 1332 > ui.write(b'%s\n' % stringutil.pprint(repo.changelog.headrevs()))
1333 1333 > EOF
1334 1334 $ cat >> $HGRCPATH << EOF
1335 1335 > [extensions]
1336 1336 > testextension=$TESTTMP/test_extension.py
1337 1337 > EOF
1338 1338 $ hg init repo-issue-nativerevs-pending-changes
1339 1339 $ cd repo-issue-nativerevs-pending-changes
1340 1340 $ mkcommit a
1341 1341 $ mkcommit b
1342 1342 $ hg up ".^"
1343 1343 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1344 1344 $ echo aa > a
1345 1345 $ hg amendtransient
1346 1346 1 new orphan changesets
1347 1347 [1, 2]
1348 1348
1349 1349 Test cache consistency for the visible filter
1350 1350 1) We want to make sure that the cached filtered revs are invalidated when
1351 1351 bookmarks change
1352 1352 $ cd ..
1353 1353 $ cat >$TESTTMP/test_extension.py << EOF
1354 1354 > from __future__ import absolute_import, print_function
1355 1355 > import weakref
1356 1356 > from mercurial import (
1357 1357 > bookmarks,
1358 1358 > cmdutil,
1359 1359 > extensions,
1360 1360 > repoview,
1361 1361 > )
1362 1362 > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs):
1363 1363 > reporef = weakref.ref(bkmstoreinst._repo)
1364 1364 > def trhook(tr):
1365 1365 > repo = reporef()
1366 1366 > hidden1 = repoview.computehidden(repo)
1367 1367 > hidden = repoview.filterrevs(repo, b'visible')
1368 1368 > if sorted(hidden1) != sorted(hidden):
1369 1369 > print("cache inconsistency")
1370 1370 > bkmstoreinst._repo.currenttransaction().addpostclose(b'test_extension', trhook)
1371 1371 > orig(bkmstoreinst, *args, **kwargs)
1372 1372 > def extsetup(ui):
1373 1373 > extensions.wrapfunction(bookmarks.bmstore, '_recordchange',
1374 1374 > _bookmarkchanged)
1375 1375 > EOF
1376 1376
1377 1377 $ hg init repo-cache-inconsistency
1378 1378 $ cd repo-issue-nativerevs-pending-changes
1379 1379 $ mkcommit a
1380 1380 a already tracked!
1381 1381 $ mkcommit b
1382 1382 $ hg id
1383 1383 13bedc178fce tip
1384 1384 $ echo "hello" > b
1385 1385 $ hg commit --amend -m "message"
1386 1386 $ hg book bookb -r 13bedc178fce --hidden
1387 1387 bookmarking hidden changeset 13bedc178fce
1388 1388 (hidden revision '13bedc178fce' was rewritten as: a9b1f8652753)
1389 1389 $ hg log -r 13bedc178fce
1390 1390 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753]
1391 1391 $ hg book -d bookb
1392 1392 $ hg log -r 13bedc178fce
1393 1393 abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753!
1394 1394 (use --hidden to access hidden revisions)
1395 1395 [255]
1396 1396
1397 1397 Empty out the test extension, as it isn't compatible with later parts
1398 1398 of the test.
1399 1399 $ echo > $TESTTMP/test_extension.py
1400 1400
1401 1401 Test ability to pull changeset with locally applying obsolescence markers
1402 1402 (issue4945)
1403 1403
1404 1404 $ cd ..
1405 1405 $ hg init issue4845
1406 1406 $ cd issue4845
1407 1407
1408 1408 $ echo foo > f0
1409 1409 $ hg add f0
1410 1410 $ hg ci -m '0'
1411 1411 $ echo foo > f1
1412 1412 $ hg add f1
1413 1413 $ hg ci -m '1'
1414 1414 $ echo foo > f2
1415 1415 $ hg add f2
1416 1416 $ hg ci -m '2'
1417 1417
1418 1418 $ echo bar > f2
1419 1419 $ hg commit --amend --config experimental.evolution.createmarkers=True
1420 1420 $ hg log -G
1421 1421 @ 3:b0551702f918 (draft) [tip ] 2
1422 1422 |
1423 1423 o 1:e016b03fd86f (draft) [ ] 1
1424 1424 |
1425 1425 o 0:a78f55e5508c (draft) [ ] 0
1426 1426
1427 1427 $ hg log -G --hidden
1428 1428 @ 3:b0551702f918 (draft) [tip ] 2
1429 1429 |
1430 1430 | x 2:e008cf283490 (draft *obsolete*) [ ] 2 [rewritten using amend as 3:b0551702f918]
1431 1431 |/
1432 1432 o 1:e016b03fd86f (draft) [ ] 1
1433 1433 |
1434 1434 o 0:a78f55e5508c (draft) [ ] 0
1435 1435
1436 1436
1437 1437 $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no
1438 1438 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-ede36964-backup.hg
1439 1439 $ hg debugobsolete
1440 1440 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1441 1441 $ hg log -G
1442 1442 @ 2:b0551702f918 (draft) [tip ] 2
1443 1443 |
1444 1444 o 1:e016b03fd86f (draft) [ ] 1
1445 1445 |
1446 1446 o 0:a78f55e5508c (draft) [ ] 0
1447 1447
1448 1448 $ hg log -G --hidden
1449 1449 @ 2:b0551702f918 (draft) [tip ] 2
1450 1450 |
1451 1451 o 1:e016b03fd86f (draft) [ ] 1
1452 1452 |
1453 1453 o 0:a78f55e5508c (draft) [ ] 0
1454 1454
1455 1455 $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg
1456 1456 Stream params: {Compression: BZ}
1457 1457 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
1458 1458 e008cf2834908e5d6b0f792a9d4b0e2272260fb8
1459 1459 cache:rev-branch-cache -- {} (mandatory: False)
1460 1460 phase-heads -- {} (mandatory: True)
1461 1461 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 draft
1462 1462
1463 1463 #if repobundlerepo
1464 1464 $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg
1465 1465 pulling from .hg/strip-backup/e008cf283490-ede36964-backup.hg
1466 1466 searching for changes
1467 1467 no changes found
1468 1468 #endif
1469 1469 $ hg debugobsolete
1470 1470 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1471 1471 $ hg log -G
1472 1472 @ 2:b0551702f918 (draft) [tip ] 2
1473 1473 |
1474 1474 o 1:e016b03fd86f (draft) [ ] 1
1475 1475 |
1476 1476 o 0:a78f55e5508c (draft) [ ] 0
1477 1477
1478 1478 $ hg log -G --hidden
1479 1479 @ 2:b0551702f918 (draft) [tip ] 2
1480 1480 |
1481 1481 o 1:e016b03fd86f (draft) [ ] 1
1482 1482 |
1483 1483 o 0:a78f55e5508c (draft) [ ] 0
1484 1484
1485 1485
1486 1486 Testing that strip remove markers:
1487 1487
1488 1488 $ hg strip -r 1 --config extensions.strip=
1489 1489 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1490 1490 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg
1491 1491 $ hg debugobsolete
1492 1492 $ hg log -G
1493 1493 @ 0:a78f55e5508c (draft) [tip ] 0
1494 1494
1495 1495 $ hg log -G --hidden
1496 1496 @ 0:a78f55e5508c (draft) [tip ] 0
1497 1497
1498 1498 $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
1499 1499 Stream params: {Compression: BZ}
1500 1500 changegroup -- {nbchanges: 2, version: 02} (mandatory: True)
1501 1501 e016b03fd86fcccc54817d120b90b751aaf367d6
1502 1502 b0551702f918510f01ae838ab03a463054c67b46
1503 1503 cache:rev-branch-cache -- {} (mandatory: False)
1504 1504 obsmarkers -- {} (mandatory: True)
1505 1505 version: 1 (92 bytes)
1506 1506 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1507 1507 phase-heads -- {} (mandatory: True)
1508 1508 b0551702f918510f01ae838ab03a463054c67b46 draft
1509 1509
1510 1510 $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
1511 1511 adding changesets
1512 1512 adding manifests
1513 1513 adding file changes
1514 1514 added 2 changesets with 2 changes to 2 files
1515 1515 1 new obsolescence markers
1516 1516 new changesets e016b03fd86f:b0551702f918 (2 drafts)
1517 1517 (run 'hg update' to get a working copy)
1518 1518 $ hg debugobsolete | sort
1519 1519 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
1520 1520 $ hg log -G
1521 1521 o 2:b0551702f918 (draft) [tip ] 2
1522 1522 |
1523 1523 o 1:e016b03fd86f (draft) [ ] 1
1524 1524 |
1525 1525 @ 0:a78f55e5508c (draft) [ ] 0
1526 1526
1527 1527 $ hg log -G --hidden
1528 1528 o 2:b0551702f918 (draft) [tip ] 2
1529 1529 |
1530 1530 o 1:e016b03fd86f (draft) [ ] 1
1531 1531 |
1532 1532 @ 0:a78f55e5508c (draft) [ ] 0
1533 1533
1534 1534 Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when
1535 1535 only a subset of those are displayed (because of --rev option)
1536 1536 $ hg init doindexrev
1537 1537 $ cd doindexrev
1538 1538 $ echo a > a
1539 1539 $ hg ci -Am a
1540 1540 adding a
1541 1541 $ hg ci --amend -m aa
1542 1542 $ echo b > b
1543 1543 $ hg ci -Am b
1544 1544 adding b
1545 1545 $ hg ci --amend -m bb
1546 1546 $ echo c > c
1547 1547 $ hg ci -Am c
1548 1548 adding c
1549 1549 $ hg ci --amend -m cc
1550 1550 $ echo d > d
1551 1551 $ hg ci -Am d
1552 1552 adding d
1553 1553 $ hg ci --amend -m dd --config experimental.evolution.track-operation=1
1554 1554 $ hg debugobsolete --index --rev "3+7"
1555 1555 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1556 1556 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1557 1557 $ hg debugobsolete --index --rev "3+7" -Tjson
1558 1558 [
1559 1559 {
1560 1560 "date": [0, 0],
1561 1561 "flag": 0,
1562 1562 "index": 1,
1563 1563 "metadata": {"ef1": "1", "operation": "amend", "user": "test"},
1564 1564 "prednode": "6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1",
1565 1565 "succnodes": ["d27fb9b066076fd921277a4b9e8b9cb48c95bc6a"]
1566 1566 },
1567 1567 {
1568 1568 "date": [0, 0],
1569 1569 "flag": 0,
1570 1570 "index": 3,
1571 1571 "metadata": {"ef1": "1", "operation": "amend", "user": "test"},
1572 1572 "prednode": "4715cf767440ed891755448016c2b8cf70760c30",
1573 1573 "succnodes": ["7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d"]
1574 1574 }
1575 1575 ]
1576 1576
1577 1577 Test the --delete option of debugobsolete command
1578 1578 $ hg debugobsolete --index
1579 1579 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1580 1580 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1581 1581 2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1582 1582 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1583 1583 $ hg debugobsolete --delete 1 --delete 3
1584 1584 deleted 2 obsolescence markers
1585 1585 $ hg debugobsolete
1586 1586 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1587 1587 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1588 1588
1589 1589 Test adding changeset after obsmarkers affecting it
1590 1590 (eg: during pull, or unbundle)
1591 1591
1592 1592 $ mkcommit e
1593 1593 $ hg bundle -r . --base .~1 ../bundle-2.hg
1594 1594 1 changesets found
1595 1595 $ getid .
1596 1596 $ hg --config extensions.strip= strip -r .
1597 1597 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1598 1598 saved backup bundle to $TESTTMP/tmpe/issue4845/doindexrev/.hg/strip-backup/9bc153528424-ee80edd4-backup.hg
1599 1599 $ hg debugobsolete 9bc153528424ea266d13e57f9ff0d799dfe61e4b
1600 1600 $ hg unbundle ../bundle-2.hg
1601 1601 adding changesets
1602 1602 adding manifests
1603 1603 adding file changes
1604 1604 added 1 changesets with 1 changes to 1 files
1605 (1 other changesets obsolete on arrival)
1605 1606 (run 'hg update' to get a working copy)
1606 1607 $ hg log -G
1607 1608 @ 7:7ae79c5d60f0 (draft) [tip ] dd
1608 1609 |
1609 1610 | o 6:4715cf767440 (draft) [ ] d
1610 1611 |/
1611 1612 o 5:29346082e4a9 (draft) [ ] cc
1612 1613 |
1613 1614 o 3:d27fb9b06607 (draft) [ ] bb
1614 1615 |
1615 1616 | o 2:6fdef60fcbab (draft) [ ] b
1616 1617 |/
1617 1618 o 1:f9bd49731b0b (draft) [ ] aa
1618 1619
1619 1620
1620 1621 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now