Patchwork [3,of,4] vfs: use repo.vfs.unlinkpath

login
register
mail settings
Submitter Mads Kiilerich
Date March 11, 2017, 7:07 p.m.
Message ID <6a4b43aac8e015396498.1489259277@localhost.localdomain>
Download mbox | patch
Permalink /patch/19101/
State Superseded
Headers show

Comments

Mads Kiilerich - March 11, 2017, 7:07 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1489258945 28800
#      Sat Mar 11 11:02:25 2017 -0800
# Node ID 6a4b43aac8e015396498a35e332b1b7ada475fca
# Parent  16a3f9ec44d37ae07adf9b8bf25a843ce33ba002
vfs: use repo.vfs.unlinkpath

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1062,7 +1062,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):
     'Restore previously stored collapse message'
@@ -1104,7 +1104,7 @@  def storestatus(repo, originalwd, target
 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
@@ -217,7 +217,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 = scmutil.vfs(repo.join(backupdir))
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2381,7 +2381,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
@@ -715,7 +715,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