topic: add a compatibility to access transaction's names stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 21 Sep 2018 19:49:28 +0200
branchstable
changeset 4124 23658110ab26
parent 4123 119fced5a891
child 4125 865c33c16508
topic: add a compatibility to access transaction's names The attribute was made private in 4024c363cd33.
hgext3rd/topic/__init__.py
--- 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: