The coolest thing in this release is that mercurial now includes support for zstd compression instead of zlib compression. Since zstd is both faster than zlib and offers better compression ratios, this is a pure win for nearly all repos but especially very large repositories like mozilla-central.
What excites me most: the new revset: followlines(file, from:to, startrev=.) will give you all commits that changed the specified lines.
hg log -r 'followlines(myfile.txt, 10:20)'
git log -L 10:20:myfile.txt
hg log -r 'followlines(myfile.txt, 10:20, 847)'
# git: Not sure how to specify that you mean lines 10:20 as they were in commit 847
The main differences between -Lfrom,to:file and the followlines revset:
git log -L changes the behaviour of git log to always show show an excerpt of the unified diff – not sure if you can turn this off. Mercurial’s followlines is a pure revset: it only filters commits. The printing and display of the selected revisions is still controlled by the usual flags, like -p to show the patch (unified diff). Also, because followlines is a revset instead of a flag, it can be combined with other revsets in the usual ways. (Show only heads/merges/branchpoints, only ancestors of X, subtract ancestors of Y, etc).
git log -L changes the behaviour of git log’s diffs to only show the part pertaining to the lines in question – not sure how to ask it to show the entire commit. On the other hand, `hg log -p -r ‘followlines(…)’ will always show the complete diffs; you can limit which files it shows, but I think you can’t ask Mercurial to limit the diff to the followed lines.
git log -Lfrom,to:file vs git blame -Lfrom,to -- file feels like a papercut: yet another syntax inconsistency. On the other hand, Mercurial doesn’t support limiting blame to certain lines.
For those of us who don’t use Mercurial, was there anything in this release to be excited about? Any noteworthy changes?
The coolest thing in this release is that mercurial now includes support for
zstdcompression instead ofzlibcompression. Sincezstdis both faster thanzliband offers better compression ratios, this is a pure win for nearly all repos but especially very large repositories like mozilla-central.See this page for a more human-readable summary of what’s new: https://www.mercurial-scm.org/wiki/Release4.1
Also also, this new
zstdcompression engine is not hardcoded in, but slotted in in a modular way. From your human-readable summary:What excites me most: the new revset:
followlines(file, from:to, startrev=.)will give you all commits that changed the specified lines.The main differences between
-Lfrom,to:fileand thefollowlinesrevset:git log -Lchanges the behaviour ofgit logto always show show an excerpt of the unified diff – not sure if you can turn this off. Mercurial’sfollowlinesis a pure revset: it only filters commits. The printing and display of the selected revisions is still controlled by the usual flags, like-pto show the patch (unified diff). Also, becausefollowlinesis a revset instead of a flag, it can be combined with other revsets in the usual ways. (Show only heads/merges/branchpoints, only ancestors of X, subtract ancestors of Y, etc).git log -Lchanges the behaviour ofgit log’s diffs to only show the part pertaining to the lines in question – not sure how to ask it to show the entire commit. On the other hand, `hg log -p -r ‘followlines(…)’ will always show the complete diffs; you can limit which files it shows, but I think you can’t ask Mercurial to limit the diff to the followed lines.git log -Lfrom,to:filevsgit blame -Lfrom,to -- filefeels like a papercut: yet another syntax inconsistency. On the other hand, Mercurial doesn’t support limitingblameto certain lines.+ release tag