evolvecmd: compatibility with older geteffectflag() that took a tuple
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 06 Mar 2019 21:47:08 +0800
changeset 4431 f109917f5c28
parent 4430 461b9a91b662
child 4432 5da1d162ad50
evolvecmd: compatibility with older geteffectflag() that took a tuple Before bae6f1418a95 the function took a tuple of 2 arguments instead of these 2 arguments directly.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Wed Mar 06 21:42:32 2019 +0800
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Mar 06 21:47:08 2019 +0800
@@ -670,7 +670,11 @@
         if saveeffectflag:
             # The effect flag is saved in a versioned field name for
             # future evolution
-            effectflag = obsutil.geteffectflag(prec, (succ,))
+            try:
+                effectflag = obsutil.geteffectflag(prec, (succ,))
+            except TypeError:
+                # hg <= 4.7
+                effectflag = obsutil.geteffectflag((prec, (succ,)))
             metadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag
 
         # create markers