OrderedDict data structure in bzrlib?
Kirill Müller
mail at kirill-mueller.de
Tue Sep 20 06:58:02 UTC 2011
On 19.09.2011 23:34, Jelmer Vernooij wrote:
> On Mon 19 Sep 2011 11:28:36 PM CEST, Kirill Müller wrote:
>> I am planning to add a histedit command to the rewrite plugin [1],
>> and a data structure like collections.OrderedDict [2] would help a
>> lot. Unfortunately, OrderedDict is new in Python 2.7. Is there a
>> similar data structure, compatible with all supported versions of
>> Python, already available in bzrlib?
>>
>> I'd appreciate any feedback.
> I'm pretty sure we don't have anything like that in bzrlib at the
> moment. What in particular do you need the OrderedDict for? Perhaps
> there are alternatives.
In bzr-rewrite, the rebase-plan is unmarshalled into a dictionary,
destroying the order. Later, it is reordered by topologically sorting
the revisions. For rearranging commits in the "histedit" use case, the
ordering from the rebase-plan must be maintained during unmarshalling;
using OrderedDict instead of dict worked for me right away.
Regards
Kirill
More information about the bazaar
mailing list