hg: update util.writefile method to use write with vfs in share
authorChinmay Joshi <c@chinmayjoshi.com>
Sat, 21 Jun 2014 14:40:29 +0530
changeset 21802 ff27fad408c4
parent 21801 2ccd71bbd0f7
child 21803 62cc4055c6c8
hg: update util.writefile method to use write with vfs in share This patch replaces util.writefile() to use destvfs.write().
mercurial/hg.py
--- 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)