changeset 4124:23658110ab26 stable

topic: add a compatibility to access transaction's names The attribute was made private in 4024c363cd33.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 21 Sep 2018 19:49:28 +0200
parents 119fced5a891
children 865c33c16508
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Fri Sep 21 17:50:28 2018 +0200
+++ b/hgext3rd/topic/__init__.py	Fri Sep 21 19:49:28 2018 +0200
@@ -516,9 +516,10 @@
                 empty = csetcount == 0
                 if empty and not ctwasempty:
                     ui.status('active topic %r is now empty\n' % ct)
-                    if ('phase' in getattr(tr, 'names', ())
+                    trnames = getattr(tr, 'names', getattr(tr, '_names', ()))
+                    if ('phase' in trnames
                             or any(n.startswith('push-response')
-                                   for n in getattr(tr, 'names', ()))):
+                                   for n in trnames)):
                         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: