Creating a bundle with bookmarks and obsolete-markers from Python-code

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Feb 22 09:57:20 UTC 2016



On 02/22/2016 12:59 AM, Arne Babenhauserheide wrote:
> Hi,
>
> Pierre-Yves David writes:
>
>> On 02/21/2016 02:40 PM, Arne Babenhauserheide wrote:
>>> How can I create a bundle-file with bookmarks and obsolete-markers from
>>> Python-code? I’m maintaining the Infocalypse extension¹ which uses
>>> bundles to exchange revisions. Its most important shortcoming is that it
>>> currently does not support bookmarks or obsolete markers.
>>>
>>> To change this without too extensive rewriting, I need to create
>>> bundle-files which contain information about bookmarks and
>>> obsolete-markers: If I give it to someone else, pulling from the bundle
>>> needs to yield the additional bookmarks and obsolete-markers.
>>
>> Adding obsolescence marker is easy. Bundle2 already support obsolescence
>> markers part, you can just add one with the content you need. I can help
>> you compute/know what are the marker you need to include in a bundle if
>> you tell me more about what you are doing.
>
> Thank you for your answer!
>
> What I need is essentially a minimal working example how to create a
> bundle2 with obsolete markers.

Sure, you can find some examples of that somewhere in mercurial/exchange.py

>> Bookmark is more stricky. We have a pushkey part for bundle2 but it is
>> "imperative" not "descriptive", Pushkey convey a movement from old
>> location A to new location B. So you can't store a bookmark "location",
>> juste a movement. Maybe it fits your need.
>
> Can I store bookmark creation? Something like move from null to B?

Yes. (You can find some examples of that somewhere in mercurial/exchange.py)

-- 
Pierre-Yves David



More information about the Mercurial mailing list