List of changed files during pull

Johannes Stezenbach js at linuxtv.org
Wed Apr 11 09:34:56 CDT 2007


On Wed, Apr 11, 2007 at 09:39:01AM -0400, Sean Dague wrote:
> On Wed, Apr 11, 2007 at 03:11:51PM +0200, Konrad Hinsen wrote:
> > I am looking for a way to obtain the list of all files that have been  
> > modified after doing "hg pull -u". Normally, Mercurial just tells me  
> > how many files were changed, but not which ones. Is there a simpler  
> > way than noting the tip changeset before the pull, pulling, and  
> > listing all the changesets that have been added one by one?
> 
> I've setup a hook to present a diffstat on all pulls.  This can be done
> by adding a line like:
> 
> [hooks]
> changegroup = /home/sdague/bin/pull-diffstat
> 
> 
> To your ~/.hgrc (affects all repos)
> 
> With pull-diffstat looking as follows:
> 
> #!/bin/sh
> test -n "$HG_NODE" || exit 0
> PARENT=`hg parents -r $HG_NODE | head -1 | awk -F':' '{print $3}'`
> TIP=`hg tip | head -1 | awk -F':' '{print $3}'`
> echo "diffstat for $PARENT to $TIP"
> hg diff -r $PARENT -r tip | diffstat
> 
> 
> I got this idea out of the hg wiki. :)  It works really nicely.

Your version is slightly buggy (hg parents vs. revision number - 1),
the one in the Wiki has been fixed:
http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks#head-dc8f821b7a888755f6157ac98552da6d94d529e3


HTH,
Johannes


More information about the Mercurial mailing list