Bug 1890793: Assert CallArgs::newTarget is not gray. r=spidermonkey-reviewers,sfink...
[gecko.git] / third_party / python / python-hglib / examples / stats.py
blobf54a59236e13ebedf14f9ae6a681c95da19166de
1 # stats - get stats on the given repo
3 import sys
4 import hglib
6 # figure out what repo path to use
7 repo = '.'
8 if len(sys.argv) > 1:
9 repo = sys.argv[1]
11 # connect to hg
12 client = hglib.open(repo)
14 # gather some stats
15 revs = int(client.tip().rev)
16 files = len(list(client.manifest()))
17 heads = len(client.heads())
18 branches = len(client.branches())
19 tags = len(client.tags()) - 1 # don't count tip
21 authors = {}
22 for e in client.log():
23 authors[e.author] = True
25 merges = 0
26 for e in client.log(onlymerges=True):
27 merges += 1
29 print "%d revisions" % revs
30 print "%d merges" % merges
31 print "%d files" % files
32 print "%d heads" % heads
33 print "%d branches" % branches
34 print "%d tags" % tags
35 print "%d authors" % len(authors)