comparison mercurial/hg.py @ 21801:2ccd71bbd0f7

hg: update to use vfs functions in shared destination repository This patch uses destvfs with base as .hg directory in shared destination repository to update filesystem function with vfs. Some methods are changed to use vfs functions with destvfs. branch 'default' HG: bookmark '@' HG: changed mercurial/hg.py
author Chinmay Joshi <c@chinmayjoshi.com>
date Sat, 21 Jun 2014 14:37:39 +0530
parents 219af1521a6a
children ff27fad408c4
comparison
equal deleted inserted replaced
21800:219af1521a6a 21801:2ccd71bbd0f7
173 sharedpath = srcrepo.sharedpath # if our source is already sharing 173 sharedpath = srcrepo.sharedpath # if our source is already sharing
174 174
175 root = os.path.realpath(dest) 175 root = os.path.realpath(dest)
176 roothg = os.path.join(root, '.hg') 176 roothg = os.path.join(root, '.hg')
177 destwvfs = scmutil.vfs(dest, realpath=True) 177 destwvfs = scmutil.vfs(dest, realpath=True)
178 178 destvfs = scmutil.vfs(os.path.join(destwvfs.base, '.hg'), realpath=True)
179 if os.path.exists(roothg): 179
180 if destvfs.lexists():
180 raise util.Abort(_('destination already exists')) 181 raise util.Abort(_('destination already exists'))
181 182
182 if not destwvfs.isdir(): 183 if not destwvfs.isdir():
183 destwvfs.mkdir() 184 destwvfs.mkdir()
184 util.makedir(roothg, notindexed=True) 185 destvfs.makedir()
185 186
186 requirements = '' 187 requirements = ''
187 try: 188 try:
188 requirements = srcrepo.opener.read('requires') 189 requirements = srcrepo.opener.read('requires')
189 except IOError, inst: 190 except IOError, inst: