view python/repostats.py2 @ 120:bb08633510bf

Added repostat script
author Windel Bouwman
date Sat, 12 Jan 2013 10:56:12 +0100
parents
children 347d7d8b96c0
line wrap: on
line source

#!/usr/bin/python2

from mercurial import ui, hg
import datetime

u = ui.ui()
repo = hg.repository(u, '..')

stamps = []
nds = repo.changelog.nodesbetween()
print len(nds), nds
for hexid in nds[0]:
   cset = repo.changelog.read(hexid)
   print cset
   ts = cset[2][0]
   stamps.append(ts)

print len(stamps)
dts = [datetime.datetime.fromtimestamp(st) for st in stamps]
print dts