Subtree clone in 2016

Augie Fackler raf at durin42.com
Wed Apr 20 13:11:17 UTC 2016


> On Apr 19, 2016, at 23:33, anatoly techtonik <techtonik at gmail.com> wrote:
> 
> On Mon, Apr 18, 2016 at 5:36 PM, Augie Fackler <raf at durin42.com> wrote:
>> 
>>> On Apr 15, 2016, at 16:09, anatoly techtonik <techtonik at gmail.com> wrote:
>>> 
>>> Hi,
>>> 
>>> I wonder if Mercurial got some modern way to
>>> get a clone of subtree since 2012?
>>> https://www.mercurial-scm.org/wiki/PartialClone
>> 
>> This is in progress at https://bitbucket.org/Google/narrowhg, but it's probably not ready enough that you should count on it being reliable.
> 
> Nice. And what is the criteria to know when it is ready?

Probably when we cut a release of it.

> 
>>> 
>>> I need to make a Python module from Roundup
>>> repository into a separate project, so I need to
>>> clone its subtree and push it somewhere else.
>> 
>> Ah, but you want to produce a new history of part of the repo and push it as its own repo somewhere? Then convert is your best bet, because you're making a new repo, not merely working locally on a partial checkout.
> 
> The workflow I want to achieve is that module is developed in Roundup
> repository, which is in Mercurial, in subtree roundup/web. But I also
> want to publish it independently and put on GitHub for more pull
> requests.

Ah, then narrowhg doesn't help you anyway.

> Putting on GitHub means it needs separate README.md and
> UNLICENSE file to be put in the root. I also need to be able to sync
> PRs back to Mercurial without those new README.md and UNLICENSE.
> Ideally all that mapping should be somehow available from repository,
> so that I continue working on the project from another machine without
> complicated setup.

This is pretty complicated. I don't know of any tools that'll do what you want (you want a bidirectionally synced bridge to take a subdirectory of an hg repo and make that the same as a git repo, robustly.)

> 
> -- 
> anatoly t.




More information about the Mercurial mailing list