changeset 3226:5dfe4e5cf9e4 stable

topic: use more protective code to access publishing code There are some code path where the operation is not properly initialized and lack the new attributes. While the lack of initialization, is suspicious and I've not be able to pin point case where this happens. Currently the code crash when it encounter this situation. So we make the code more resistant to this case to prevent bad user experience.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Dec 2017 13:21:57 +0100
parents df8d535216af
children 873d2f1949e1
files hgext3rd/topic/flow.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/flow.py	Thu Nov 30 21:31:14 2017 -0800
+++ b/hgext3rd/topic/flow.py	Tue Dec 05 13:21:57 2017 +0100
@@ -48,7 +48,7 @@
 
 def wrapphasediscovery(orig, pushop):
     orig(pushop)
-    if pushop.publish:
+    if getattr(pushop, 'publish', False):
         if not util.safehasattr(pushop, 'remotephases'):
             msg = _('--publish flag only supported from Mercurial 4.4 and higher')
             raise error.Abort(msg)