--- a/hgext3rd/evolve/cmdrewrite.py Sat Mar 07 01:43:40 2020 +0700
+++ b/hgext3rd/evolve/cmdrewrite.py Sat Mar 07 02:03:28 2020 +0700
@@ -11,7 +11,6 @@
from __future__ import absolute_import
-import contextlib
import random
from mercurial import (
@@ -219,14 +218,7 @@
def _writepatch(ui, repo, old, fp):
"""utility function to use filestore and patchrepo to apply a patch to the
repository with metadata being extracted from the patch"""
- metadata = patch.extract(ui, fp)
- if util.safehasattr(metadata, 'get'): # < hg-4.6
- @contextlib.contextmanager
- def patchcontext():
- yield metadata
- patchcontext = patchcontext()
- else:
- patchcontext = metadata
+ patchcontext = patch.extract(ui, fp)
pold = old.p1()
with patchcontext as metadata: