.hgcheck symlinks & dropbox
Dr. Hegewald
hegewald at irmb.tu-bs.de
Thu Jan 3 08:48:36 UTC 2013
On 03.01.2013, at 02:25, Mads Kiilerich <mads at kiilerich.com> wrote:
> Dr. Hegewald wrote, On 01/02/2013 05:44 PM:
>> Hi all,
>> I share several development directories via dropbox. Most of them contain mercurial repositories. Everything went good so far.
>
> What platform and what Mercurial version are you using?
I am at Mac OS 10.8.2, all involved machines. All but one machine use mercurial version 2.4+20121101, one machine is at version 2.2.
>
> And you are using some kind of mounted virtual dropbox filesystem? Not just a local filesystem where dropbox is reading and writing?
This is just a local file system, hfs+, case insensitive.
>
>> Now I got an error when doing hg up:
>> abort: could not symlink to '.': File exists: foobar/.hgcheck/hg-checklink-hk9Io6
>
> Is that the exact error message?
More or less, I replaced the beginning of the path with foobar. Mercurial wants to symlink hg-checklink-hk9Io6 to its directory (i.e. hg-checklink-hk9Io6@ -> .).
>
>> Mercurial seems to expext the file to be a symlink. It is a symlink on another machine, from which Dropbox "synced" it and copied the target instead of the symlink. Now it is a directory and hg fails with the above error.
>
> What do 'it' refer to? Do you have a file called 'foobar/.hgcheck/hg-checklink-hk9Io6' in your dropbox and in the Mercurial repository?
On one machine there is a symlink in '.hgcheck', which is called 'hg-checklink-hk9Io6' and points to '.'
On the other machines Dropbox created a directory 'hg-checklink-hk9Io6' instead of the symlink.
>
>> So now I have these questions:
>> - can I namually remove the contents of .hgcheck ?
>
> Mercurial do not use '.hgcheck'.
Ah, good tip. The .hg prefix probably led me in the wrong direction. So I guess it is from some GUI tool, maybe SourceTree.
>
> Mercurial will try to create a 'hg-checklink-??????' symlink in the working directory to find out whether the filesystem support symlinks or not.
OK, so the file *is* created by mercurial`.
>
>> - is it a bad idea to sync mercurial repos via dropbox?
>
> Yes. Apparently.
>
> Mercurial is a version control system and expects fully reliable posix semantics from the file system. There shouldn't be any need for anything clever below it ... and it will probably cause trouble. But someone will probably report that it works just fine for him.
It is working fine for me for more than a year now. But because Dropbox interferes with the mercurial repo structure, it does not seem to be the best idea (-:
>
>> - what other symlinks are created by mercurial?
>
> Locks and whatever symlinks has been committed in the repo.
If I commit a symlink, it will be stored as a symlink in .hg/ ? This would mean to quickly try to move all mercurial repos out of my Dropbox folder.
Mads, many thanks for this detailed help.
Cheers,
-- Jan
More information about the Mercurial
mailing list