Created
September 18, 2011 16:47
-
-
Save troter/1225257 to your computer and use it in GitHub Desktop.
mercurialの内部APIを利用してファイルのコンテンツをとる
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
import os | |
from mercurial import hg, ui | |
path = "/home/takumi/" | |
repo = hg.repository(ui.ui(), path) | |
ctx = repo['tip'] | |
#print ctx.filectx('.zshenv').data() | |
mf = ctx.manifest() | |
rootfiles = [] | |
for f, n in mf.iteritems(): | |
if os.path.dirname(f) == '': | |
rootfiles.append(f) | |
for f in rootfiles: | |
print f | |
print ctx.filectx(f).data() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment