1. 15

  2. 3

    For those of us who don’t use Mercurial, was there anything in this release to be excited about? Any noteworthy changes?

    1. 7

      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.

      See this page for a more human-readable summary of what’s new: https://www.mercurial-scm.org/wiki/Release4.1

      1. 1

        Also also, this new zstd compression engine is not hardcoded in, but slotted in in a modular way. From your human-readable summary:

        A new extensible “compression engines” API has been implemented. Support for a new compression format can now be implemented in extensions.

        • New compression formats are fully supported in bundles and the wire protocol. There is experimental support for different compression in revlogs.
      2. 2

        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.

      3. 2

        + release tag