Revsets, sub-directories and merge commits

Matt Mackall mpm at selenic.com
Mon Sep 28 15:11:55 UTC 2015


On Fri, 2015-09-25 at 12:25 +0200, Marc Strapetz wrote:
> We are using revsets to create sub-directory logs using something like:
> 
> $ hg log -r "file('sub/**')"

FYI, that should be equivalent to:

$ hg log sub

> However this does not give me merge commits which are affecting 'sub'.

This is actually another variant of the classic "how do you diff a
merge" conundrum:

https://mercurial.selenic.com/wiki/MergeDiffs


However, there is a trick that might do what you want, depending on your
merge strategy:

$ hg log -r "file('sub/**') or (merge() and contains('set:modified() and
sub/**'))'

The second clause says: "also show me merges which contain any file that
is modified relative to the first parent in sub/".

It'll be somewhat slower and you might want to change "modified()" to
"(modified() or added() or removed())".

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial mailing list