Revsets, sub-directories and merge commits

Marc Strapetz marc.strapetz at syntevo.com
Fri Sep 25 10:25:42 UTC 2015


We are using revsets to create sub-directory logs using something like:

$ hg log -r "file('sub/**')"

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

Question in short: is there a way to receive the affecting merge commits 
as well?

Regarding the reasoning, consider following history:

@  11:e359b631ef407c8d86ad616ef7c503506ae9d1ef sub/a modified (8)
|
o    10:b20ccdbd5022700f8b4bbeb549629bf10d5529c9 merge b3
|\
| o    9:da6177f3d905a21bf5ef7283595572389a3a875e merge b3
| |\
| | o    8:668695645e3999e141d33be362788c6485914058 merge b2
| | |\
| | | o    7:7dec67c5c51f32341925c1f0171ea477d87a73a8 merge b1
| | | |\
| | | | o  6:57061ba10914eaa031d83f2d16533d63365a1f65 sub/a modified (7)
| | | | |
o-------+  5:bf5f8b0477fd68cd0d0e362f047625d0e7da23e8 sub/e modified (6)
  / / / /
o-----+  4:f8922ed98b17612ddd406e137ebc88822350f8db sub/d modified (5)
  / / /
o---+  3:a59066674768040bce7ba5d81e67374ca6e7481b sub/c modified (4)
  / /
o /  2:11ebd1b8ec4ac189bc9106bf3cfb2753e3459a17 sub/b modified (3)
|/
o  1:511efed0c19da223920c2f2a3bef95fc87f4bb98 sub/a modified (2)
|
o  0:b5c739d990694ac3d174b4ff02479befab80b379 sub/a modified (1)

Then, "hg log" won't report the merge commits:

$ hg log --template "{rev}:{node} {desc}\n" -r "file('sub/**')"
0:b5c739d990694ac3d174b4ff02479befab80b379 sub/a modified (1)
1:511efed0c19da223920c2f2a3bef95fc87f4bb98 sub/a modified (2)
2:11ebd1b8ec4ac189bc9106bf3cfb2753e3459a17 sub/b modified (3)
3:a59066674768040bce7ba5d81e67374ca6e7481b sub/c modified (4)
4:f8922ed98b17612ddd406e137ebc88822350f8db sub/d modified (5)
5:bf5f8b0477fd68cd0d0e362f047625d0e7da23e8 sub/e modified (6)
6:57061ba10914eaa031d83f2d16533d63365a1f65 sub/a modified (7)
11:e359b631ef407c8d86ad616ef7c503506ae9d1ef sub/a modified (8)

Hence the graph looks like:

@ 11:e359b631ef407c8d86ad616ef7c503506ae9d1ef sub/a modified (8)
|\
| \
| |\
| | \
| | |\
| | | \
| | | |\
| | | | o 6:57061ba10914eaa031d83f2d16533d63365a1f65 sub/a modified (7)
| | | | |
| | | o | 5:bf5f8b0477fd68cd0d0e362f047625d0e7da23e8 sub/e modified (6)
| | | |/
| | o / 4:f8922ed98b17612ddd406e137ebc88822350f8db sub/d modified (5)
| | |/
| o / 3:a59066674768040bce7ba5d81e67374ca6e7481b sub/c modified (4)
| |/
o / 2:11ebd1b8ec4ac189bc9106bf3cfb2753e3459a17 sub/b modified (3)
|/
o 1:511efed0c19da223920c2f2a3bef95fc87f4bb98 sub/a modified (2)
|
o 0:b5c739d990694ac3d174b4ff02479befab80b379 sub/a modified (1)

When having many branches, this quickly becomes unusable.

-Marc








More information about the Mercurial mailing list