discovering changesets affecting files only under a certain path in a repo

Matt Mackall mpm at selenic.com
Fri Jun 10 15:50:56 CDT 2011


On Fri, 2011-06-10 at 08:11 -0700, Nikita Kalashnikov wrote:
> In SVN it is possible to get the latest revision (and revision history)
> under a specific path, vs for the entire repo. If I get SVN info for a
> directory, the revision that will be returned in that info will be the
> latest check in that affected any file under that directory. Is this
> possible in Mercurial without basically looping through all the changesets
> and checking if any of the changed files fall under a certain path?

The simplest thing is:

hg log -l1 dir/  # show the most recent commit touching a file in dir/

But we've actually got an entire query language you can use if you want
to do something fancier:

hg log -r 'limit(reverse(ancestors(.) and file("tests/*")), 1)'

See 'hg help revsets' for more info.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial mailing list