A local "hg clone" of an old repository in revlog format 0 fails with: Traceback (most recent call last): File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 134, in _runcatch return _dispatch(req) File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 806, in _dispatch cmdpats, cmdoptions) File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 586, in runcommand ret = _runcommand(ui, options, cmd, d) File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 897, in _runcommand return checkargs() File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 868, in checkargs return cmdfunc() File "/home/thomas/hg/repos/tah/mercurial/dispatch.py", line 803, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/home/thomas/hg/repos/tah/mercurial/util.py", line 511, in check return func(*args, **kwargs) File "/home/thomas/hg/repos/tah/mercurial/commands.py", line 1310, in clone branch=opts.get('branch')) File "/home/thomas/hg/repos/tah/mercurial/hg.py", line 337, in clone destlock = copystore(ui, srcrepo, destpath) File "/home/thomas/hg/repos/tah/mercurial/hg.py", line 217, in copystore destlock = lock.lock(dstvfs, dstbase + "/lock") File "/home/thomas/hg/repos/tah/mercurial/lock.py", line 41, in __init__ self.lock() File "/home/thomas/hg/repos/tah/mercurial/lock.py", line 59, in lock self.trylock() File "/home/thomas/hg/repos/tah/mercurial/lock.py", line 90, in trylock why.filename, self.desc) LockUnavailable: [Errno 13] Permission denied: '/lock' abort: could not lock /lock: Permission denied (traceback shown due to --traceback) hg clone --pull works. Bisect shows, that this was introduced in Mercurial 2.9: The first bad revision is: changeset: 20089:2d0ab571b822 user: FUJIWARA Katsunori <foozy@lares.dti.ne.jp> date: Tue Nov 12 16:23:52 2013 +0900 summary: hg: rewrite "copystore()" with vfs To reproduce: mkdir repo cd repo mkdir .hg echo foo > foo hg add foo hg ci -m foo hg clone -U . ../repo2
Added FUJIWARA Katsunori <foozy@lares.dti.ne.jp> to Cc: list.
Regression -> urgent!
Fixed by http://selenic.com/repo/hg/rev/dda11e799529 FUJIWARA Katsunori <foozy@lares.dti.ne.jp> hg: use "os.path.join()" to join path components which may be empty (issue4203) Changset 2d0ab571b822 rewriting "hg.copystore()" with vfs uses 'dstbase + "/lock"' instead of "os.path.join()", because target files given from "store.copyfiles()" already uses "/" as path separator But in the repository using revlog format 0, "dstbase" becomes empty ("data" directory is located under ".hg" directly), and 'dstbase + "/lock"' is treated as "/lock": in almost all cases, write access to "/lock" causes "permission denied". This patch uses "os.path.join()" to join path components which may be empty in "hg.copystore()". (please test the fix)
Thank you, works for me in 2.9.1+24-dd2e25e49862