Determining what files were touched in a changeset algorithmically

paul_nathan at selinc.com paul_nathan at selinc.com
Wed Jun 22 18:51:55 CDT 2011


Greetings,

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  
http://selenic.com/hg/file/8deebb577751/mercurial/templatekw.py) 
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")

- - -
Regards,
Paul Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20110622/8f90c784/attachment.htm>


More information about the Mercurial mailing list