[PATCH 4 of 6 V2] hg: update util.writefile method to use write with vfs in share

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


# HG changeset patch
# User Chinmay Joshi <c at chinmayjoshi.com>
# Date 1403341829 -19800
#      Sat Jun 21 14:40:29 2014 +0530
# Node ID 73889d047a12f25e906a4e3b4d69e81f786ec310
# Parent  88dcd32c93da90ec779e94db41fc98c44ec21a23
hg: update util.writefile method to use write with vfs in share

This patch replaces util.writefile() to use destvfs.write().

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -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)
 


More information about the Mercurial-devel mailing list