--- a/hgext3rd/evolve/__init__.py Sat Mar 07 02:03:28 2020 +0700
+++ b/hgext3rd/evolve/__init__.py Sat Mar 07 02:26:49 2020 +0700
@@ -276,7 +276,6 @@
lock as lockmod,
logcmdutil,
node,
- patch,
pycompat,
revset,
scmutil,
@@ -793,21 +792,8 @@
@eh.wrapfunction(mercurial.cmdutil, 'tryimportone')
def tryimportone(orig, ui, repo, hunk, parents, opts, *args, **kwargs):
expected = {b'node': None}
- if not util.safehasattr(hunk, 'get'): # hg < 4.6
- oldextract = patch.extract
-
- def extract(*args, **kwargs):
- ret = oldextract(*args, **kwargs)
- _getnodefrompatch(ret, expected)
- return ret
- try:
- patch.extract = extract
- ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
- finally:
- patch.extract = oldextract
- else:
- _getnodefrompatch(hunk, expected)
- ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
+ _getnodefrompatch(hunk, expected)
+ ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
created = ret[1]
if (opts[b'obsolete'] and None not in (created, expected[b'node'])
and created != expected[b'node']):