changeset 21802:ff27fad408c4

hg: update util.writefile method to use write with vfs in share This patch replaces util.writefile() to use destvfs.write().
author Chinmay Joshi <c@chinmayjoshi.com>
date Sat, 21 Jun 2014 14:40:29 +0530
parents 2ccd71bbd0f7
children 62cc4055c6c8
files mercurial/hg.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Sat Jun 21 14:37:39 2014 +0530
+++ b/mercurial/hg.py	Sat Jun 21 14:40:29 2014 +0530
@@ -172,8 +172,6 @@
 
     sharedpath = srcrepo.sharedpath # if our source is already sharing
 
-    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)
 
@@ -192,8 +190,8 @@
             raise
 
     requirements += 'shared\n'
-    util.writefile(os.path.join(roothg, 'requires'), requirements)
-    util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath)
+    destvfs.write('requires', requirements)
+    destvfs.write('sharedpath', sharedpath)
 
     r = repository(ui, destwvfs.base)