[PATCH] 'bzr meta' for adding meta information into the inventory

John A Meinel john at arbash-meinel.com
Fri Jun 10 06:57:59 BST 2005


Martin Pool wrote:
> On  9 Jun 2005, John A Meinel <john at arbash-meinel.com> wrote:
> 
> 
>>What about if each <inventory><entry> tag has an optional child named
>><meta>.
>>So that each InventoryEntry object has a meta property. This could
>>probably be a Meta object. I would generally say that bzr shouldn't care
>>what is in it, as long as it reproduces it accurately between revisions.
>>(Meaning Meta could just contain the text string, or a cElementTree
>>object, or whatever, just as long as it got properly serialized with the
>>to_element/from_element commands).
> 
> 
> Yes, I'd like something like that.  Perhaps something along the lines
> of subversion properties.  Although I do think svn over-uses them for
> example by storing ignore lists.
> 

As you wish. See attached patch which provides a "bzr meta" command.
This command lets you set/query for meta information contained about a file.
Meta information is just a set of key->value pairs stored as:

<entry blah blah blah><meta>
<property name="key">value</property>
</meta>
</entry>

Internally, Meta objects just contain a "properties" dictionary, keeping
track of all of the key->value pairs.
Because they are parsed into a dictionary, it is possible to identify if
one Meta object is equivalent to the another one. Which is all you
really need to have bzr commit/status/diff work.
I don't really know what to put into diff, so right now, I just put
## Meta-info modified

I suppose you could at least put the keys that were modified, or
possibly include the actual changes. But since 'value' can actually be
multi-line, or even binary data (though it probably needs to be base64
encoded first), I didn't really want to just print it to stdout.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: meta-data-in-inventory.patch
Type: text/x-patch
Size: 10735 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050610/9c27f97e/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050610/9c27f97e/attachment.pgp 


More information about the bazaar mailing list