# HG changeset patch # User Pierre-Yves David # Date 1517837794 -3600 # Node ID 6d180db0e3e8bbb9398208381033a8ce8cc9b8e9 # Parent 7f646d98858ef02e7ec536aff260be21a0eeebe4# Parent f03845bfd0154106df3eb35fb32f42ed2ceaedf3 branching: merge with stable diff -r 7f646d98858e -r 6d180db0e3e8 hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Mon Jan 22 18:35:50 2018 +0530 +++ b/hgext3rd/evolve/__init__.py Mon Feb 05 14:36:34 2018 +0100 @@ -1040,7 +1040,8 @@ exc.hint = _('do you want --merge?') raise - displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate}) + displayer = compat.changesetdisplayer(ui, repo, + {'template': shorttemplate}) topic = not opts.get("no_topic", False) target, bookmark = _findprevtarget(repo, displayer, @@ -1100,7 +1101,8 @@ filtered = [ctx for ctx in children if ctx.topic() != topic] # XXX N-square membership on children children = [ctx for ctx in children if ctx not in filtered] - displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate}) + displayer = compat.changesetdisplayer(ui, repo, + {'template': shorttemplate}) if len(children) == 1: c = children[0] bm = repo._activebookmark diff -r 7f646d98858e -r 6d180db0e3e8 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Mon Jan 22 18:35:50 2018 +0530 +++ b/hgext3rd/evolve/cmdrewrite.py Mon Feb 05 14:36:34 2018 +0100 @@ -1088,7 +1088,7 @@ if not duplicate: rewriteutil.precheck(repo, revs, touch) tmpl = utility.shorttemplate - displayer = cmdutil.show_changeset(ui, repo, {'template': tmpl}) + displayer = compat.changesetdisplayer(ui, repo, {'template': tmpl}) wlock = lock = tr = None try: wlock = repo.wlock() diff -r 7f646d98858e -r 6d180db0e3e8 hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Mon Jan 22 18:35:50 2018 +0530 +++ b/hgext3rd/evolve/compat.py Mon Feb 05 14:36:34 2018 +0100 @@ -28,6 +28,18 @@ except ImportError: obsutil = None +# hg < 4.6 compat (c8e2d6ed1f9e) +try: + from mercurial import logcmdutil + changesetdisplayer = logcmdutil.changesetdisplayer + changesetprinter = logcmdutil.changesetprinter + displaygraph = logcmdutil.displaygraph +except (AttributeError, ImportError): + from mercurial import cmdutil + changesetdisplayer = cmdutil.show_changeset + changesetprinter = cmdutil.changeset_printer + displaygraph = cmdutil.displaygraph + from . import ( exthelper, ) diff -r 7f646d98858e -r 6d180db0e3e8 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Mon Jan 22 18:35:50 2018 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Mon Feb 05 14:36:34 2018 +0100 @@ -133,7 +133,7 @@ target = repo[heads.first()] else: target = targets[0] - displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate}) + displayer = compat.changesetdisplayer(ui, repo, {'template': shorttemplate}) target = repo[target] if not ui.quiet or confirm: repo.ui.write(_('move:')) @@ -190,7 +190,7 @@ ui.write_err(msg) return (False, '') - displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate}) + displayer = compat.changesetdisplayer(ui, repo, {'template': shorttemplate}) if not ui.quiet or confirm: repo.ui.write(_('recreate:')) displayer.show(bumped) @@ -333,7 +333,7 @@ ui.write_err(hint) return (False, '') - displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate}) + displayer = compat.changesetdisplayer(ui, repo, {'template': shorttemplate}) if not ui.quiet or confirm: ui.write(_('merge:')) displayer.show(divergent) @@ -1075,8 +1075,8 @@ elif len(specifiedcategories) == 1: targetcat = specifiedcategories[0] elif repo['.'].obsolete(): - displayer = cmdutil.show_changeset(ui, repo, - {'template': shorttemplate}) + displayer = compat.changesetdisplayer(ui, repo, + {'template': shorttemplate}) # no args and parent is obsolete, update to successors try: ctx = repo[utility._singlesuccessor(repo, repo['.'])] diff -r 7f646d98858e -r 6d180db0e3e8 hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Mon Jan 22 18:35:50 2018 +0530 +++ b/hgext3rd/evolve/obshistory.py Mon Feb 05 14:36:34 2018 +0100 @@ -10,7 +10,6 @@ import re from mercurial import ( - cmdutil, commands, error, graphmod, @@ -97,7 +96,7 @@ revs.reverse() _debugobshistoryrevs(ui, repo, revs, opts) -class obsmarker_printer(cmdutil.changeset_printer): +class obsmarker_printer(compat.changesetprinter): """show (available) information about a node We display the node, description (if available) and various information @@ -356,7 +355,7 @@ displayer = obsmarker_printer(ui, repo.unfiltered(), matchfn, opts, buffered=True) edges = graphmod.asciiedges walker = _obshistorywalker(repo.unfiltered(), revs, opts.get('all', False)) - cmdutil.displaygraph(ui, repo, walker, displayer, edges) + compat.displaygraph(ui, repo, walker, displayer, edges) def _debugobshistoryrevs(ui, repo, revs, opts): """ Display the obsolescence history for revset diff -r 7f646d98858e -r 6d180db0e3e8 hgext3rd/evolve/stablesort.py --- a/hgext3rd/evolve/stablesort.py Mon Jan 22 18:35:50 2018 +0530 +++ b/hgext3rd/evolve/stablesort.py Mon Feb 05 14:36:34 2018 +0100 @@ -14,7 +14,6 @@ from mercurial import ( commands, - cmdutil, localrepo, error, node as nodemod, @@ -76,7 +75,7 @@ raise error.Abort('unknown sorting method: "%s"' % method, hint='pick one of: %s' % valid_method) - displayer = cmdutil.show_changeset(ui, repo, opts, buffered=True) + displayer = compat.changesetdisplayer(ui, repo, opts, buffered=True) kwargs = {} if opts['limit']: kwargs['limit'] = int(opts['limit']) diff -r 7f646d98858e -r 6d180db0e3e8 hgext3rd/evolve/templatekw.py --- a/hgext3rd/evolve/templatekw.py Mon Jan 22 18:35:50 2018 +0530 +++ b/hgext3rd/evolve/templatekw.py Mon Feb 05 14:36:34 2018 +0100 @@ -9,13 +9,13 @@ """ from . import ( + compat, error, exthelper, obshistory ) from mercurial import ( - cmdutil, templatekw, node, util @@ -316,10 +316,10 @@ def showobsfate(*args, **kwargs): return showobsfatedata(*args, **kwargs) -if util.safehasattr(cmdutil.changeset_printer, '_showobsfate'): +if util.safehasattr(compat.changesetprinter, '_showobsfate'): pass # already included by default -elif util.safehasattr(cmdutil.changeset_printer, '_exthook'): - @eh.wrapfunction(cmdutil.changeset_printer, '_exthook') +elif util.safehasattr(compat.changesetprinter, '_exthook'): + @eh.wrapfunction(compat.changesetprinter, '_exthook') def exthook(original, self, ctx): # Call potential other extensions original(self, ctx)