开发者

Mercurial: hg-checklinks- recursive symlink over NFS/SAMBA/SSHFS network drive

开发者 https://www.devze.com 2023-02-14 23:47 出处:网络
When I macfusion into my ubuntu VM, and hg clone something from bitbucket - and then try and do a commit / export / etc on it, I get a folder added with a name prefix of \'hg-checklinks-\'.

When I macfusion into my ubuntu VM, and hg clone something from bitbucket - and then try and do a commit / export / etc on it, I get a folder added with a name prefix of 'hg-checklinks-'.

On inspection it appears to house a never ending chain of symlinks back to its parent folder. This is driving me completely nuts, and so far, I've lost my faith in mercurial.

Mind you, seems to work fine when I just use it on a local folder. Does anyone have any idea how I can get around this.. or even more info as to w开发者_运维技巧hy it's happening?

Cheers!


The decentralized part of DVCS is about running it locally -- the only Mercurial operations that should be done on anything other than the local system are push, pull, and clone. If you're cloning from bitbucket onto your Ubuntu VM then you should clone from your Ubuntu VM onto your mac and push to the Ubuntu VM.

That said, it looks like your network FS isn't correctly deleting the file when it's told to. Here's the relevant code (found here: https://www.mercurial-scm.org/repo/hg/file/a2dc8819bb0d/mercurial/util.py#l710):

name = tempfile.mktemp(dir=path, prefix='hg-checklink-')
try:
    os.symlink(".", name)
    os.unlink(name)
    return True
except (OSError, AttributeError):
    return False

So either your network FS is creating the symlink but throwing an exception anyway or throwing an exception when asked to delete (unlink) the symlink.


The problem here is with sshfs's very special "-o follow_symlinks", which will happily create symlinks, then claim it couldn't create them, then show them as awesome recursive unremovable directories. This broken option may automatically be turned on by a bug in Macfusion (https://code.google.com/p/macfusion/issues/detail?id=284). So if anything, you should "lose faith" in sshfs and Macfusion, not Mercurial.

This will be worked around in Mercurial 2.7. In the meantime, you should be able to run sshfs manually without the option.

(For faster bug fixes, please report bugs to the Mercurial/sshfs/macfusion projects, not random internet question forums.)

0

精彩评论

暂无评论...
验证码 换一张
取 消