Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 20091:abfe6a8e619b
lock: take both vfs and lock file path relative to vfs to access via vfs
This patch makes "lock.lock.__init__()" take both vfs and lock file
path relative to vfs, instead of absolute path to lock file.
This allows lock file to be accessed via vfs.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Tue, 12 Nov 2013 16:23:52 +0900 |
parents | 2d0ab571b822 |
children | 9e0219967e38 |
comparison
equal
deleted
inserted
replaced
20090:88d8e568add1 | 20091:abfe6a8e619b |
---|---|
211 if dstbase and not dstvfs.exists(dstbase): | 211 if dstbase and not dstvfs.exists(dstbase): |
212 dstvfs.mkdir(dstbase) | 212 dstvfs.mkdir(dstbase) |
213 if srcvfs.exists(f): | 213 if srcvfs.exists(f): |
214 if f.endswith('data'): | 214 if f.endswith('data'): |
215 # lock to avoid premature writing to the target | 215 # lock to avoid premature writing to the target |
216 destlock = lock.lock(dstvfs.join(dstbase + "/lock")) | 216 destlock = lock.lock(dstvfs, dstbase + "/lock") |
217 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), | 217 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), |
218 hardlink) | 218 hardlink) |
219 num += n | 219 num += n |
220 if hardlink: | 220 if hardlink: |
221 ui.debug("linked %d files\n" % num) | 221 ui.debug("linked %d files\n" % num) |