From patchwork Mon Jun 16 16:39:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,6] hg: use vfs functions in destination repository with share From: Chinmay Joshi X-Patchwork-Id: 5006 Message-Id: To: mercurial-devel@selenic.com Date: Mon, 16 Jun 2014 22:09:42 +0530 # HG changeset patch # User Chinmay Joshi # Date 1402931477 -19800 # Mon Jun 16 20:41:17 2014 +0530 # Node ID b230c9509c488d0d2ef0bf9e3375b2ad376153fd # Parent 986e8fb82923f864c10bfb5a97d0594e83722b9c hg: use vfs functions in destination repository with share In this patch, dstvfs is added to use vfs functions in working directory of destination shared repository. Existing filesystem operations are updated to use vfs functions through dstvfs. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -172,14 +172,14 @@ sharedpath = srcrepo.sharedpath # if our source is already sharing - root = os.path.realpath(dest) + dstvfs = scmutil.vfs(dest, expandpath=True, realpath=True) roothg = os.path.join(root, '.hg') if os.path.exists(roothg): raise util.Abort(_('destination already exists')) - if not os.path.isdir(root): - os.mkdir(root) + if not dstvfs.isdir(): + dstvfs.mkdir() util.makedir(roothg, notindexed=True) requirements = ''