简体   繁体   中英

hg clone aborts reporting that it can't find .hg/store/lock in the repository

I created a repository on a remote machine using:

    hg init

    hg add

    hg commit

The repository was created.

I cloned the repository on a local machine with no errors reported; The files seem to be there

Now I'm trying to make a clone of the clone (as a working copy) using:

    hg clone "path to original clone"

It returns:

destination directory: "name of repository"

abort: No such file or directory: "path to original clone"/.hg/store/lock

What am I doing wrong?

Thanks

What filesystem is used on the partition where the main repository is ?

Actually, when Mercurial is doing some operations, it needs to lock the repository. For doing this it creates a symbolic link to an nonexistent file, when the filesystem supports it, in the .hg repository, telling every other processes that the repository can't be modified at this time. When symbolic links aren't supported by the filesystem, a normal file is created.

However, there's some problems with some FUSE filesystems, typically SSHFS with the follow_symlinks option activated. FUSE reports that he knows about symbolic links, but since SSHFS follows the symbolic link and the file doesn't exist, the "state" of the link is marked as unknown thus Mercurial thinks the repository isn't correctly locked and abort the operation.

I see you're using Cygwin, so maybe it's the same kind of problem with tools designed for UNIX on a windows filesystem. It's a strange, coworkers of mine are using Mercurial via Cygwin just fine.

I don't know if it's the case for you, but I lost nearly half a day on this problem. Maybe this answers can help some people in the future.

Please paste in the actual command that's failing and the output including the actual path to the clone that you're cloning. When you do the clone use --debug and --traceback too.

As a workaround you can can always try hg init newclone followed by hg pull -R newclone pathtooriginalclone , which is effectively equivalent except it doesn't use local hardlinks when possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM