Named Branches Lost on hg convert.

Tom Udale tom at ionoptix.com
Fri Sep 9 12:10:58 UTC 2011


Dear Tom,

For what it is worth, I have created a version of hg convert that takes 
a --rev-all-branches REV option.  This basically will convert _all 
revisions_ up to REV, not just those on the same branch as REV.

If you subsequently sort by sourcesort, your truncated repository will 
look exactly the same as the original up to REV.

It barfs if you specify both --rev and --rev-all-branches.

Internally I am passing a "get_opts" parameter into 
converter_source::getheads that indicates whether to do the "get all" or 
regular "get".  I of course only use that parameter in 
mercurial_source::get_heads, but I propagated it to all the other source 
converters should anyone want (and be able) to implement similar 
behavior in other sources.

This is all available at

https://bitbucket.org/TomUdale/myhg/

along with my earlier additions to the eol extension.

Thanks for all your help.

All the best,

Tom




> On 06/09/2011 19:45, Tom Udale wrote:
>
>>
>> Am I correct that it will change the commit order of things (while
>> presumably maintaining a correct result). That is if I start with this:
>>
>> | 9
>> 8 |
>> | \|
>> 7 |
>> | 6
>> 5 |
>> | |
>> 4 |
>> | 3
>> | /
>> |/
>> 2
>> |
>> 1
>> |
>> 0
>>
>> I could end up with this:
>>
>>
>> | 9
>> 8 |
>> | \|
>> | 7
>> | |
>> | 6
>> 5 |
>> | |
>> 4 |
>> | |
>> 3 /
>> |/
>> 2
>> |
>> 1
>> |
>> 0
>
> I don't think the order is a problem. You can rejig whatever ordering
> your conversion gives at the end with another hg convert of the whole
> repo with the appropriate 'sort'. You should perhaps do that with the
> default branch-sort, otherwise the final repo will be unnecessarily
> large... Revision numbers are an archaic concept in the new DVCS world
> in any case, and don't even always agree between clones of a repo. Stick
> with revision IDs and tags to avoid problems.
>
> Kind regards,
>
> Tom


-- 
Tom Udale
--------------------------
IonOptix LLC
309 Hillside St.
Milton, MA 02186
(617) 696-7335
--------------------------
tom at ionoptix.com



More information about the Mercurial mailing list