compat: drop compatibility layer for 'tryimportone'
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 28 Feb 2017 14:27:08 +0100
changeset 1830 53aae4b4e791
parent 1829 6dd3bb408725
child 1831 0195dc7bdfa4
compat: drop compatibility layer for 'tryimportone' Return is now homogeneous for all the version we support.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Tue Feb 28 14:25:35 2017 +0100
+++ b/hgext3rd/evolve/__init__.py	Tue Feb 28 14:27:08 2017 +0100
@@ -1030,11 +1030,7 @@
 @eh.wrapfunction(mercurial.cmdutil, 'tryimportone')
 def tryimportone(orig, ui, repo, hunk, parents, opts, *args, **kwargs):
     extracted = patch.extract(ui, hunk)
-    if util.safehasattr(extracted, 'get'):
-        # mercurial 3.6 return a dictionary there
-        expected = extracted.get('nodeid')
-    else:
-        expected = extracted[5]
+    expected = extracted.get('nodeid')
     if expected is not None:
         expected = node.bin(expected)
     oldextract = patch.extract