Sync subdirectory to public repo
Gregory Szorc
gregory.szorc at gmail.com
Fri Sep 11 03:36:53 UTC 2015
The "convert" extension can be used to convert one Mercurial repository to
another. You can configure it to only convert a sub-directory.
IIRC `hg convert` is one way only. Bi-directional sync is inherently hard
because there are race conditions between pushing to both repos. A proper
solution requires locking both repos when a push comes in. Things are much
easier if you limit yourself to writes from one repository and then
"transplant" commits from the writable repo to the mirror.
Someone from Facebook should chime in here: it is my understanding that
many of their GitHub projects are essentially sub-directories of their
internal monorepo. However, that's hg -> git and they may be using hg-git,
which is somewhat more powerful than "hg convert." I /think/ they employ a
non-traditional GitHub workflow and rebase GitHub pull requests on their
internal repo then mirror the linear history back out to GitHub. Again, I'm
not 100% on this.
On Thu, Sep 10, 2015 at 11:58 AM, Shawn Hoover <shawn.hoover at gmail.com>
wrote:
> Are there any accepted recipes for syncing a subdirectory of an internal
> repo to a separate repo? The internal repo subdirectory is the "master
> copy" of the project. Contributors can only see and push to the external
> one. Changes need to be synced both ways.
>
> I have been down the subrepo road and am trying to avoid it. ("Feature of
> last resort," right?)
>
> Some manual effort or scripting beyond push/pull/merge is ok as long as
> the procedure or tool reliably captures all the changesets going both ways.
> The two repos wouldn't have to share history in terms of revision hashes,
> they just need the same patches. I don't mind working with MQ, bookmarks,
> or named branches.
>
> Thoughts?
>
> Shawn
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> https://selenic.com/mailman/listinfo/mercurial
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20150910/eaf352fc/attachment-0002.html>
More information about the Mercurial
mailing list