243
243
return self.control_files.get_physical_lock_status()
246
def gather_stats(self, revid=None, committers=None):
247
"""Gather statistics from a revision id.
249
:param revid: The revision id to gather statistics from, if None, then
250
no revision specific statistics are gathered.
251
:param committers: Optional parameter controlling whether to grab
252
a count of committers from the revision specific statistics.
253
:return: A dictionary of statistics. Currently this contains:
254
committers: The number of committers if requested.
255
firstrev: A tuple with timestamp, timezone for the penultimate left
256
most ancestor of revid, if revid is not the NULL_REVISION.
257
latestrev: A tuple with timestamp, timezone for revid, if revid is
258
not the NULL_REVISION.
259
revisions: The total revision count in the repository.
260
size: An estimate disk size of the repository in bytes.
263
if revid and committers:
264
result['committers'] = 0
265
if revid and revid != _mod_revision.NULL_REVISION:
267
all_committers = set()
268
revisions = self.get_ancestry(revid)
269
# pop the leading None
271
first_revision = None
273
# ignore the revisions in the middle - just grab first and last
274
revisions = revisions[0], revisions[-1]
275
for revision in self.get_revisions(revisions):
276
if not first_revision:
277
first_revision = revision
279
all_committers.add(revision.committer)
280
last_revision = revision
282
result['committers'] = len(all_committers)
283
result['firstrev'] = (first_revision.timestamp,
284
first_revision.timezone)
285
result['latestrev'] = (last_revision.timestamp,
286
last_revision.timezone)
288
# now gather global repository information
289
if self.bzrdir.root_transport.listable():
290
c, t = self._revision_store.total_size(self.get_transaction())
291
result['revisions'] = c
246
296
def missing_revision_ids(self, other, revision_id=None):
247
297
"""Return the revision ids that other has that this does not.