Determining what files were touched in a changeset algorithmically

paul_nathan at paul_nathan at
Wed Jun 22 18:51:55 CDT 2011


I am working on some analysis tools for hg logs.

hg log --template "{files}" is the naive way to do this. 

Demonstration of problem:

$ hg log -r 34 --template "{file_mods}\n"
baz baz baz foo bar spacey.txt

What files were modified? 

In order to determine this, I have to run manifest on 34 and perform some 
lexical analysis for all files in that changeset to determine which files 
actually got modified. 

Reviewing the hg source code, the rendering code (showlist function in 
performs a join with spaces here. This is... problematic for fast 
algorithmic determination.

I have thousands of changesets that need to be processed repeatedly and 
shelling out on each changeset is going to be slow. 

Is there a better way? I'd like to only shell out to hg once and get all 
the needed information.

(the file names were "baz baz baz" and "foo bar spacey.txt")

- - -
Paul Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Mercurial mailing list