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

James Henstridge james at jamesh.id.au
Fri Sep 1 11:49:02 BST 2006


On 01/09/06, Martin Pool <mbp at canonical.com> 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.)

Okay, I chose the name to match "pending-merges", but I see those APIs
seem to be wrappers around set/get_parent_ids() now.  So do you think
get_revprops(), set_revprops() and add_revprop() would be better
names?

James.




More information about the bazaar mailing list