243
243
return self.control_files.get_physical_lock_status()
246
def gather_stats(self, revid, committers=None):
247
"""Gather statistics from a revision id.
249
:param revid: The revision id to gather statistics from.
250
:param committers: Optional parameter controlling whether to grab
251
a count of committers.
252
:return: A dictionary of statistics. Currently this contains:
253
committers: The number of committers if requested.
254
firstrev: A tuple with timestamp, timezone for the penultimate left
255
most ancestor of revid, if revid is not the NULL_REVISION.
256
latestrev: A tuple with timestamp, timezone for revid, if revid is
257
not the NULL_REVISION.
261
result['committers'] = 0
262
if revid == _mod_revision.NULL_REVISION:
264
all_committers = set()
265
revisions = self.get_ancestry(revid)
266
# pop the leading None
268
first_revision = None
270
# ignore the revisions in the middle - just grab first and last
271
revisions = revisions[0], revisions[-1]
272
for revision in self.get_revisions(revisions):
273
if not first_revision:
274
first_revision = revision
276
all_committers.add(revision.committer)
277
last_revision = revision
279
result['committers'] = len(all_committers)
280
result['firstrev'] = first_revision.timestamp, first_revision.timezone
281
result['latestrev'] = last_revision.timestamp, last_revision.timezone
246
285
def missing_revision_ids(self, other, revision_id=None):
247
286
"""Return the revision ids that other has that this does not.