changeset 1830:53aae4b4e791

compat: drop compatibility layer for 'tryimportone' Return is now homogeneous for all the version we support.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 28 Feb 2017 14:27:08 +0100
parents 6dd3bb408725
children 0195dc7bdfa4
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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