compat: make compatible call to ui.edit for hg <= 4.3 stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 02 Aug 2018 04:11:54 +0200
branchstable
changeset 3927 b4589df6d3aa
parent 3926 35172bd95e57
child 3928 a50b7e3d86c2
child 3931 b627e165ad20
compat: make compatible call to ui.edit for hg <= 4.3 This is similar to what is already happening elsewhere.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Thu Aug 02 03:08:52 2018 +0200
+++ b/hgext3rd/evolve/evolvecmd.py	Thu Aug 02 04:11:54 2018 +0200
@@ -707,7 +707,10 @@
                     " content-divergent changesets.\nHG: Resolve conflicts"
                     " in commit messages to continue.\n\n")
 
-        resolveddesc = ui.edit(prefixes + desc, ui.username(), action='desc')
+        if 5 <= len(ui.edit.im_func.func_defaults): # <= hg-4.3
+            resolveddesc = ui.edit(prefixes + desc, ui.username(), action='desc')
+        else:
+            resolveddesc = ui.edit(prefixes + desc, ui.username())
         # make sure we remove the prefixes part from final commit message
         if prefixes in resolveddesc:
             # hack, we should find something better