# HG changeset patch # User Pierre-Yves David # Date 1543290395 -3600 # Node ID ff799015d62e0643c22ef220abb9a6547042e2b1 # Parent 48da02d7f8ebd7d274ace7bb6c74a856c4a62882# Parent 70043c934e1c284edfb8570707b6cc86f8541113 packaging: merge with version 8.3.2 diff -r 48da02d7f8eb -r ff799015d62e CHANGELOG --- a/CHANGELOG Tue Nov 27 04:42:45 2018 +0100 +++ b/CHANGELOG Tue Nov 27 04:46:35 2018 +0100 @@ -1,6 +1,15 @@ Changelog ========= +8.4.0 - in progress +------------------- + + * push: have `--publish` overrule the `auto-publish` config + * next: evolve aspiring children by default (use --no-evolve to skip) + * next: pick lower part of a split as destination + * compat: drop compatibility with Mercurial 4.3 + i* topics: improve the message around topic changing + 8.3.2 --2017-11-27 ------------------- diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/__init__.py Tue Nov 27 04:46:35 2018 +0100 @@ -32,7 +32,7 @@ backported to older version of Mercurial by this extension. Some older experimental protocol are also supported for a longer time in the extensions to help people transitioning. (The extensions is currently compatible down to -Mercurial version 4.3). +Mercurial version 4.4). New Config:: @@ -285,7 +285,6 @@ context, dirstate, error, - extensions, help, hg, lock as lockmod, @@ -781,45 +780,6 @@ _warnobsoletewc(ui, repo) return res -# XXX this could wrap transaction code -# XXX (but this is a bit a layer violation) -@eh.wrapcommand("commit") -@eh.wrapcommand("import") -@eh.wrapcommand("push") -@eh.wrapcommand("pull") -@eh.wrapcommand("graft") -@eh.wrapcommand("phase") -@eh.wrapcommand("unbundle") -def warnobserrors(orig, ui, repo, *args, **kwargs): - """display warning is the command resulted in more instable changeset""" - # hg < 4.4 does not have the feature built in. bail out otherwise. - if util.safehasattr(scmutil, '_reportstroubledchangesets'): - return orig(ui, repo, *args, **kwargs) - - # part of the troubled stuff may be filtered (stash ?) - # This needs a better implementation but will probably wait for core. - filtered = repo.changelog.filteredrevs - priorunstables = len(set(getrevs(repo, 'orphan')) - filtered) - priorbumpeds = len(set(getrevs(repo, 'phasedivergent')) - filtered) - priordivergents = len(set(getrevs(repo, 'contentdivergent')) - filtered) - ret = orig(ui, repo, *args, **kwargs) - filtered = repo.changelog.filteredrevs - newunstables = \ - len(set(getrevs(repo, 'orphan')) - filtered) - priorunstables - newbumpeds = \ - len(set(getrevs(repo, 'phasedivergent')) - filtered) - priorbumpeds - newdivergents = \ - len(set(getrevs(repo, 'contentdivergent')) - filtered) - priordivergents - - base_msg = _('%i new %s changesets\n') - if newunstables > 0: - ui.warn(base_msg % (newunstables, compat.TROUBLES['ORPHAN'])) - if newbumpeds > 0: - ui.warn(base_msg % (newbumpeds, compat.TROUBLES['PHASEDIVERGENT'])) - if newdivergents > 0: - ui.warn(base_msg % (newdivergents, compat.TROUBLES['CONTENTDIVERGENT'])) - return ret - @eh.wrapfunction(mercurial.exchange, 'push') def push(orig, repo, *args, **opts): """Add a hint for "hg evolve" when troubles make push fails @@ -845,28 +805,6 @@ def obssummarysetup(ui): cmdutil.summaryhooks.add('evolve', summaryhook) - -##################################################################### -### Core Other extension compat ### -##################################################################### - - -@eh.extsetup -def _rebasewrapping(ui): - # warning about more obsolete - try: - rebase = extensions.find('rebase') - if rebase: - extensions.wrapcommand(rebase.cmdtable, 'rebase', warnobserrors) - except KeyError: - pass # rebase not found - try: - histedit = extensions.find('histedit') - if histedit: - extensions.wrapcommand(histedit.cmdtable, 'histedit', warnobserrors) - except KeyError: - pass # histedit not found - ##################################################################### ### Old Evolve extension content ### ##################################################################### @@ -1071,11 +1009,7 @@ if ui.config('commands', 'update.check') == 'noconflict': pass else: - try: - cmdutil.bailifchanged(repo) - except error.Abort as exc: - exc.hint = _('do you want --merge?') - raise + cmdutil.bailifchanged(repo, hint=_('do you want --merge?')) topic = not opts.get("no_topic", False) hastopic = bool(_getcurrenttopic(repo)) @@ -1109,7 +1043,7 @@ [('B', 'move-bookmark', False, _('move active bookmark after update')), ('m', 'merge', False, _('bring uncommitted change along')), - ('', 'evolve', False, _('evolve the next changeset if necessary')), + ('', 'evolve', True, _('evolve the next changeset if necessary')), ('', 'no-topic', False, _('ignore topic and move topologically')), ('n', 'dry-run', False, _('do not perform actions, just print what would be done'))], @@ -1118,7 +1052,8 @@ def cmdnext(ui, repo, **opts): """update to next child revision - Use the ``--evolve`` flag to evolve unstable children on demand. + If necessary, evolve the next changeset. Use --no-evolve to disable this + behavior. Displays the summary line of the destination for clarity. """ @@ -1132,21 +1067,6 @@ if len(wparents) != 1: raise error.Abort(_('merge in progress')) - # check for dirty wdir if --evolve is passed - if opts['evolve']: - cmdutil.bailifchanged(repo) - - if not opts['merge']: - # we only skip the check if noconflict is set - if ui.config('commands', 'update.check') == 'noconflict': - pass - else: - try: - cmdutil.bailifchanged(repo) - except error.Abort as exc: - exc.hint = _('do you want --merge?') - raise - children = [ctx for ctx in wparents[0].children() if not ctx.obsolete()] topic = _getcurrenttopic(repo) filtered = set() @@ -1156,6 +1076,39 @@ children = [ctx for ctx in children if ctx not in filtered] template = utility.stacktemplate displayer = compat.changesetdisplayer(ui, repo, {'template': template}) + + # check if we need to evolve while updating to the next child revision + needevolve = False + aspchildren = evolvecmd._aspiringchildren(repo, [repo['.'].rev()]) + if topic: + filtered.update(repo[c] for c in aspchildren + if repo[c].topic() != topic) + aspchildren = [ctx for ctx in aspchildren if ctx not in filtered] + + # To catch and prevent the case when `next` would get confused by split, + # lets filter those aspiring children which can be stablized on one of + # the aspiring children itself. + aspirants = set(aspchildren) + for aspchild in aspchildren: + possdests = evolvecmd._possibledestination(repo, aspchild) + if possdests & aspirants: + filtered.add(aspchild) + aspchildren = [ctx for ctx in aspchildren if ctx not in filtered] + if aspchildren: + needevolve = True + + # check if working directory is clean before we evolve the next cset + if needevolve and opts['evolve']: + hint = _('use `hg amend`, `hg revert` or `hg shelve`') + cmdutil.bailifchanged(repo, hint=hint) + + if not (opts['merge'] or (needevolve and opts['evolve'])): + # we only skip the check if noconflict is set + if ui.config('commands', 'update.check') == 'noconflict': + pass + else: + cmdutil.bailifchanged(repo, hint=_('do you want --merge?')) + if len(children) == 1: c = children[0] return _updatetonext(ui, repo, c, displayer, opts) @@ -1172,11 +1125,6 @@ else: return _updatetonext(ui, repo, repo[choosedrev], displayer, opts) else: - aspchildren = evolvecmd._aspiringchildren(repo, [repo['.'].rev()]) - if topic: - filtered.update(repo[c] for c in aspchildren - if repo[c].topic() != topic) - aspchildren = [ctx for ctx in aspchildren if ctx not in filtered] if not opts['evolve'] or not aspchildren: if filtered: ui.warn(_('no children on topic "%s"\n') % topic) @@ -1188,7 +1136,7 @@ 'do you want --evolve?)\n') ui.warn(msg % len(aspchildren)) return 1 - elif 1 < len(aspchildren): + elif len(aspchildren) > 1: cheader = _("ambiguous next (unstable) changeset, choose one to" " evolve and update:") choosedrev = utility.revselectionprompt(ui, repo, @@ -1325,14 +1273,6 @@ @eh.extsetup def oldevolveextsetup(ui): - for cmd in ['prune', 'uncommit', 'touch', 'fold']: - try: - entry = extensions.wrapcommand(cmdtable, cmd, - warnobserrors) - except error.UnknownCommand: - # Commands may be disabled - continue - entry = cmdutil.findcmd('commit', commands.table)[1] entry[1].append(('o', 'obsolete', [], _("make commit obsolete this revision (DEPRECATED)"))) diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/cmdrewrite.py Tue Nov 27 04:46:35 2018 +0100 @@ -105,7 +105,7 @@ ('', 'close-branch', None, _('mark a branch as closed, hiding it from the branch list')), ('s', 'secret', None, _('use the secret phase for committing')), - ('n', 'note', '', _('store a note on amend')), + ('n', 'note', '', _('store a note on amend'), _('TEXT')), ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt, _('[OPTION]... [FILE]...'), helpbasic=True) @@ -462,9 +462,9 @@ 'uncommit', [('a', 'all', None, _('uncommit all changes when no arguments given')), ('i', 'interactive', False, _('interactive mode to uncommit (EXPERIMENTAL)')), - ('r', 'rev', '', _('revert commit content to REV instead')), + ('r', 'rev', '', _('revert commit content to REV instead'), _('REV')), ('', 'revert', False, _('discard working directory changes after uncommit')), - ('n', 'note', '', _('store a note on uncommit')), + ('n', 'note', '', _('store a note on uncommit'), _('TEXT')), ] + commands.walkopts + commitopts + commitopts2 + commitopts3, _('[OPTION]... [NAME]')) def uncommit(ui, repo, *pats, **opts): @@ -662,10 +662,10 @@ @eh.command( 'fold|squash', - [('r', 'rev', [], _("revision to fold")), + [('r', 'rev', [], _("revision to fold"), _('REV')), ('', 'exact', None, _("only fold specified revisions")), ('', 'from', None, _("fold revisions linearly to working copy parent")), - ('n', 'note', '', _('store a note on fold')), + ('n', 'note', '', _('store a note on fold'), _('TEXT')), ] + commitopts + commitopts2 + commitopts3, _('hg fold [OPTION]... [-r] REV'), helpbasic=True) @@ -791,9 +791,9 @@ @eh.command( 'metaedit', - [('r', 'rev', [], _("revision to edit")), + [('r', 'rev', [], _("revision to edit"), _('REV')), ('', 'fold', None, _("also fold specified revisions into one")), - ('n', 'note', '', _('store a note on metaedit')), + ('n', 'note', '', _('store a note on metaedit'), _('TEXT')), ] + commitopts + commitopts2 + commitopts3, _('hg metaedit [OPTION]... [-r] [REV]')) def metaedit(ui, repo, *revs, **opts): @@ -941,10 +941,10 @@ @eh.command( 'prune|obsolete', [('n', 'new', [], _("successor changeset (DEPRECATED)")), - ('s', 'succ', [], _("successor changeset")), - ('r', 'rev', [], _("revisions to prune")), + ('s', 'succ', [], _("successor changeset"), _('REV')), + ('r', 'rev', [], _("revisions to prune"), _('REV')), ('k', 'keep', None, _("does not modify working copy during prune")), - ('n', 'note', '', _('store a note on prune')), + ('n', 'note', '', _('store a note on prune'), _('TEXT')), ('', 'pair', False, _("record a pairing, such as a rebase or divergence resolution " "(pairing multiple precursors to multiple successors)")), ('', 'biject', False, _("alias to --pair (DEPRECATED)")), @@ -953,7 +953,7 @@ ('', 'split', False, _("record a split (on precursor, multiple successors)")), ('B', 'bookmark', [], _("remove revs only reachable from given" - " bookmark"))] + metadataopts, + " bookmark"), _('BOOKMARK'))] + metadataopts, _('[OPTION] [-r] REV...'), helpbasic=True) # XXX -U --noupdate option to prevent wc update and or bookmarks update ? @@ -1132,8 +1132,8 @@ @eh.command( 'split', - [('r', 'rev', [], _("revision to split")), - ('n', 'note', '', _("store a note on split")), + [('r', 'rev', [], _("revision to split"), _('REV')), + ('n', 'note', '', _("store a note on split"), _('TEXT')), ] + commitopts + commitopts2 + commitopts3, _('hg split [OPTION]... [-r] REV'), helpbasic=True) @@ -1229,8 +1229,8 @@ @eh.command( 'touch', - [('r', 'rev', [], 'revision to update'), - ('n', 'note', '', _('store a note on touch')), + [('r', 'rev', [], _('revision to update'), _('REV')), + ('n', 'note', '', _('store a note on touch'), _('TEXT')), ('D', 'duplicate', False, 'do not mark the new revision as successor of the old one'), ('A', 'allowdivergence', False, @@ -1322,7 +1322,7 @@ @eh.command( 'pick|grab', - [('r', 'rev', '', 'revision to pick'), + [('r', 'rev', '', _('revision to pick'), _('REV')), ('c', 'continue', False, 'continue interrupted pick'), ('a', 'abort', False, 'abort interrupted pick'), ], diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/compat.py Tue Nov 27 04:46:35 2018 +0100 @@ -171,7 +171,7 @@ import mercurial.utils.dateutil makedate = mercurial.utils.dateutil.makedate parsedate = mercurial.utils.dateutil.parsedate -except ImportError as e: +except ImportError: import mercurial.util makedate = mercurial.util.makedate parsedate = mercurial.util.parsedate @@ -466,256 +466,8 @@ return copy, movewithdir, diverge, renamedelete, dirmove -# code imported from Mercurial core at 4.3 + patch -def fixoldmergecopies(repo, c1, c2, base): - - from mercurial import pathutil - - # avoid silly behavior for update from empty dir - if not c1 or not c2 or c1 == c2: - return {}, {}, {}, {}, {} - - # avoid silly behavior for parent -> working dir - if c2.node() is None and c1.node() == repo.dirstate.p1(): - return repo.dirstate.copies(), {}, {}, {}, {} - - # Copy trace disabling is explicitly below the node == p1 logic above - # because the logic above is required for a simple copy to be kept across a - # rebase. - if repo.ui.configbool('experimental', 'disablecopytrace'): - return {}, {}, {}, {}, {} - - # In certain scenarios (e.g. graft, update or rebase), base can be - # overridden We still need to know a real common ancestor in this case We - # can't just compute _c1.ancestor(_c2) and compare it to ca, because there - # can be multiple common ancestors, e.g. in case of bidmerge. Because our - # caller may not know if the revision passed in lieu of the CA is a genuine - # common ancestor or not without explicitly checking it, it's better to - # determine that here. - # - # base.descendant(wc) and base.descendant(base) are False, work around that - _c1 = c1.p1() if c1.rev() is None else c1 - _c2 = c2.p1() if c2.rev() is None else c2 - # an endpoint is "dirty" if it isn't a descendant of the merge base - # if we have a dirty endpoint, we need to trigger graft logic, and also - # keep track of which endpoint is dirty - dirtyc1 = not (base == _c1 or base.descendant(_c1)) - dirtyc2 = not (base == _c2 or base.descendant(_c2)) - graft = dirtyc1 or dirtyc2 - tca = base - if graft: - tca = _c1.ancestor(_c2) - - limit = copies._findlimit(repo, c1.rev(), c2.rev()) - if limit is None: - # no common ancestor, no copies - return {}, {}, {}, {}, {} - repo.ui.debug(" searching for copies back to rev %d\n" % limit) - - m1 = c1.manifest() - m2 = c2.manifest() - mb = base.manifest() - - # gather data from _checkcopies: - # - diverge = record all diverges in this dict - # - copy = record all non-divergent copies in this dict - # - fullcopy = record all copies in this dict - # - incomplete = record non-divergent partial copies here - # - incompletediverge = record divergent partial copies here - diverge = {} # divergence data is shared - incompletediverge = {} - data1 = {'copy': {}, - 'fullcopy': {}, - 'incomplete': {}, - 'diverge': diverge, - 'incompletediverge': incompletediverge, - } - data2 = {'copy': {}, - 'fullcopy': {}, - 'incomplete': {}, - 'diverge': diverge, - 'incompletediverge': incompletediverge, - } - - # find interesting file sets from manifests - addedinm1 = m1.filesnotin(mb) - addedinm2 = m2.filesnotin(mb) - bothnew = sorted(addedinm1 & addedinm2) - if tca == base: - # unmatched file from base - u1r, u2r = copies._computenonoverlap(repo, c1, c2, addedinm1, addedinm2) - u1u, u2u = u1r, u2r - else: - # unmatched file from base (DAG rotation in the graft case) - u1r, u2r = copies._computenonoverlap(repo, c1, c2, addedinm1, addedinm2, - baselabel='base') - # unmatched file from topological common ancestors (no DAG rotation) - # need to recompute this for directory move handling when grafting - mta = tca.manifest() - u1u, u2u = copies._computenonoverlap(repo, c1, c2, m1.filesnotin(mta), - m2.filesnotin(mta), - baselabel='topological common ancestor') - - for f in u1u: - copies._checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1) - - for f in u2u: - copies._checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2) - - copy = dict(data1['copy']) - copy.update(data2['copy']) - fullcopy = dict(data1['fullcopy']) - fullcopy.update(data2['fullcopy']) - - if dirtyc1: - copies._combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge, - incompletediverge) - else: - copies._combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge, - incompletediverge) - - renamedelete = {} - renamedeleteset = set() - divergeset = set() - for of, fl in diverge.items(): - if len(fl) == 1 or of in c1 or of in c2: - del diverge[of] # not actually divergent, or not a rename - if of not in c1 and of not in c2: - # renamed on one side, deleted on the other side, but filter - # out files that have been renamed and then deleted - renamedelete[of] = [f for f in fl if f in c1 or f in c2] - renamedeleteset.update(fl) # reverse map for below - else: - divergeset.update(fl) # reverse map for below - - if bothnew: - repo.ui.debug(" unmatched files new in both:\n %s\n" - % "\n ".join(bothnew)) - bothdiverge = {} - bothincompletediverge = {} - remainder = {} - both1 = {'copy': {}, - 'fullcopy': {}, - 'incomplete': {}, - 'diverge': bothdiverge, - 'incompletediverge': bothincompletediverge - } - both2 = {'copy': {}, - 'fullcopy': {}, - 'incomplete': {}, - 'diverge': bothdiverge, - 'incompletediverge': bothincompletediverge - } - for f in bothnew: - copies._checkcopies(c1, c2, f, base, tca, dirtyc1, limit, both1) - copies._checkcopies(c2, c1, f, base, tca, dirtyc2, limit, both2) - if dirtyc1 and dirtyc2: - pass - elif dirtyc1: - # incomplete copies may only be found on the "dirty" side for bothnew - assert not both2['incomplete'] - remainder = copies._combinecopies({}, both1['incomplete'], copy, bothdiverge, - bothincompletediverge) - elif dirtyc2: - assert not both1['incomplete'] - remainder = copies._combinecopies({}, both2['incomplete'], copy, bothdiverge, - bothincompletediverge) - else: - # incomplete copies and divergences can't happen outside grafts - assert not both1['incomplete'] - assert not both2['incomplete'] - assert not bothincompletediverge - for f in remainder: - assert f not in bothdiverge - ic = remainder[f] - if ic[0] in (m1 if dirtyc1 else m2): - # backed-out rename on one side, but watch out for deleted files - bothdiverge[f] = ic - for of, fl in bothdiverge.items(): - if len(fl) == 2 and fl[0] == fl[1]: - copy[fl[0]] = of # not actually divergent, just matching renames - - if fullcopy and repo.ui.debugflag: - repo.ui.debug(" all copies found (* = to merge, ! = divergent, " - "% = renamed and deleted):\n") - for f in sorted(fullcopy): - note = "" - if f in copy: - note += "*" - if f in divergeset: - note += "!" - if f in renamedeleteset: - note += "%" - repo.ui.debug(" src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f, - note)) - del divergeset - - if not fullcopy: - return copy, {}, diverge, renamedelete, {} - - repo.ui.debug(" checking for directory renames\n") - - # generate a directory move map - d1, d2 = c1.dirs(), c2.dirs() - # Hack for adding '', which is not otherwise added, to d1 and d2 - d1.addpath('/') - d2.addpath('/') - invalid = set() - dirmove = {} - - # examine each file copy for a potential directory move, which is - # when all the files in a directory are moved to a new directory - for dst, src in fullcopy.iteritems(): - dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst) - if dsrc in invalid: - # already seen to be uninteresting - continue - elif dsrc in d1 and ddst in d1: - # directory wasn't entirely moved locally - invalid.add(dsrc + "/") - elif dsrc in d2 and ddst in d2: - # directory wasn't entirely moved remotely - invalid.add(dsrc + "/") - elif dsrc + "/" in dirmove and dirmove[dsrc + "/"] != ddst + "/": - # files from the same directory moved to two different places - invalid.add(dsrc + "/") - else: - # looks good so far - dirmove[dsrc + "/"] = ddst + "/" - - for i in invalid: - if i in dirmove: - del dirmove[i] - del d1, d2, invalid - - if not dirmove: - return copy, {}, diverge, renamedelete, {} - - for d in dirmove: - repo.ui.debug(" discovered dir src: '%s' -> dst: '%s'\n" % - (d, dirmove[d])) - - movewithdir = {} - # check unaccounted nonoverlapping files against directory moves - for f in u1r + u2r: - if f not in fullcopy: - for d in dirmove: - if f.startswith(d): - # new file added in a directory that was moved, move it - df = dirmove[d] + f[len(d):] - if df not in copy: - movewithdir[f] = df - repo.ui.debug((" pending file src: '%s' -> " - "dst: '%s'\n") % (f, df)) - break - - return copy, movewithdir, diverge, renamedelete, dirmove - if util.safehasattr(copies, '_fullcopytracing'): copies._fullcopytracing = fixedcopytracing -elif util.safehasattr(copies, 'mergecopies'): - # compat fix for hg <= 4.3 - copies.mergecopies = fixoldmergecopies if not util.safehasattr(obsutil, "_succs"): class _succs(list): diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/evolvecmd.py Tue Nov 27 04:46:35 2018 +0100 @@ -715,10 +715,7 @@ " content-divergent changesets.\nHG: Resolve conflicts" " in commit messages to continue.\n\n") - if 5 <= len(ui.edit.im_func.func_defaults): # <= hg-4.3 - resolveddesc = ui.edit(prefixes + desc, ui.username(), action='desc') - else: - resolveddesc = ui.edit(prefixes + desc, ui.username()) + resolveddesc = ui.edit(prefixes + desc, ui.username(), action='desc') # make sure we remove the prefixes part from final commit message if prefixes in resolveddesc: # hack, we should find something better @@ -1309,10 +1306,7 @@ """Compute sets of commits divergent with a given one""" cache = {} base = {} - allpredecessors = getattr(obsutil, 'allpredecessors', None) - if allpredecessors is None: # <= Mercurial 4.3 - allpredecessors = obsutil.allprecursors - for n in allpredecessors(repo.obsstore, [ctx.node()]): + for n in obsutil.allpredecessors(repo.obsstore, [ctx.node()]): if n == ctx.node(): # a node can't be a base for divergence with itself continue @@ -1343,7 +1337,7 @@ ('A', 'any', False, _('also consider troubled changesets unrelated to current working ' 'directory')), - ('r', 'rev', [], _('solves troubles of these revisions')), + ('r', 'rev', [], _('solves troubles of these revisions'), _('REV')), ('', 'bumped', False, _('solves only bumped changesets (DEPRECATED)')), ('', 'phase-divergent', False, _('solves only phase-divergent changesets')), ('', 'divergent', False, _('solves only divergent changesets (DEPRECATED)')), @@ -1583,14 +1577,14 @@ # to confirm that if atop msg should be suppressed to remove redundancy lastsolved = None - # check if revs to be evolved are in active topic to make sure that we - # can use stack aliases s# in evolve msgs. activetopic = getattr(repo, 'currenttopic', '') for rev in revs: curctx = repo[rev] revtopic = getattr(curctx, 'topic', lambda: '')() topicidx = getattr(curctx, 'topicidx', lambda: None)() stacktmplt = False + # check if revision being evolved is in active topic to make sure + # that we can use stack aliases s# in evolve msgs. if activetopic and (activetopic == revtopic) and topicidx is not None: stacktmplt = True progresscb() @@ -1750,14 +1744,25 @@ # evolved to confirm that if atop msg should be suppressed to remove # redundancy lastsolved = None + activetopic = getattr(repo, 'currenttopic', '') for rev in evolvestate['revs']: # XXX: prevent this lookup by storing nodes instead of revnums curctx = unfi[rev] + + # check if we can use stack template + revtopic = getattr(curctx, 'topic', lambda: '')() + topicidx = getattr(curctx, 'topicidx', lambda: None)() + stacktmplt = False + if (activetopic and (activetopic == revtopic) + and topicidx is not None): + stacktmplt = True + if (curctx.node() not in evolvestate['replacements'] and curctx.node() not in evolvestate['skippedrevs']): newnode = _solveone(ui, repo, curctx, evolvestate, False, confirm, progresscb, category, - lastsolved=lastsolved) + lastsolved=lastsolved, + stacktmplt=stacktmplt) if newnode[0]: evolvestate['replacements'][curctx.node()] = newnode[1] lastsolved = newnode[1] diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/exthelper.py --- a/hgext3rd/evolve/exthelper.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/exthelper.py Tue Nov 27 04:46:35 2018 +0100 @@ -4,20 +4,13 @@ from mercurial import ( commands, + configitems, extensions, registrar, revset, templatekw, - util, ) -configitem = None -dynamicdefault = None -if util.safehasattr(registrar, 'configitem'): - configitem = registrar.configitem - from mercurial import configitems - dynamicdefault = configitems.dynamicdefault - class exthelper(object): """Helper for modular extension setup @@ -49,20 +42,12 @@ self.command._doregister = _newdoregister self.configtable = {} - self._configitem = None - if configitem is not None: - self._configitem = configitem(self.configtable) - - def configitem(self, section, config): - """For Mercurial 4.4 and above, register a config item + self._configitem = registrar.configitem(self.configtable) - For now constraint to 'dynamicdefault' until we only support version with the feature. - Older version would otherwise not use the declare default. - - For older version no-op fallback for old Mercurial versions + def configitem(self, section, config, default=configitems.dynamicdefault): + """Register a config item. """ - if self._configitem is not None: - self._configitem(section, config, default=dynamicdefault) + self._configitem(section, config, default=default) def merge(self, other): self._uicallables.extend(other._uicallables) diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/legacy.py --- a/hgext3rd/evolve/legacy.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/legacy.py Tue Nov 27 04:46:35 2018 +0100 @@ -32,7 +32,7 @@ try: from mercurial.utils.dateutil import makedate -except ImportError as e: +except ImportError: # compat with hg < 4.6 from mercurial.util import makedate diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/metadata.py --- a/hgext3rd/evolve/metadata.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/metadata.py Tue Nov 27 04:46:35 2018 +0100 @@ -5,7 +5,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -__version__ = '8.3.3.dev' -testedwith = '4.3.2 4.4.2 4.5.2 4.6.2 4.7' -minimumhgversion = '4.3' +__version__ = '8.4.0.dev' +testedwith = '4.4.2 4.5.2 4.6.2 4.7' +minimumhgversion = '4.4' buglink = 'https://bz.mercurial-scm.org/' diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/obshistory.py Tue Nov 27 04:46:35 2018 +0100 @@ -14,7 +14,6 @@ error, graphmod, patch, - obsolete, obsutil, node as nodemod, scmutil, @@ -863,49 +862,6 @@ return False return True -# Wrap pre Mercurial 4.4 createmarkers that didn't included effect-flag -if not util.safehasattr(obsutil, 'geteffectflag'): - @eh.wrapfunction(obsolete, 'createmarkers') - def createmarkerswithbits(orig, repo, relations, flag=0, date=None, - metadata=None, **kwargs): - """compute 'effect-flag' and augment the created markers - - Wrap obsolete.createmarker in order to compute the effect of each - relationship and store them as flag in the metadata. - - While we experiment, we store flag in a metadata field. This field is - "versionned" to easilly allow moving to other meaning for flags. - - The comparison of description or other infos just before creating the obs - marker might induce overhead in some cases. However it is a good place to - start since it automatically makes all markers creation recording more - meaningful data. In the future, we can introduce way for commands to - provide precomputed effect to avoid the overhead. - """ - if not repo.ui.configbool('experimental', 'evolution.effect-flags', **efd): - return orig(repo, relations, flag, date, metadata, **kwargs) - if metadata is None: - metadata = {} - tr = repo.transaction('add-obsolescence-marker') - try: - for r in relations: - # Compute the effect flag for each obsmarker - effect = geteffectflag(r) - - # Copy the metadata in order to add them, we copy because the - # effect flag might be different per relation - m = metadata.copy() - # we store the effect even if "0". This disctinct markers created - # without the feature with markers recording a no-op. - m['ef1'] = "%d" % effect - - # And call obsolete.createmarkers for creating the obsmarker for real - orig(repo, [r], flag, date, m, **kwargs) - - tr.close() - finally: - tr.release() - def _getobsfate(successorssets): """ Compute a changeset obsolescence fate based on his successorssets. Successors can be the tipmost ones or the immediate ones. diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/rewind.py --- a/hgext3rd/evolve/rewind.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/rewind.py Tue Nov 27 04:46:35 2018 +0100 @@ -27,10 +27,11 @@ @eh.command( 'rewind|undo', - [('', 'to', [], _("rewind to these revisions")), + [('', 'to', [], _("rewind to these revisions"), _('REV')), ('', 'as-divergence', None, _("preserve current latest successors")), ('', 'exact', None, _("only rewind explicitly selected revisions")), - ('', 'from', [], _("rewind these revisions to their predecessors")), + ('', 'from', [], + _("rewind these revisions to their predecessors"), _('REV')), ], _(''), helpbasic=True) diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/safeguard.py --- a/hgext3rd/evolve/safeguard.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/safeguard.py Tue Nov 27 04:46:35 2018 +0100 @@ -26,9 +26,12 @@ def checkpush(self, pushop): super(noautopublishrepo, self).checkpush(pushop) behavior = self.ui.config('experimental', 'auto-publish', 'default') + nocheck = behavior not in ('warn', 'abort') + if nocheck or getattr(pushop, 'publish', False): + return remotephases = pushop.remote.listkeys('phases') publishing = remotephases.get('publishing', False) - if behavior in ('warn', 'abort') and publishing: + if publishing: if pushop.revs is None: published = self.filtered('served').revs("not public()") else: diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/evolve/templatekw.py --- a/hgext3rd/evolve/templatekw.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/evolve/templatekw.py Tue Nov 27 04:46:35 2018 +0100 @@ -9,7 +9,6 @@ """ from . import ( - compat, error, exthelper, obshistory @@ -17,7 +16,6 @@ from mercurial import ( templatekw, - node, util ) @@ -41,79 +39,14 @@ return templatekw.showlist('trouble', ctx.instabilities(), args, plural='troubles') -if util.safehasattr(templatekw, 'showpredecessors'): - templatekw.keywords["precursors"] = templatekw.showpredecessors -else: - # for version <= hg4.3 - def closestprecursors(repo, nodeid): - """ Yield the list of next precursors pointing on visible changectx nodes - """ - - precursors = repo.obsstore.predecessors - stack = [nodeid] - seen = set(stack) - - while stack: - current = stack.pop() - currentpreccs = precursors.get(current, ()) - - for prec in currentpreccs: - precnodeid = prec[0] - - # Basic cycle protection - if precnodeid in seen: - continue - seen.add(precnodeid) - - if precnodeid in repo: - yield precnodeid - else: - stack.append(precnodeid) - - @eh.templatekw("precursors") - def shownextvisibleprecursors(repo, ctx, **args): - """Returns a string containing the list of the closest precursors - """ - precursors = sorted(closestprecursors(repo, ctx.node())) - precursors = [node.hex(p) for p in precursors] - - return templatekw._hybrid(None, precursors, lambda x: {'precursor': x}, - lambda d: d['precursor'][:12]) +templatekw.keywords["precursors"] = templatekw.showpredecessors def closestsuccessors(repo, nodeid): """ returns the closest visible successors sets instead. """ return directsuccessorssets(repo, nodeid) -if util.safehasattr(templatekw, 'showsuccessorssets'): - templatekw.keywords["successors"] = templatekw.showsuccessorssets -else: - # for version <= hg4.3 - - @eh.templatekw("successors") - def shownextvisiblesuccessors(repo, ctx, templ, **args): - """Returns a string of sets of successors for a changectx - - Format used is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and - ctx2 while also diverged into ctx3""" - if not ctx.obsolete(): - return '' - - ssets, _ = closestsuccessors(repo, ctx.node()) - ssets = [[node.hex(n) for n in ss] for ss in ssets] - - data = [] - gen = [] - for ss in ssets: - subgen = '[%s]' % ', '.join(n[:12] for n in ss) - gen.append(subgen) - h = templatekw._hybrid(iter(subgen), ss, lambda x: {'successor': x}, - lambda d: "%s" % d["successor"]) - data.append(h) - - gen = ', '.join(gen) - return templatekw._hybrid(iter(gen), data, lambda x: {'successorset': x}, - lambda d: d["successorset"]) +templatekw.keywords["successors"] = templatekw.showsuccessorssets def _getusername(ui): """the default username in the config or None""" @@ -241,24 +174,7 @@ return "\n".join(lines) -if util.safehasattr(templatekw, 'obsfateverb'): - # Individuals fragments are available in core - pass -elif util.safehasattr(templatekw, 'compatlist'): - @eh.templatekw('obsfatedata', requires=set(['ctx', 'templ'])) - def showobsfatedata(context, mapping): - ctx = context.resource(mapping, 'ctx') - repo = ctx.repo() - values = obsfatedata(repo, ctx) - - if values is None: - return templatekw.compatlist(context, mapping, "obsfatedata", []) - args = mapping.copy() - args.pop('ctx') - args['templ'] = context - return _showobsfatedata(repo, ctx, values, **args) -else: - # pre hg-4.6 +if not util.safehasattr(templatekw, 'obsfateverb'): # <= hg-4.5 @eh.templatekw("obsfatedata") def showobsfatedata(repo, ctx, **args): # Get the needed obsfate data @@ -325,30 +241,6 @@ return templatekw._hybrid(gen, values, lambda x: {name: x}, fmt) -# rely on core mercurial starting from 4.4 for the obsfate template -if not util.safehasattr(templatekw, 'showobsfate'): - - @eh.templatekw("obsfate") - def showobsfate(*args, **kwargs): - return showobsfatedata(*args, **kwargs) - -if util.safehasattr(compat.changesetprinter, '_showobsfate'): - pass # already included by default -elif util.safehasattr(compat.changesetprinter, '_exthook'): - @eh.wrapfunction(compat.changesetprinter, '_exthook') - def exthook(original, self, ctx): - # Call potential other extensions - original(self, ctx) - - obsfate = obsfatedata(self.repo, ctx) - if obsfate is None: - return "" - - output = obsfateprinter(obsfate, self.ui, prefix="obsolete: ") - - self.ui.write(output, label='log.obsfate') - self.ui.write("\n") - # copy from mercurial.obsolete with a small change to stop at first known changeset. def directsuccessorssets(repo, initialnode, cache=None): diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/pullbundle.py diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/topic/__init__.py Tue Nov 27 04:46:35 2018 +0100 @@ -177,10 +177,10 @@ 'topic.active': 'green', } -__version__ = '0.12.3.dev' +__version__ = '0.13.0.dev' -testedwith = '4.3.3 4.4.2 4.5.2 4.6.2 4.7' -minimumhgversion = '4.3' +testedwith = '4.4.2 4.5.2 4.6.2 4.7' +minimumhgversion = '4.4' buglink = 'https://bz.mercurial-scm.org/' if util.safehasattr(registrar, 'configitem'): @@ -680,7 +680,11 @@ txn = repo.transaction('rewrite-topics') rewrote = _changetopics(ui, repo, touchedrevs, topic) txn.close() - ui.status('changed topic on %d changes\n' % rewrote) + if topic is None: + ui.status('cleared topic on %d changesets\n' % rewrote) + else: + ui.status('changed topic on %d changesets to "%s"\n' % (rewrote, + topic)) finally: lockmod.release(txn, lock, wl) repo.invalidate() diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/topic/discovery.py --- a/hgext3rd/topic/discovery.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/topic/discovery.py Tue Nov 27 04:46:35 2018 +0100 @@ -33,32 +33,30 @@ publishedset = () remotebranchmap = None origremotebranchmap = remote.branchmap - # < hg-4.4 do not have a --publish flag anyway - if util.safehasattr(pushop, 'remotephases'): - publishednode = [c.node() for c in pushop.outdatedphases] - publishedset = repo.revs('ancestors(%ln + %ln)', - publishednode, - pushop.remotephases.publicheads) + publishednode = [c.node() for c in pushop.outdatedphases] + publishedset = repo.revs('ancestors(%ln + %ln)', + publishednode, + pushop.remotephases.publicheads) - rev = repo.unfiltered().changelog.nodemap.get + rev = repo.unfiltered().changelog.nodemap.get - def remotebranchmap(): - # drop topic information from changeset about to be published - result = collections.defaultdict(list) - for branch, heads in origremotebranchmap().iteritems(): - if ':' not in branch: - result[branch].extend(heads) - else: - namedbranch = branch.split(':', 1)[0] - for h in heads: - r = rev(h) - if r is not None and r in publishedset: - result[namedbranch].append(h) - else: - result[branch].append(h) - for heads in result.itervalues(): - heads.sort() - return result + def remotebranchmap(): + # drop topic information from changeset about to be published + result = collections.defaultdict(list) + for branch, heads in origremotebranchmap().iteritems(): + if ':' not in branch: + result[branch].extend(heads) + else: + namedbranch = branch.split(':', 1)[0] + for h in heads: + r = rev(h) + if r is not None and r in publishedset: + result[namedbranch].append(h) + else: + result[branch].append(h) + for heads in result.itervalues(): + heads.sort() + return result class repocls(repo.__class__): # awful hack to see branch as "branch:topic" diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/topic/flow.py --- a/hgext3rd/topic/flow.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/topic/flow.py Tue Nov 27 04:46:35 2018 +0100 @@ -7,7 +7,6 @@ extensions, node, phases, - util, ) from mercurial.i18n import _ @@ -75,9 +74,6 @@ def wrapphasediscovery(orig, pushop): orig(pushop) if getattr(pushop, 'publish', False): - if not util.safehasattr(pushop, 'remotephases'): - msg = _('--publish flag only supported from Mercurial 4.4 and higher') - raise error.Abort(msg) if not pushop.remotephases.publishing: unfi = pushop.repo.unfiltered() droots = pushop.remotephases.draftroots @@ -87,8 +83,9 @@ def installpushflag(ui): entry = extensions.wrapcommand(commands.table, 'push', wrappush) - entry[1].append(('', 'publish', False, - _('push the changeset as public'))) + if not any(opt for opt in entry[1] if opt[1] == 'publish'): # hg <= 4.9 + entry[1].append(('', 'publish', False, + _('push the changeset as public'))) extensions.wrapfunction(exchange.pushoperation, '__init__', extendpushoperation) extensions.wrapfunction(exchange, '_pushdiscoveryphase', wrapphasediscovery) diff -r 48da02d7f8eb -r ff799015d62e hgext3rd/topic/randomname.py --- a/hgext3rd/topic/randomname.py Tue Nov 27 04:42:45 2018 +0100 +++ b/hgext3rd/topic/randomname.py Tue Nov 27 04:46:35 2018 +0100 @@ -189,7 +189,6 @@ 'pony', 'porcupine', 'porpoise', - 'prairie', 'puffin', 'pug', 'quagga', diff -r 48da02d7f8eb -r ff799015d62e tests/test-amend.t --- a/tests/test-amend.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-amend.t Tue Nov 27 04:46:35 2018 +0100 @@ -153,7 +153,7 @@ --close-branch mark a branch as closed, hiding it from the branch list -s --secret use the secret phase for committing - -n --note VALUE store a note on amend + -n --note TEXT store a note on amend -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -m --message TEXT use text as commit message diff -r 48da02d7f8eb -r ff799015d62e tests/test-discovery-obshashrange-cache.t --- a/tests/test-discovery-obshashrange-cache.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-discovery-obshashrange-cache.t Tue Nov 27 04:46:35 2018 +0100 @@ -28,7 +28,7 @@ $ hg -R main debugbuilddag '.+7' $ for node in `hg -R main log -T '{node}\n'`; do - > echo -n $node | grep -o . | sort |tr -d "\n" > ancfile + > printf $node | grep -o . | sort |tr -d "\n" > ancfile > anc=`cat ancfile` > rm ancfile > echo "marking $anc as predecessors of $node" diff -r 48da02d7f8eb -r ff799015d62e tests/test-discovery-obshashrange.t --- a/tests/test-discovery-obshashrange.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-discovery-obshashrange.t Tue Nov 27 04:46:35 2018 +0100 @@ -190,9 +190,6 @@ remote: capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_obshashrange_v1 batch * (glob) remote: 1 sending protocaps command - preparing listkeys for "phases" - sending listkeys command - received listkey for "phases": 58 bytes query 1; heads sending batch command searching for changes @@ -322,9 +319,6 @@ * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> remote: capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_obshashrange_v1 batch branchmap bundle2=HG20%0Abookmarks%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Aobsmarkers%3DV0%2CV1%0Aphases%3Dheads%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Arev-branch-cache%0Astream%3Dv2 changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> remote: 1 (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> sending protocaps command (glob) - * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> preparing listkeys for "phases" (glob) - * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> sending listkeys command (glob) - * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> received listkey for "phases": 58 bytes (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> query 1; heads (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> sending batch command (glob) * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> taking quick initial sample (glob) diff -r 48da02d7f8eb -r ff799015d62e tests/test-evolve-stop-orphan.t --- a/tests/test-evolve-stop-orphan.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-evolve-stop-orphan.t Tue Nov 27 04:46:35 2018 +0100 @@ -109,9 +109,8 @@ Checking working dir $ hg status Checking for incomplete mergestate - $ ls .hg/merge - ls: cannot access .?\.hg/merge.?: No such file or directory (re) - [2] + $ ls .hg/ | grep merge + [1] Checking graph $ hg glog diff -r 48da02d7f8eb -r ff799015d62e tests/test-evolve-topic.t --- a/tests/test-evolve-topic.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-evolve-topic.t Tue Nov 27 04:46:35 2018 +0100 @@ -257,7 +257,7 @@ $ hg topic -r 070c5573d8f9 bar 4 new orphan changesets - changed topic on 1 changes + changed topic on 1 changesets to "bar" $ hg up 16d6f664b17c switching to topic bar 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -381,3 +381,63 @@ $ hg prev 0 files updated, 0 files merged, 1 files removed, 0 files unresolved [s3] add eee + +Check stackaliases(s#) works with --continue case also, while evolving: +------------------------------------------------------------------------ + $ hg up 18 + switching to topic bar + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg evolve --all + move:[s2] add ggg + atop:[s1] add fff + move:[s3] add hhh + move:[s4] add iii + move:[s5] add jjj + working directory is now at 38a82cbb794a + $ hg up 18 + 0 files updated, 0 files merged, 4 files removed, 0 files unresolved + $ echo "changes in hhh" > hhh + $ hg add hhh + $ hg ci --amend + 4 new orphan changesets + $ hg log -G + @ 26 - {bar} 2c295936ac04 add fff (draft) + | + | * 25 - {bar} 38a82cbb794a add jjj (draft) + | | + | * 24 - {bar} 4a44eba0fdb3 add iii (draft) + | | + | * 23 - {bar} 7acd9ea5d677 add hhh (draft) + | | + | * 22 - {bar} 735c7bd8f133 add ggg (draft) + | | + | x 18 - {bar} 793eb6370b2d add fff (draft) + |/ + o 12 - {foo} 42b49017ff90 add eee (draft) + | + o 10 - {foo} d9cacd156ffc add ddd (draft) + | + o 2 - {foo} cced9bac76e3 add ccc (draft) + | + o 1 - {} a4dbed0837ea add bbb (draft) + | + o 0 - {} 199cc73e9a0b add aaa (draft) + + $ hg evolve --all + move:[s2] add ggg + atop:[s1] add fff + move:[s3] add hhh + merging hhh + warning: conflicts while merging hhh! (edit, then use 'hg resolve --mark') + fix conflicts and see `hg help evolve.interrupted` + [1] + $ echo "resolved hhh" > hhh + $ hg resolve --mark hhh + (no more unresolved files) + continue: hg evolve --continue + $ hg evolve --continue + evolving 23:7acd9ea5d677 "add hhh" + move:[s4] add iii + atop:[s3] add hhh + move:[s5] add jjj + working directory is now at 119e4c126fb2 diff -r 48da02d7f8eb -r ff799015d62e tests/test-evolve.t diff -r 48da02d7f8eb -r ff799015d62e tests/test-grab.t --- a/tests/test-grab.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-grab.t Tue Nov 27 04:46:35 2018 +0100 @@ -24,9 +24,9 @@ options: - -r --rev VALUE revision to pick - -c --continue continue interrupted pick - -a --abort abort interrupted pick + -r --rev REV revision to pick + -c --continue continue interrupted pick + -a --abort abort interrupted pick (some details hidden, use --verbose to show complete help) diff -r 48da02d7f8eb -r ff799015d62e tests/test-obsolete-push.t --- a/tests/test-obsolete-push.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-obsolete-push.t Tue Nov 27 04:46:35 2018 +0100 @@ -4,6 +4,7 @@ > [extensions] > EOF $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH + $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> $HGRCPATH $ template='{rev}:{node|short}@{branch}({separate("/", obsolete, phase)}) {desc|firstline}\n' $ glog() { @@ -91,3 +92,15 @@ adding manifests adding file changes added 0 changesets with 0 changes to 1 files + +--publish overrides auto-publish + + $ echo d > d + $ hg ci -qAm D d + $ hg push -r . --publish --config experimental.auto-publish=abort + pushing to $TESTTMP/source + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files diff -r 48da02d7f8eb -r ff799015d62e tests/test-obsolete.t diff -r 48da02d7f8eb -r ff799015d62e tests/test-options.t --- a/tests/test-options.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-options.t Tue Nov 27 04:46:35 2018 +0100 @@ -24,6 +24,7 @@ > allowunstable > exchange > EOF - $ hg prune | head -n 2 + $ hg prune hg: unknown command 'prune' (use 'hg help' for a list of commands) + [255] diff -r 48da02d7f8eb -r ff799015d62e tests/test-prev-next.t --- a/tests/test-prev-next.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-prev-next.t Tue Nov 27 04:46:35 2018 +0100 @@ -184,7 +184,7 @@ $ hg amend -m 'added b (2)' 1 new orphan changesets - $ hg next + $ hg next --no-evolve no children (1 unstable changesets to be evolved here, do you want --evolve?) [1] @@ -231,7 +231,7 @@ $ hg am -m 'added b (3)' 2 new orphan changesets - $ hg next + $ hg next --no-evolve no children (2 unstable changesets to be evolved here, do you want --evolve?) [1] @@ -375,6 +375,7 @@ $ hg next --evolve abort: uncommitted changes + (use `hg amend`, `hg revert` or `hg shelve`) [255] $ cd .. @@ -482,3 +483,107 @@ 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [2] added bar + +Add test which shows that now `next` command does not get confused by split: +---------------------------------------------------------------------------- + $ cd .. + $ mkdir nextconfused + $ cd nextconfused + $ hg init + $ echo firstline > a + $ hg add a + $ hg ci -qm A + $ echo bbbbb > b + $ echo secondline >> a + $ hg add b + $ hg ci -qm B + $ echo ccccc > c + $ hg add c + $ hg ci -qm C + $ hg log -GT "{rev}:{node|short} {desc}\n" + @ 2:fdc998261dcb C + | + o 1:cc0edb0cc2b1 B + | + o 0:cae96ff49c84 A + + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg split << EOF + > y + > y + > n + > N + > y + > y + > EOF + 1 files updated, 0 files merged, 1 files removed, 0 files unresolved + reverting a + adding b + diff --git a/a b/a + 1 hunks, 1 lines changed + examine changes to 'a'? [Ynesfdaq?] y + + @@ -1,1 +1,2 @@ + firstline + +secondline + record change 1/2 to 'a'? [Ynesfdaq?] y + + diff --git a/b b/b + new file mode 100644 + examine changes to 'b'? [Ynesfdaq?] n + + created new head + Done splitting? [yN] N + diff --git a/b b/b + new file mode 100644 + examine changes to 'b'? [Ynesfdaq?] y + + @@ -0,0 +1,1 @@ + +bbbbb + record this change to 'b'? [Ynesfdaq?] y + + no more change to split + 1 new orphan changesets + + $ hg up 3 -q + $ hg log -GT "{rev}:{node|short} {desc}\n" + o 4:279f6cab32b5 B + | + | + | new desc + @ 3:a9f74d07e45c B + | + | + | new desc + | * 2:fdc998261dcb C + | | + | x 1:cc0edb0cc2b1 B + |/ + o 0:cae96ff49c84 A + + $ hg ci --amend -m "B modified" + 1 new orphan changesets + $ hg log -GT "{rev}:{node|short} {desc}\n" + @ 5:64ab03d3110c B modified + | + | * 4:279f6cab32b5 B + | | + | | + | | new desc + | x 3:a9f74d07e45c B + |/ + | + | new desc + | * 2:fdc998261dcb C + | | + | x 1:cc0edb0cc2b1 B + |/ + o 0:cae96ff49c84 A + + $ hg next --evolve << EOF + > q + > EOF + move:[4] B + atop:[5] B modified + working directory now at 1b434459c7e7 diff -r 48da02d7f8eb -r ff799015d62e tests/test-stack-branch.t --- a/tests/test-stack-branch.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-stack-branch.t Tue Nov 27 04:46:35 2018 +0100 @@ -309,7 +309,7 @@ ---------------------------------------------------- $ hg topic --rev b4::b5 sometopic - changed topic on 2 changes + changed topic on 2 changesets to "sometopic" $ hg stack ### target: foo (branch) s3$ c_f (unstable) diff -r 48da02d7f8eb -r ff799015d62e tests/test-topic-change.t --- a/tests/test-topic-change.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-topic-change.t Tue Nov 27 04:46:35 2018 +0100 @@ -51,7 +51,7 @@ Clearing topic from revision without topic $ hg topic -r . --clear - changed topic on 0 changes + cleared topic on 0 changesets Clearing current topic when no active topic is not error @@ -62,7 +62,7 @@ $ hg topic -r 0:: foo switching to topic foo - changed topic on 8 changes + changed topic on 8 changesets to "foo" $ hg glog @ 15:05095f607171 {foo} | Added h () @@ -100,7 +100,7 @@ $ hg topic -r abcedffeae90:: bar switching to topic bar - changed topic on 4 changes + changed topic on 4 changesets to "bar" $ hg glog @ 19:d7d36e193ea7 {bar} | Added h () @@ -139,7 +139,7 @@ $ hg topic -r . --current active topic 'foobar' grew its first changeset (see 'hg help topics' for more information) - changed topic on 1 changes + changed topic on 1 changesets to "foobar" $ hg glog -r . @ 20:c2d6b7df5dcf {foobar} | Added h () @@ -149,7 +149,7 @@ $ hg topic -r 9::10 --current 5 new orphan changesets - changed topic on 2 changes + changed topic on 2 changesets to "foobar" $ hg glog o 22:1b88140feefe {foobar} | Added c () @@ -302,7 +302,7 @@ $ hg topic -r . --clear clearing empty topic "watwat" active topic 'watwat' is now empty - changed topic on 1 changes + cleared topic on 1 changesets $ hg glog @ 31:c48d6d71b2d9 {} @@ -335,7 +335,7 @@ $ hg bookmark bookboo $ hg topic -r . movebook switching to topic movebook - changed topic on 1 changes + changed topic on 1 changesets to "movebook" $ hg glog @ 32:1b83d11095b9 {movebook} | Added h (book bookboo) @@ -376,7 +376,7 @@ $ hg topic -r . watwat switching to topic watwat 1 new orphan changesets - changed topic on 1 changes + changed topic on 1 changesets to "watwat" $ hg glog @ 33:894983f69e69 {watwat} diff -r 48da02d7f8eb -r ff799015d62e tests/test-topic-stack.t --- a/tests/test-topic-stack.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-topic-stack.t Tue Nov 27 04:46:35 2018 +0100 @@ -495,7 +495,7 @@ $ hg topic foobar -r 'desc(c_e) + desc(c_D)' switching to topic foobar 4 new orphan changesets - changed topic on 2 changes + changed topic on 2 changesets to "foobar" $ hg log -G @ 17 default {foobar} draft c_D | diff -r 48da02d7f8eb -r ff799015d62e tests/test-topic.t --- a/tests/test-topic.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-topic.t Tue Nov 27 04:46:35 2018 +0100 @@ -863,7 +863,7 @@ $ hg topic topic1970 --rev 0 switching to topic topic1970 - changed topic on 1 changes + changed topic on 1 changesets to "topic1970" $ hg add b $ hg topic topic1990 diff -r 48da02d7f8eb -r ff799015d62e tests/test-tutorial.t --- a/tests/test-tutorial.t Tue Nov 27 04:42:45 2018 +0100 +++ b/tests/test-tutorial.t Tue Nov 27 04:46:35 2018 +0100 @@ -934,9 +934,9 @@ options ([+] can be repeated): -a --all uncommit all changes when no arguments given - -r --rev VALUE revert commit content to REV instead + -r --rev REV revert commit content to REV instead --revert discard working directory changes after uncommit - -n --note VALUE store a note on uncommit + -n --note TEXT store a note on uncommit -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -m --message TEXT use text as commit message @@ -973,16 +973,16 @@ options ([+] can be repeated): - -r --rev VALUE [+] revision to fold - --exact only fold specified revisions - --from fold revisions linearly to working copy parent - -n --note VALUE store a note on fold - -m --message TEXT use text as commit message - -l --logfile FILE read commit message from file - -d --date DATE record the specified date as commit date - -u --user USER record the specified user as committer - -D --current-date record the current date as commit date - -U --current-user record the current user as committer + -r --rev REV [+] revision to fold + --exact only fold specified revisions + --from fold revisions linearly to working copy parent + -n --note TEXT store a note on fold + -m --message TEXT use text as commit message + -l --logfile FILE read commit message from file + -d --date DATE record the specified date as commit date + -u --user USER record the specified user as committer + -D --current-date record the current date as commit date + -U --current-user record the current user as committer (some details hidden, use --verbose to show complete help) diff -r 48da02d7f8eb -r ff799015d62e tests/test-wireproto.t