# HG changeset patch # User Pierre-Yves David # Date 1533167833 -7200 # Node ID 2574816426861e843a0c741b291862de4956650f # Parent 9839463088acbbfc45b77acd8b9cdd927d7ca2e7# Parent 202413cab59f7e1b1bad973da4937c0c0c6ef3d3 test-compat: merge stable into mercurial-4.6 diff -r 202413cab59f -r 257481642686 hgext3rd/evolve/compat.py --- a/hgext3rd/evolve/compat.py Thu Aug 02 01:53:01 2018 +0200 +++ b/hgext3rd/evolve/compat.py Thu Aug 02 01:57:13 2018 +0200 @@ -28,11 +28,13 @@ changesetdisplayer = logcmdutil.changesetdisplayer changesetprinter = logcmdutil.changesetprinter displaygraph = logcmdutil.displaygraph + changesetdiffer = logcmdutil.changesetdiffer except (AttributeError, ImportError): from mercurial import cmdutil changesetdisplayer = cmdutil.show_changeset changesetprinter = cmdutil.changeset_printer displaygraph = cmdutil.displaygraph + changesetdiffer = None from . import ( exthelper, diff -r 202413cab59f -r 257481642686 hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Thu Aug 02 01:53:01 2018 +0200 +++ b/hgext3rd/evolve/obshistory.py Thu Aug 02 01:57:13 2018 +0200 @@ -141,8 +141,16 @@ We display the node, description (if available) and various information about obsolescence markers affecting it""" - def __init__(self, ui, repo, differ=None, diffopts=None, buffered=False): - super(obsmarker_printer, self).__init__(ui, repo, differ=differ, diffopts=diffopts, buffered=buffered) + def __init__(self, ui, repo, *args, **kwargs): + + if kwargs.pop('obspatch', False): + if compat.changesetdiffer is None: + kwargs['matchfn'] = scmutil.matchall(repo) + else: + kwargs['differ'] = scmutil.matchall(repo) + + super(obsmarker_printer, self).__init__(ui, repo, *args, **kwargs) + diffopts = kwargs.get('diffopts', {}) # Compat 4.6 if not util.safehasattr(self, "_includediff"): @@ -415,11 +423,8 @@ return sorted(seen), nodesucc, nodeprec def _debugobshistorygraph(ui, repo, revs, opts): - matchfn = None - if opts.get('patch'): - matchfn = scmutil.matchall(repo) - displayer = obsmarker_printer(ui, repo.unfiltered(), matchfn, opts, buffered=True) + displayer = obsmarker_printer(ui, repo.unfiltered(), obspatch=True, diffopts=opts, buffered=True) edges = graphmod.asciiedges walker = _obshistorywalker(repo.unfiltered(), revs, opts.get('all', False), opts.get('filternonlocal', False)) compat.displaygraph(ui, repo, walker, displayer, edges) diff -r 202413cab59f -r 257481642686 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Thu Aug 02 01:53:01 2018 +0200 +++ b/hgext3rd/topic/__init__.py Thu Aug 02 01:57:13 2018 +0200 @@ -487,8 +487,9 @@ empty = csetcount == 0 if empty and not ctwasempty: ui.status('active topic %r is now empty\n' % ct) - if ('phase' in tr.names - or any(n.startswith('push-response') for n in tr.names)): + if ('phase' in getattr(tr, 'names', ()) + or any(n.startswith('push-response') + for n in getattr(tr, 'names', ()))): ui.status(_("(use 'hg topic --clear' to clear it if needed)\n")) hint = _("(see 'hg help topics' for more information)\n") if ctwasempty and not empty: