Move hgfs update lock out of hg checkout

Newer hglib freaks out if files that don't belong in the repo are
present. This commit moves the update lock up a level into
$cachedir/hgfs.
This commit is contained in:
Erik Johnson 2015-02-21 23:40:43 -06:00 committed by C. R. Oldham
parent c83e558728
commit a2d78e57f7

View File

@ -308,7 +308,8 @@ def _clear_old_remotes():
except ValueError:
pass
remove_dirs = [os.path.join(bp_, rdir) for rdir in remove_dirs
if rdir not in ('hash', 'refs', 'envs.p', 'remote_map.txt')]
if rdir not in ('hash', 'refs', 'envs.p', 'remote_map.txt')
and not rdir.endswith('.update.lk')]
if remove_dirs:
for rdir in remove_dirs:
shutil.rmtree(rdir)
@ -376,7 +377,10 @@ def _update_lockfile(repo):
'''
Return the filename of the update lock
'''
return os.path.join(repo['repo'].root(), 'update.lk')
#return os.path.join(repo['repo'].root(), 'update.lk')
return os.path.join(__opts__['cachedir'],
'hgfs',
'{0}.update.lk'.format(repo['hash']))
def update():