Update templates used with mercurial to remove '--debug'


Update templates used with mercurial to remove '--debug'

Refer to discussion on D21677#275541

Refs D21681 (arcanist changes)

Phabricator has several uses of the --debug flag being used with Mercurial. Use of this flag causes additional output to be added which Phabricator needs, however the behavior of --debug is not guaranteed to be stable, and in newer versions of Mercurial there have been additional output that has caused Phabricator to choke on parsing the output. This change removes several uses of --debug in favor of using --template with the hg log or hg annotate commands in combination with the {p1.node} or {p2.node} template format.

The use of {p1node} format in templates was added in Mercurial 2.4 (2012). This format was deprecated in Mercurial 4.9 (2019) in favor of using {p1.node} format which is unclear when this new format was added (presumably earlier than Mercurial 4.9).

The use of --template with hg annotate is only officially supported in Mercurial 4.6 (2018), though does appear to work in 4.5 but is not documented.

Since the {p1node} format was introduced in 2.4 this bumps the required version of hg to 2.4 (from 1.9). Since the annotate --template feature wasn't added until 4.6 (which is still fairly recent), the use of it is gated on a capability test, but still preferred for use where possible to avoid extraneous output from --debug flag.

Test Plan:
I verified I could do the following in a mercurial repository, while having mercurial 5.8 installed:

  1. Navigate and view files in Diffusion under e.g. /source/test-repo/.
  2. While viewing a file in Diffusion verified that I could view the blame of the file and the history/annotations looked accurate for the files I was browsing.
  3. From the blame sidebar, select to view a commit which loaded and displayed changes properly.
  4. View the history of the repository under e.g. /source/test-repo/history/default/. I verified the history looked correct and the tree-like structure showing relationship of commits also looked accurate.

I setup mercurial to run version 4.4, created a new repository, added some commits, and verified all the above behavior still works properly.

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D21679


cspeckmimAuthored on Jul 7 2021, 12:58 AM
cspeckmimPushed on Jul 9 2021, 4:35 PM
Blessed Reviewers
Differential Revision
D21679: Update templates used with mercurial to remove '--debug'
rP5521f76fe406: Remove some "Phacility" and "epriestley" references
Build Status
Buildable 25428
Build 35126: Run Core Tests