# Nicolas Dumazet, 2010 # WTFPL from mercurial.store import decodefilename import os path = ".hg/store/data" filelist = [] for dirpath, dirnames, filenames in os.walk(path): rel = dirpath[len(path)+1:] # -2 is for the .i suffix filelist += [rel + decodefilename(f[:-2]) for f in filenames] print filelist