[PATCH 3 of 6 V2] hg: update to use vfs functions in shared destination repository

Chinmay Joshi c at chinmayjoshi.com
Sat Jun 21 05:27:50 CDT 2014


# HG changeset patch
# User Chinmay Joshi <c at chinmayjoshi.com>
# Date 1403341659 -19800
#      Sat Jun 21 14:37:39 2014 +0530
# Node ID 88dcd32c93da90ec779e94db41fc98c44ec21a23
# Parent  700a9738926672b55f9d9dcb4dd175f9a0edeb2b
hg: update to use vfs functions in shared destination repository

This patch uses destvfs with base as .hg directory in shared destination
repository to update filesystem function with vfs. Some methods are changed to
use vfs functions with destvfs.

branch 'default' HG: bookmark '@' HG: changed mercurial/hg.py

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -175,13 +175,14 @@
     root = os.path.realpath(dest)
     roothg = os.path.join(root, '.hg')
     destwvfs = scmutil.vfs(dest, realpath=True)
+    destvfs = scmutil.vfs(os.path.join(destwvfs.base, '.hg'), realpath=True)
 
-    if os.path.exists(roothg):
+    if destvfs.lexists():
         raise util.Abort(_('destination already exists'))
 
     if not destwvfs.isdir():
         destwvfs.mkdir()
-    util.makedir(roothg, notindexed=True)
+    destvfs.makedir()
 
     requirements = ''
     try:


More information about the Mercurial-devel mailing list