[PATCH] bzrlib API to add pending revision properties to a working tree

Robert Collins robertc at robertcollins.net
Fri Sep 1 22:33:15 BST 2006


On Fri, 2006-09-01 at 20:37 +1000, Martin Pool wrote:
> On  1 Sep 2006, James Henstridge <james at jamesh.id.au> wrote:
> > Revision properties are a useful way to add metadata to a commit, but
> > the current interface is not that nice for plugins.
> > 
> > If I want to set a revision property, I need to provide my own version
> > of "bzr commit" to the user that passes the revprops argument to
> > WorkingTree.commit().  It would be nice if I could just set a flag
> > telling the next commit() call to apply the given revision property.
> > This would allow a workflow like:
> > 
> >    # do some work
> >    bzr some_command_that_sets_a_revprop
> >    # dp some more work
> >    bzr commit -m 'log message'
> > 
> > The attached bundle provides a WorkingTree API to make this possible,
> > adding three methods:
> > * get_pending_revprops() - returns a dictionary of pending revprops
> > * set_pending_revprops(revprops) - set the pending revprops dict
> > (replacing any previous pending revprops).
> > * add_pending_revprop(name, value) - add an individual pending revprop
> 
> +1 on the facility.
> 
> I don't think they should be called 'pending'.  From the PoV of the
> working tree, they're just *the* revprops.  (Everything about the
> working tree is in this sense pending.)

Agreed with the aspect that they are not pending - they are changing the
current trees properties.

I have one concern though - do we need a facility, like commit has, to
not permit some actions when there are set peroprties ? [commit will
bork if there are >1 parents and its doing a partial commit] - I wonder
if property setters will do things that have similar constrictions, and
if so, we should be ensuring they get hooked in rather than passively
setting data.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060902/1d680a50/attachment.pgp 


More information about the bazaar mailing list