changeset 5188:43feb2380c05

evolve: drop pre 4.0 compat for dirstate.parentchange()
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 07 Mar 2020 23:16:31 +0700
parents 4230f046ddb9
children 26b47a967a1d
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 0 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Sat Mar 07 22:38:14 2020 +0700
+++ b/hgext3rd/evolve/__init__.py	Sat Mar 07 23:16:31 2020 +0700
@@ -269,7 +269,6 @@
     bookmarks as bookmarksmod,
     cmdutil,
     commands,
-    dirstate,
     error,
     help,
     hg,
@@ -358,29 +357,6 @@
 eh.configitem(b'experimental', b'evolution.allnewcommands', None)
 eh.configitem(b'experimental', b'prunestrip', False)
 
-# pre hg 4.0 compat
-
-if not util.safehasattr(dirstate.dirstate, 'parentchange'):
-    import contextlib
-
-    @contextlib.contextmanager
-    def parentchange(self):
-        '''Context manager for handling dirstate parents.
-
-        If an exception occurs in the scope of the context manager,
-        the incoherent dirstate won't be written when wlock is
-        released.
-        '''
-        self._parentwriters += 1
-        yield
-        # Typically we want the "undo" step of a context manager in a
-        # finally block so it happens even when an exception
-        # occurs. In this case, however, we only want to decrement
-        # parentwriters if the code in the with statement exits
-        # normally, so we don't have a try/finally here on purpose.
-        self._parentwriters -= 1
-    dirstate.dirstate.parentchange = parentchange
-
 #####################################################################
 ### Option configuration                                          ###
 #####################################################################