compat: disable empty topic warning on `hg phases` for hg <=4.5 stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 02 Aug 2018 02:15:48 +0200
branchstable
changeset 3922 9839463088ac
parent 3921 28824ad64a12
child 3923 257481642686
child 3925 3c2a464ae6fc
compat: disable empty topic warning on `hg phases` for hg <=4.5 This is annoying to support for lower version.
hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py	Thu Aug 02 01:31:02 2018 +0200
+++ b/hgext3rd/topic/__init__.py	Thu Aug 02 02:15:48 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: