Patchwork [04,of,20] hg-mod: directly use repo.vfs.join

login
register
mail settings
Submitter Pierre-Yves David
Date March 12, 2017, 2:45 p.m.
Message ID <aefb162f77e6434c3286.1489329938@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19149/
State Accepted
Headers show

Comments

Pierre-Yves David - March 12, 2017, 2:45 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1489020804 28800
#      Wed Mar 08 16:53:24 2017 -0800
# Node ID aefb162f77e6434c3286cde061f7aa9d39f06a84
# Parent  8ddcc8a2f6047565c2029c8f9fb6d3eac993c0ab
# EXP-Topic vfs.cleanup
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r aefb162f77e6
hg-mod: directly use repo.vfs.join

The 'repo.join' method is about to be deprecated.

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -559,7 +559,7 @@  def clone(ui, peeropts, source, dest=Non
 
             destlock = copystore(ui, srcrepo, destpath)
             # copy bookmarks over
-            srcbookmarks = srcrepo.join('bookmarks')
+            srcbookmarks = srcrepo.vfs.join('bookmarks')
             dstbookmarks = os.path.join(destpath, 'bookmarks')
             if os.path.exists(srcbookmarks):
                 util.copyfile(srcbookmarks, dstbookmarks)
@@ -567,7 +567,7 @@  def clone(ui, peeropts, source, dest=Non
             # Recomputing branch cache might be slow on big repos,
             # so just copy it
             def copybranchcache(fname):
-                srcbranchcache = srcrepo.join('cache/%s' % fname)
+                srcbranchcache = srcrepo.vfs.join('cache/%s' % fname)
                 dstbranchcache = os.path.join(dstcachedir, fname)
                 if os.path.exists(srcbranchcache):
                     if not os.path.exists(dstcachedir):
@@ -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)
+    util.unlinkpath(repo.vfs.join('graftstate'), ignoremissing=True)
     if show_stats:
         _showstats(repo, stats, quietempty)
     return stats[3] > 0