file log does not show merge revisions from another branch

Thomas De Schampheleire patrickdepinguin+mercurial at gmail.com
Tue Aug 26 09:15:34 UTC 2014


Hi Matt,

On Tue, Aug 26, 2014 at 7:59 AM, Matt Mackall <mpm at selenic.com> wrote:
> On Mon, 2014-08-25 at 12:08 +0200, Thomas De Schampheleire wrote:
>> Hi,
>>
>> When a file was created on a named branch, and then merged into the
>> default branch without further changes, my expectation is that 'hg log
>> file' would show both the creation commit as the merge revision that
>> introduced the file in the default branch.
>>
>> However, this is not the case.
>
> Indeed, your expectation is wrong! Mercurial does not consider that
> anything interesting happened in your merge. This is important, or
> merges in non-trivial projects might show thousands and thousands of
> "changes" where nothing interesting happened and make it impossible to
> spot the actual merged files.

Ok, understood.

>
>> Given the --debug log output,
>
> False, the (undocumented) debug output is misleading on merges because
> it's only a comparison with p1.
>
> If the question you're trying to answer is something like "when did file
> foo first appear on branch X", then you might find it much easier to use
> a revset:
>
> hg log -r "first(contains(foo) and branch(X))"

That revset is indeed giving me the desired output.

Thanks a lot for your clarification and suggestion.

Best regards,
Thomas



More information about the Mercurial mailing list