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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Mar 12 10:45:38 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at 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.

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


More information about the Mercurial-devel mailing list