[PATCH 3 of 4 v2-vfs] vfs: use repo.vfs.unlinkpath

Mads Kiilerich mads at kiilerich.com
Sat Mar 11 17:08:05 EST 2017


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1489258945 28800
#      Sat Mar 11 11:02:25 2017 -0800
# Node ID ccc0f541eec23587a03c980e001a7a7e760f6e05
# Parent  0f13797e5d6e08f75267b6e9c77a62d49fd0f69b
vfs: use repo.vfs.unlinkpath

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1099,7 +1099,7 @@ def storecollapsemsg(repo, collapsemsg):
 
 def clearcollapsemsg(repo):
     'Remove collapse message file'
-    util.unlinkpath(repo.join("last-message.txt"), ignoremissing=True)
+    repo.vfs.unlinkpath("last-message.txt", ignoremissing=True)
 
 def restorecollapsemsg(repo, isabort):
     'Restore previously stored collapse message'
@@ -1120,7 +1120,7 @@ def restorecollapsemsg(repo, isabort):
 def clearstatus(repo):
     'Remove the status files'
     _clearrebasesetvisibiliy(repo)
-    util.unlinkpath(repo.join("rebasestate"), ignoremissing=True)
+    repo.vfs.unlinkpath("rebasestate", ignoremissing=True)
 
 def needupdate(repo, state):
     '''check whether we should `update --clean` away from a merge, or if
diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -218,7 +218,7 @@ class shelvedstate(object):
 
     @classmethod
     def clear(cls, repo):
-        util.unlinkpath(repo.join(cls._filename), ignoremissing=True)
+        repo.vfs.unlinkpath(cls._filename, ignoremissing=True)
 
 def cleanupoldbackups(repo):
     vfs = vfsmod.vfs(repo.join(backupdir))
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2383,7 +2383,7 @@ def _dograft(ui, repo, *revs, **opts):
 
     # remove state when we complete successfully
     if not opts.get('dry_run'):
-        util.unlinkpath(repo.join('graftstate'), ignoremissing=True)
+        repo.vfs.unlinkpath('graftstate', ignoremissing=True)
 
     return 0
 
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -716,7 +716,7 @@ def update(repo, node, quietempty=False,
 def clean(repo, node, show_stats=True, quietempty=False):
     """forcibly switch the working directory to node, clobbering changes"""
     stats = updaterepo(repo, node, True)
-    util.unlinkpath(repo.join('graftstate'), ignoremissing=True)
+    repo.vfs.unlinkpath('graftstate', ignoremissing=True)
     if show_stats:
         _showstats(repo, stats, quietempty)
     return stats[3] > 0


More information about the Mercurial-devel mailing list