Pierre-Yves David avatar Pierre-Yves David committed 26f76b3

evolve: Rename latecomer into bumped

This is the new name in core

Comments (0)

Files changed (6)

docs/obs-concept.rst

 * Public changesets are excluded from the obsolete set (public
   changesets are never hidden or candidate to garbage collection)
 
-* *newer* version of a public changeset are called **latecomer** and
+* *newer* version of a public changeset are called **bumped** and
   highlighted as an error case.
 
 .. figure:: ./figures/explain-troubles-concurrent-10-sumup.*
 
 Solving such an error is easy. Because we know what changeset a
-*latecomer* tries to rewrite, we can easily compute a smaller
+*bumped* tries to rewrite, we can easily compute a smaller
 changeset containing only the change from the old *public* to the new
-*latecomer*.
+*bumped*.
 
 .. figure:: ./figures/explain-troubles-concurrent-15-solution.*
 

docs/obs-terms.rst

 |                     | (a.k.a. divergent   and  |                             |
 |                     | unstable)                +-----------------------------+
 |                     |                          |                             |
-|                     | (possible alternative    | **latecomer**               |
+|                     | (possible alternative    | **bumped**                  |
 |                     | names: unsettled,        |                             |
-|                     | troublesome              | *latecomer* is a changeset  |
+|                     | troublesome              | *bumped* is a changeset     |
 |                     |                          | that tries to be successor  |
 |                     |                          | of  public changesets.      |
 |                     |                          |                             |
 |                     |                          | Public changeset can't      |
 |                     |                          | be deleted and replace      |
-|                     |                          | *latecomer*                 |
+|                     |                          | *bumped*                    |
 |                     |                          | need to be converted into   |
 |                     |                          | an overlay to this public   |
 |                     |                          | changeset.                  |
 |                                                                              |
 +------------------------------------------------------------------------------+
 
-.. note:: I'm not very happy with the naming of:
-
-          - "ok" changeset
-          - latecomer
-          - divergent
-
-          Any better idea are welcome.
 
 
 Command and operation name
 ```````````````
 
 Automatically resolve *troublesome* changesets
-(*unstable*, *latecomer* and *divergent*)
+(*unstable*, *bumped* and *divergent*)
 
 This is an important name as hg pull/push will suggest it the same way it
 suggest merging when you add heads.
 #####################################################################
 
 # there is two kind of trouble not handled by core right now:
-# - latecomer: (successors for public changeset)
+# - bumped: (successors for public changeset)
 # - divergent: (two changeset try to succeed to the same precursors)
 #
 # This section add support for those two addition trouble
 ### Cache computation
 latediff = 1  # flag to prevent taking late comer fix into account
 
-@cachefor('latecomer')
-def _computelatecomerset(repo):
+@cachefor('bumped')
+def _computebumpedset(repo):
     """the set of rev trying to obsolete public revision"""
     candidates = _allsuccessors(repo, repo.revs('public()'),
                                                 haltonflags=latediff)
 ### changectx method
 
 @eh.addattr(context.changectx, 'latecomer')
-def latecomer(ctx):
-    """is the changeset latecomer (Try to succeed to public change)"""
+@eh.addattr(context.changectx, 'bumped')
+def bumped(ctx):
+    """is the changeset bumped (Try to succeed to public change)"""
     if ctx.node() is None:
         return False
-    return ctx.rev() in getobscache(ctx._repo, 'latecomer')
+    return ctx.rev() in getobscache(ctx._repo, 'bumped')
 
 @eh.addattr(context.changectx, 'conflicting')
 @eh.addattr(context.changectx, 'divergent')
 ### revset symbol
 
 @eh.revset('latecomer')
-def revsetlatecomer(repo, subset, x):
-    """``latecomer()``
+@eh.revset('bumped')
+def revsetbumped(repo, subset, x):
+    """``bumped()``
     Changesets marked as successors of public changesets.
     """
-    args = revset.getargs(x, 0, 0, 'latecomer takes no arguments')
-    lates = getobscache(repo, 'latecomer')
+    args = revset.getargs(x, 0, 0, 'bumped takes no arguments')
+    lates = getobscache(repo, 'bumped')
     return [r for r in subset if r in lates]
 
 @eh.revset('conflicting')
 def wrapcheckheads(orig, repo, remote, outgoing, *args, **kwargs):
     """wrap mercurial.discovery.checkheads
 
-    * prevent latecomer and unstable to be pushed
+    * prevent bumped and unstable to be pushed
     """
     # do not push instability
     for h in outgoing.missingheads:
         # Checking heads is enough, obsolete descendants are either
         # obsolete or unstable.
         ctx = repo[h]
-        if ctx.latecomer():
-            raise util.Abort(_("push includes a latecomer changeset: %s!")
+        if ctx.bumped():
+            raise util.Abort(_("push includes a bumped changeset: %s!")
                              % ctx)
         if ctx.divergent():
             raise util.Abort(_("push includes a divergent changeset: %s!")
 def troubles(ctx):
     """Return a tuple listing all the troubles that affect a changeset
 
-    Troubles may be "unstable", "latecomer" or "divergent".
+    Troubles may be "unstable", "bumped" or "divergent".
     """
     troubles = []
     if ctx.unstable():
         troubles.append('unstable')
-    if ctx.latecomer():
-        troubles.append('latecomer')
+    if ctx.bumped():
+        troubles.append('bumped')
     if ctx.divergent():
         troubles.append('divergent')
     return tuple(troubles)
 ### Troubled revset symbol
 
 @eh.revset('troubled')
-def revsetlatecomer(repo, subset, x):
+def revsetbumped(repo, subset, x):
     """``troubled()``
     Changesets with troubles.
     """
     _ = revset.getargs(x, 0, 0, 'troubled takes no arguments')
-    return repo.revs('%ld and (unstable() + latecomer() + divergent())',
+    return repo.revs('%ld and (unstable() + bumped() + divergent())',
                      subset)
 
 
 def warnobserrors(orig, ui, repo, *args, **kwargs):
     """display warning is the command resulted in more instable changeset"""
     priorunstables = len(repo.revs('unstable()'))
-    priorlatecomers = len(repo.revs('latecomer()'))
+    priorbumpeds = len(repo.revs('bumped()'))
     priordivergents = len(repo.revs('divergent()'))
     ret = orig(ui, repo, *args, **kwargs)
     # workaround phase stupidity
     phases._filterunknown(ui, repo.changelog, repo._phasecache.phaseroots)
     newunstables = len(repo.revs('unstable()')) - priorunstables
-    newlatecomers = len(repo.revs('latecomer()')) - priorlatecomers
+    newbumpeds = len(repo.revs('bumped()')) - priorbumpeds
     newdivergents = len(repo.revs('divergent()')) - priordivergents
     if newunstables > 0:
         ui.warn(_('%i new unstable changesets\n') % newunstables)
-    if newlatecomers > 0:
-        ui.warn(_('%i new latecomer changesets\n') % newlatecomers)
+    if newbumpeds > 0:
+        ui.warn(_('%i new bumped changesets\n') % newbumpeds)
     if newdivergents > 0:
         ui.warn(_('%i new divergent changesets\n') % newdivergents)
     return ret
 
     ret = orig(ui, repo, *args, **kwargs)
     nbunstable = len(getobscache(repo, 'unstable'))
-    nblatecomer = len(getobscache(repo, 'latecomer'))
+    nbbumped = len(getobscache(repo, 'bumped'))
     nbdivergent = len(getobscache(repo, 'unstable'))
     write('unstable: %i changesets\n', nbunstable)
-    write('latecomer: %i changesets\n', nblatecomer)
+    write('bumped: %i changesets\n', nbbumped)
     write('divergent: %i changesets\n', nbdivergent)
     return ret
 
     """Solve trouble in your repository
 
     - rebase unstable changeset to make it stable again,
-    - create proper diff from latecomer changeset,
+    - create proper diff from bumped changeset,
     - merge divergent changeset.
 
     By default, take the first troubles changeset that looks relevant.
     troubles = tr.troubles()
     if 'unstable' in troubles:
         return _solveunstable(ui, repo, tr, opts['dry_run'])
-    elif 'latecomer' in troubles:
-        return _solvelatecomer(ui, repo, tr, opts['dry_run'])
+    elif 'bumped' in troubles:
+        return _solvebumped(ui, repo, tr, opts['dry_run'])
     elif 'divergent' in troubles:
         return _solvedivergent(ui, repo, tr, opts['dry_run'])
     else:
     if tr is None and pickany:
         troubled = list(repo.set('unstable()'))
         if not troubled:
-            troubled = list(repo.set('latecomer()'))
+            troubled = list(repo.set('bumped()'))
         if not troubled:
             troubled = list(repo.set('divergent()'))
         if troubled:
         finally:
             lock.release()
 
-def _solvelatecomer(ui, repo, latecomer, dryrun=False):
-    """Stabilize a latecomer changeset"""
-    # For now we deny latecomer merge
-    if len(latecomer.parents()) > 1:
-        raise util.Abort('late comer stabilization is confused by latecomer'
-                         ' %s being a merge' % latecomer)
-    prec = repo.set('last(allprecursors(%d) and public())', latecomer).next()
+def _solvebumped(ui, repo, bumped, dryrun=False):
+    """Stabilize a bumped changeset"""
+    # For now we deny bumped merge
+    if len(bumped.parents()) > 1:
+        raise util.Abort('late comer stabilization is confused by bumped'
+                         ' %s being a merge' % bumped)
+    prec = repo.set('last(allprecursors(%d) and public())', bumped).next()
     # For now we deny target merge
     if len(prec.parents()) > 1:
         raise util.Abort('late comer evolution is confused by precursors'
     displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
     repo.ui.status(_('recreate:'))
     if not ui.quiet:
-        displayer.show(latecomer)
+        displayer.show(bumped)
     repo.ui.status(_('atop:'))
     if not ui.quiet:
         displayer.show(prec)
     if dryrun:
-        todo = 'hg rebase --rev %s --dest %s;\n' % (latecomer, prec.p1())
+        todo = 'hg rebase --rev %s --dest %s;\n' % (bumped, prec.p1())
         repo.ui.write(todo)
         repo.ui.write('hg update %s;\n' % prec)
-        repo.ui.write('hg revert --all --rev %s;\n' % latecomer)
-        repo.ui.write('hg commit --msg "latecomer update to %s"')
+        repo.ui.write('hg revert --all --rev %s;\n' % bumped)
+        repo.ui.write('hg commit --msg "bumped update to %s"')
         return 0
     wlock = repo.wlock()
     try:
         newid = tmpctx = None
-        tmpctx = latecomer
+        tmpctx = bumped
         lock = repo.lock()
         try:
-            bmupdate = _bookmarksupdater(repo, latecomer.node())
+            bmupdate = _bookmarksupdater(repo, bumped.node())
             # Basic check for common parent. Far too complicated and fragile
-            tr = repo.transaction('latecomer-stabilize')
+            tr = repo.transaction('bumped-stabilize')
             try:
-                if not list(repo.set('parents(%d) and parents(%d)', latecomer, prec)):
+                if not list(repo.set('parents(%d) and parents(%d)', bumped, prec)):
                     # Need to rebase the changeset at the right place
                     repo.ui.status(_('rebasing to destination parent: %s\n') % prec.p1())
                     try:
-                        tmpid = relocate(repo, latecomer, prec.p1())
+                        tmpid = relocate(repo, bumped, prec.p1())
                         if tmpid is not None:
                             tmpctx = repo[tmpid]
-                            createmarkers(repo, [(latecomer, (tmpctx,))])
+                            createmarkers(repo, [(bumped, (tmpctx,))])
                     except MergeFailure:
-                        repo.opener.write('graftstate', latecomer.hex() + '\n')
+                        repo.opener.write('graftstate', bumped.hex() + '\n')
                         repo.ui.write_err(_('evolution failed!\n'))
                         repo.ui.write_err(_('fix conflict and run "hg evolve --continue"\n'))
                         raise
                 # Create the new commit context
                 repo.ui.status(_('computing new diff\n'))
                 files = set()
-                copied = copies.pathcopies(prec, latecomer)
+                copied = copies.pathcopies(prec, bumped)
                 precmanifest = prec.manifest()
-                for key, val in latecomer.manifest().iteritems():
+                for key, val in bumped.manifest().iteritems():
                     if precmanifest.pop(key, None) != val:
                         files.add(key)
                 files.update(precmanifest)  # add missing files
                 # commit it
                 if files: # something to commit!
                     def filectxfn(repo, ctx, path):
-                        if path in latecomer:
-                            fctx = latecomer[path]
+                        if path in bumped:
+                            fctx = bumped[path]
                             flags = fctx.flags()
                             mctx = context.memfilectx(fctx.path(), fctx.data(),
                                                       islink='l' in flags,
                                                       copied=copied.get(path))
                             return mctx
                         raise IOError()
-                    text = 'latecomer update to %s:\n\n' % prec
-                    text += latecomer.description()
+                    text = 'bumped update to %s:\n\n' % prec
+                    text += bumped.description()
 
                     new = context.memctx(repo,
                                          parents=[prec.node(), node.nullid],
                                          text=text,
                                          files=files,
                                          filectxfn=filectxfn,
-                                         user=latecomer.user(),
-                                         date=latecomer.date(),
-                                         extra=latecomer.extra())
+                                         user=bumped.user(),
+                                         date=bumped.date(),
+                                         extra=bumped.extra())
 
                     newid = repo.commitctx(new)
                 if newid is None:
                     createmarkers(repo, [(tmpctx, ())])
                     newid = prec.node()
                 else:
-                    phases.retractboundary(repo, latecomer.phase(), [newid])
+                    phases.retractboundary(repo, bumped.phase(), [newid])
                     createmarkers(repo, [(tmpctx, (repo[newid],))],
                                            flag=latediff)
                 bmupdate(newid)

tests/test-evolve.t

   6	feature-A: a nifty feature - test
   0	: base - test
 
-phase change turning obsolete changeset public issue a latecomer warning
+phase change turning obsolete changeset public issue a bumped warning
 
   $ hg phase --public 7
-  1 new latecomer changesets
+  1 new bumped changesets
 
-all solving latecomer troubled
+all solving bumped troubled
 
   $ hg glog
   @  8	feature-B: another feature that rox - test
   recreate:[8] another feature that rox
   atop:[7] another feature
   computing new diff
-  commited as 8d77fa12ab0c
+  commited as 53ff506edef1
   $ hg glog
-  @  9	feature-B: latecomer update to 5f4744038ed5: - test
+  @  9	feature-B: bumped update to 5f4744038ed5: - test
   |
   o  7	: another feature - test
   |
   @@ -3,1 +3,1 @@
   -Zwei
   +deux
-  $ hg log -r 'latecomer()' # no more latecomer
+  $ hg log -r 'bumped()' # no more bumped
 
   $ cd ..
 

tests/test-obsolete.t

   $ hg debugobsolete `getid 0` `getid 9`
 83b5778897ad try to obsolete immutable changeset 1f0dee641bb7
 # at core level the warning is not issued
-# this is now a big issue now that we have latecomer warning
+# this is now a big issue now that we have bumped warning
   $ qlog -r 'obsolete()'
   3
   - 0d3f46688ccc
   added 1 changesets with 1 changes to 1 files (+1 heads)
   $ cd ..
 
-check latecomer detection
+check bumped detection
 (make an obsolete changeset public)
 
   $ cd local
   $ hg phase --public 11
-  1 new latecomer changesets
+  1 new bumped changesets
   $ hg log -G --template='{rev} - ({phase}) {node|short} {desc}\n'
   @  12 - (draft) 6db5e282cb91 add obsol_d'''
   |
   |
   o  0 - (public) 1f0dee641bb7 add a
   
-  $ hg log -r 'latecomer()'
+  $ hg log -r 'bumped()'
   changeset:   12:6db5e282cb91
   tag:         tip
   parent:      10:2033b4e49474
   $ hg push ../other-new/
   pushing to ../other-new/
   searching for changes
-  abort: push includes a latecomer changeset: 6db5e282cb91!
+  abort: push includes a bumped changeset: 6db5e282cb91!
   (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
 
   branch: default
   commit: (clean)
   update: (9|11) new changesets, (9|10) branch heads \(merge\) (re)
-  latecomer: 1 changesets
+  bumped: 1 changesets
   $ hg debugobsolete `getid a7a6f2b5d8a5` `getid 50f11e5e3a63`
   $ hg log -r 'conflicting()'
   changeset:   12:6db5e282cb91

tests/test-stabilize-result.t

 Make precursors public
 
   $ hg phase --public 8
-  1 new latecomer changesets
+  1 new bumped changesets
   $ glog
   @  12:15c83af6f3a3@default(draft) bk:[] newer a
   |
   hg rebase --rev 15c83af6f3a3 --dest e8cc1b534401;
   hg update e3183e9c0961;
   hg revert --all --rev 15c83af6f3a3;
-  hg commit --msg "latecomer update to %s" (no-eol)
+  hg commit --msg "bumped update to %s" (no-eol)
   $ hg evolve --any
   recreate:[12] newer a
   atop:[8] newer a
   rebasing to destination parent: e8cc1b534401
   computing new diff
-  commited as 1d94fef80e85
+  commited as eeeb8f6e7648
   $ glog
-  @  14:1d94fef80e85@default(draft) bk:[] latecomer update to e3183e9c0961:
+  @  14:eeeb8f6e7648@default(draft) bk:[] bumped update to e3183e9c0961:
   |
   | o  9:355c5cda4de1@default(draft) bk:[] add c
   | |
   $ glog
   @  15:7391601a4bfa@default(draft) bk:[] More addition
   |
-  | o  14:1d94fef80e85@default(draft) bk:[] latecomer update to e3183e9c0961:
+  | o  14:eeeb8f6e7648@default(draft) bk:[] bumped update to e3183e9c0961:
   | |
   o |  9:355c5cda4de1@default(draft) bk:[] add c
   | |
   |
   | o  17:4754d61bc2db@default(draft) bk:[] More addition
   |/
-  | o  14:1d94fef80e85@default(draft) bk:[] latecomer update to e3183e9c0961:
+  | o  14:eeeb8f6e7648@default(draft) bk:[] bumped update to e3183e9c0961:
   | |
   o |  9:355c5cda4de1@default(draft) bk:[] add c
   | |
   $ glog
   @  22:ac6d600735a4@default(draft) bk:[] More addition
   |
-  | o  14:1d94fef80e85@default(draft) bk:[] latecomer update to e3183e9c0961:
+  | o  14:eeeb8f6e7648@default(draft) bk:[] bumped update to e3183e9c0961:
   | |
   o |  9:355c5cda4de1@default(draft) bk:[] add c
   | |
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.