Discussion:
Change location of .hg: mercurial equivalent of --separate-git-dir
Michael Forbes
2018-10-12 03:19:37 UTC
Permalink
What is the mercurial equivalent of git's --separate-git-dir?

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 know I can use hg archive to update the shared working copy remotely from a repo, but don't know how to efficiently compare and commit changes made there.

Michael.
Marcin Kasperski
2018-10-12 10:02:20 UTC
Permalink
Post by Michael Forbes
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.
Michael Forbes
2018-10-12 14:48:17 UTC
Permalink
Post by Marcin Kasperski
Post by Michael Forbes
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).
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.
Nathan Goldbaum
2018-10-12 14:54:29 UTC
Permalink
I *think* you're looking for the share extension?

https://www.mercurial-scm.org/wiki/ShareExtension
On Oct 12, 2018, at 3:02 AM, Marcin Kasperski <
Post by Marcin Kasperski
Post by Michael Forbes
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).
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.
_______________________________________________
Mercurial mailing list
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Michael Forbes
2018-10-12 16:04:54 UTC
Permalink
Post by Nathan Goldbaum
I *think* you're looking for the share extension?
https://www.mercurial-scm.org/wiki/ShareExtension
Thanks! That looks like it might work nicely. Putting the shared repo I was worried that changes on dropbox might somehow affect the repo, but after playing with it a bit, it seems that only a few files are stored in the .hg repo in the shared copy (naming the current branch etc.) and if anyone tries to commit or something, it will fail unless the link in .hg/sharedpath points to an associated repo on their machine. (This is perhaps a little undesirable, but --separate-git-dir would have the same problem, and I doubt it would generally be a problem.)
Post by Nathan Goldbaum
Post by Marcin Kasperski
Post by Michael Forbes
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).
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.
_______________________________________________
Mercurial mailing list
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Loading...