effectflag: handle invalid data
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 19 May 2017 20:50:00 +0200
changeset 2455 d93a50a9abf5
parent 2454 400dbec0849c
child 2456 63be7982d593
effectflag: handle invalid data If we get a marker with an invalid input we should not crash the whole process.
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Fri May 19 20:49:20 2017 +0200
+++ b/hgext3rd/evolve/obshistory.py	Fri May 19 20:50:00 2017 +0200
@@ -340,9 +340,13 @@
              label="evolve.verb")
 
     effectflag = metadata.get('ef1')
+    if effectflag is not None:
+        try:
+            effectflag = int(effectflag)
+        except ValueError:
+            effectflag = None
     if effectflag:
         effect = []
-        effectflag = int(effectflag)
 
         if effectflag & DESCCHANGED:
             effect.append('description')