mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
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.
This commit is contained in:
parent
0db86c64a5
commit
e649f751d8
@ -174,12 +174,13 @@ def share(ui, source, dest=None, update=True):
|
||||
|
||||
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 @@ def share(ui, source, dest=None, update=True):
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user