# HG changeset patch # User Anton Shestakov # Date 1583521408 -25200 # Node ID c111d5db3713830191da1a49dc07bad90d048adb # Parent 2ccd7c97ed59aebef07f088d6adf425c2e076403 evolve: drop 4.5 compatibility with `patch.extract` API diff -r 2ccd7c97ed59 -r c111d5db3713 hgext3rd/evolve/cmdrewrite.py --- 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: