Revsets, sub-directories and merge commits

Marc Strapetz marc.strapetz at syntevo.com
Wed Sep 30 08:16:58 UTC 2015


On 29.09.2015 21:29, Matt Mackall wrote:
> On Tue, 2015-09-29 at 21:21 +0200, Marc Strapetz wrote:
>> On 28.09.2015 17:11, Matt Mackall wrote:
>>> 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
>>
>> Yes, this one is also missing merge commits.
>>
>>>> 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/".
>>
>> Unfortunately, this doesn't work for me. Even:
>>
>> $ hg log -r "contains('sub/**')"
>
> "set:"

Thanks, Matt. This works great now!

-Marc




More information about the Mercurial mailing list