changeset 21800:219af1521a6a

hg: use vfs functions in destination repository with share In this patch, dstwvfs is added to use vfs functions in working directory of destination shared repository. Existing filesystem operations are updated to use vfs functions through dstwvfs.
author Chinmay Joshi <c@chinmayjoshi.com>
date Sat, 21 Jun 2014 14:29:20 +0530
parents dfacdd6a111e
children 2ccd71bbd0f7
files mercurial/hg.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Fri Jun 20 21:18:14 2014 +0530
+++ b/mercurial/hg.py	Sat Jun 21 14:29:20 2014 +0530
@@ -174,12 +174,13 @@
 
     root = os.path.realpath(dest)
     roothg = os.path.join(root, '.hg')
+    destwvfs = scmutil.vfs(dest, realpath=True)
 
     if os.path.exists(roothg):
         raise util.Abort(_('destination already exists'))
 
-    if not os.path.isdir(root):
-        os.mkdir(root)
+    if not destwvfs.isdir():
+        destwvfs.mkdir()
     util.makedir(roothg, notindexed=True)
 
     requirements = ''
@@ -193,7 +194,7 @@
     util.writefile(os.path.join(roothg, 'requires'), requirements)
     util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath)
 
-    r = repository(ui, root)
+    r = repository(ui, destwvfs.base)
 
     default = srcrepo.ui.config('paths', 'default')
     if default: