Higher level methods in bzrlib for library users
Jelmer Vernooij
jelmer at samba.org
Fri Dec 3 01:22:50 GMT 2010
Hi Tim,
On Fri, 2010-12-03 at 10:04 +1300, Tim Penhey wrote:
> I brought this up with Martin Pool earlier this week I think, and I want to
> take the idea to the list before I take it any further.
>
> My situation is one where I use bzr as a python library through bzrlib, but
> I'm not a bazaar hacker, nor do I have a detailed in-depth understanding of
> the bazaar internals. I am a regular bzr user though and have been for over
> four years now.
>
> What I'm proposing is that we create a number of higher level methods in
> bzrlib for library users. There are other projects like bzr-xml, loggerhead,
> bzr-explorer, the QT and gtk bindings and I'm sure others that all implement
> very similar methods. We should normalise these, make them available as part
> of the library and have them tested and consistent.
Yeah, that makes a lot of sense.
Gary has started preparing the visual graph building code from qbzr for
inclusion in bzrlib, with the intent of having bzr-gtk (and perhaps
loggerhead?) use it as well.
https://code.launchpad.net/~garyvdm/bzr/loggraphviz/+merge/41146
(beware, page contains ASCII art).
There are a bunch of other things duplicated between bzr-gtk and qbzr
that can probably be shared. To mind comes the storage of commit
messages of uncommitted revisions so they can be suggested when the user
attempts to do a new commit. Another is per-file commit messages.
> I've found some sample code for some of these on the bazaar wiki, but there
> are others which I've not found. These methods are pretty trivial to write if
> you have the in-depth understanding of bzrlib that the core developers have,
> but not obvious to those that don't.
>
> In particular the methods that I'd like to see would be:
>
> * Getting the files that have changed in a given revision (or revision range)
Does Repository.get_revision_delta() perhaps do what you need?
> * Getting the diff for a particular revision (or revision range)
> * Getting the diff for a particular file in a particular revision
> * Getting the mainline revisions that had modified a particular file
I wonder where we should put these methods - Repository is already big
enough as is, but it does seem the most appropriate place for them.
> Martin suggested starting by filing bugs for each method I'd like to see in
> bzrlib and tag them with a special tag. This would allow us to track what is
> done, who is doing it, and also perhaps some low hanging fruit for those who
> know enough to write the methods that will help others.
Happy to help where I can. :-)
Cheers,
Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20101203/0222b66c/attachment.pgp
More information about the bazaar
mailing list