Mercurial > evolve
changeset 6202:fe8e88ea296d
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.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sun, 13 Mar 2022 18:21:57 +0300 |
parents | d18e16b9b793 |
children | fbbf69c71aa4 |
files | hgext3rd/evolve/__init__.py hgext3rd/evolve/state.py |
diffstat | 2 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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"""