# HG changeset patch # User Anton Shestakov # Date 1647184917 -10800 # Node ID fe8e88ea296d8624d725fc2747b45f02bbb9400f # Parent d18e16b9b793ff69ef17b182de06ca7d83887a6e evolve: use util.unlinkpath() via vfs Internally vfs.unlinkpath() does the path join and calls util.unlinkpath(). So the new form is equivalent, just shorter. This method exists in 4.8, so the new code shouldn't have any compatibility issues. diff -r d18e16b9b793 -r fe8e88ea296d hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Mon Mar 14 16:46:38 2022 +0000 +++ b/hgext3rd/evolve/__init__.py Sun Mar 13 18:21:57 2022 +0300 @@ -1207,5 +1207,5 @@ @eh.wrapfunction(hg, 'clean') def clean(orig, repo, *args, **kwargs): ret = orig(repo, *args, **kwargs) - util.unlinkpath(repo.vfs.join(b'evolvestate'), ignoremissing=True) + repo.vfs.unlinkpath(b'evolvestate', ignoremissing=True) return ret diff -r d18e16b9b793 -r fe8e88ea296d hgext3rd/evolve/state.py --- a/hgext3rd/evolve/state.py Mon Mar 14 16:46:38 2022 +0000 +++ b/hgext3rd/evolve/state.py Sun Mar 13 18:21:57 2022 +0300 @@ -23,7 +23,6 @@ from mercurial import ( error, - util, ) from mercurial.i18n import _ @@ -93,7 +92,7 @@ def delete(self): """drop the evolvestate file if exists""" - util.unlinkpath(self._repo.vfs.join(self.path), ignoremissing=True) + self._repo.vfs.unlinkpath(self.path, ignoremissing=True) def exists(self): """check whether the evolvestate file exists or not"""