Change location of .hg: mercurial equivalent of --separate-git-dir
Michael Forbes
michael.forbes+hg at gmail.com
Fri Oct 12 14:48:17 UTC 2018
On Oct 12, 2018, at 3:02 AM, Marcin Kasperski <Marcin.Kasperski at mekk.waw.pl> wrote:
>
>> My use case is allowing others to edit a working copy through Dropbox,
>> Google Drive, etc. and then periodically being able to compare the
>> state of that copy with my repository, optionally adding or committing
>> their changes.
>>
>> I don't want to store the .hg folder in the shared repo for risk of
>> data corruption (if people simultaneously commit in several places and
>> the drive share auto-manages conflicts IN the .hg repo).
>
> I'd consider solving it the other way:
>
> dropbox exclude add path/to/.hg
>
> (and .hg is not synced anymore, but the files are, you are free to
> commit as you like).
>
> I suppose gdrive has sth similar.
In principle, these options would work, but in practise they are very poorly implemented. For example, simply excluding the .hg from dropbox will delete it, and it cannot be excluded if it does not exist, so one needs to go through a convoluted procedure of adding a fake .hg directory, syncing that, excluding it, then moving the correct .hg file in place.
Also, the method differs for each type of remote share, and is extremely difficult to automate. I am looking for a universal solution which using an alternative location for the .hg directory would provide.
More information about the Mercurial
mailing list