Getting changes between revisions from bzrlib (diff and log modules??)
James Westby
jw+debian at jameswestby.net
Mon Jun 25 23:54:02 BST 2007
On (23/06/07 17:11), Luís Soares wrote:
> Hello all,
>
> I know very little about bzrlib interfaces, but I need to use it to
> get some things done.
>
> I need help in this specific task: given a workingtree and a revno,
> fetch information about the next revisions in the revision history.
> For each revision I need the following information:
> * revno
> * committer
> * message
> * list of files modified, added, removed and renamed
>
A quick idea to get you started.
rh = tree.branch.revision_history()
rh.reverse()
interesting = []
for rev_id in rh:
if rev_id = desired_revid:
break
interesting.insert(0, rev_id)
for rev_id in interesting:
rev = tree.branch.repository.get_revision(rev_id)
print rev.message
print rev.committer
I would look at cmd_log in bzrlib/builtins.py and bzrlib/log.py for
better ways to do these things, as the above is far from optimal.
Thanks,
James
--
James Westby -- GPG Key ID: B577FE13 -- http://jameswestby.net/
seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256
More information about the bazaar
mailing list