Created
September 18, 2013 20:29
-
-
Save jeansch/6615191 to your computer and use it in GitHub Desktop.
Display flattened mercurial history.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Display flattened mercurial history. | |
from mercurial import hg, ui | |
from datetime import datetime | |
uiface = ui.ui() | |
repo = hg.repository(uiface, '.') | |
ctxs = [] | |
for r in repo.changelog.revs(): | |
ctx = repo.changectx(r) | |
(d, unknown) = ctx.date() | |
ctxs.append((d, ctx)) | |
for d, ctx in sorted(ctxs, key=lambda _ctx: _ctx[0]): | |
desc = ctx.description().split('\n')[0] | |
print "T:%s C:%s B:%s: U:%s D:%s" % ( | |
datetime.fromtimestamp(d).ctime(), str(ctx), | |
ctx.branch(), ctx.user(), desc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment