annotate python/repostats.py2 @ 120:bb08633510bf

Added repostat script
author Windel Bouwman
date Sat, 12 Jan 2013 10:56:12 +0100
parents
children 347d7d8b96c0
rev   line source
120
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
1 #!/usr/bin/python2
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
2
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
3 from mercurial import ui, hg
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
4 import datetime
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
5
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
6 u = ui.ui()
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
7 repo = hg.repository(u, '..')
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
8
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
9 stamps = []
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
10 nds = repo.changelog.nodesbetween()
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
11 print len(nds), nds
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
12 for hexid in nds[0]:
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
13 cset = repo.changelog.read(hexid)
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
14 print cset
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
15 ts = cset[2][0]
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
16 stamps.append(ts)
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
17
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
18 print len(stamps)
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
19 dts = [datetime.datetime.fromtimestamp(st) for st in stamps]
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
20 print dts
bb08633510bf Added repostat script
Windel Bouwman
parents:
diff changeset
21