changeset 120:bb08633510bf

Added repostat script
author Windel Bouwman
date Sat, 12 Jan 2013 10:56:12 +0100
parents f51791638cae
children 347d7d8b96c0
files python/repostats.py2
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/repostats.py2	Sat Jan 12 10:56:12 2013 +0100
@@ -0,0 +1,21 @@
+#!/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
+