Get revisions affecting a file?
Michael Gliwinski
Michael.Gliwinski at henderson-group.com
Tue Dec 1 16:33:35 GMT 2009
Hello All,
I've tried a couple of approaches and searched around for some info but didn't
find anything relevant.
Basically what I'm trying to do is to get dates of most recent revision where
a specific file/set of files were changed (added/modified). Is there an easy
way to do this using bzrlib?
My most recent attempt was to use the bzrlib.log.Logger, sth like:
from bzrlib.workingtree import WorkingTree
from bzrlib.log import Logger, make_log_request_dict
from bzrlib.tests.test_log import LogCatcher
wt = WorkingTree.open_containing('.')[0]
wt.lock_read()
try:
for filename in some_set_of_files:
lc = LogCatcher()
Logger(wt.branch, make_log_request_dict(
specific_fileids=wt.path2id(filename),
limit=1,
)).show(lc)
...
and then accessing `lc.revisions[0].rev.timestamp` for each file. However
that does not seem to work (lc.revisions is empty). (It was also very slow,
especially in loops like `for revs in log_rev_iterator` in bzrlib.log, which
made me think that maybe it's not the right approach)
Is there a better/any way to do this?
--
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319
**********************************************************************************************
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract.
If you have received this email in error please notify support at henderson-group.com
John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
*********************************************************************************
More information about the bazaar
mailing list