Page MenuHomePhabricator

Work around `hg` echoing warnings to stdout under --debug
ClosedPublic

Authored by epriestley on Dec 18 2013, 1:41 AM.
Tags
None
Referenced Files
F15536239: D7784.id17611.diff
Thu, Apr 24, 8:44 AM
F15536237: D7784.id17610.diff
Thu, Apr 24, 8:44 AM
F15536236: D7784.id.diff
Thu, Apr 24, 8:44 AM
F15536235: D7784.diff
Thu, Apr 24, 8:44 AM
F15483346: D7784.diff
Wed, Apr 9, 11:54 AM
F15470582: D7784.id17612.diff
Fri, Apr 4, 11:32 PM
F15464265: D7784.id17610.diff
Wed, Apr 2, 8:00 AM
F15463874: D7784.id.diff
Wed, Apr 2, 4:11 AM
Subscribers

Details

Summary

Ref T615. Ref T4237. With --debug, Mercurial will echo an "ignoring untrusted configuration option" warning to stdout if .hgrc has the wrong owner.

However, we need --debug to make {parents} usable, at least until the patches I got into the upstream are widely deployed. So after getting --debug output, strip off any leading warnings.

These warnings should always be in English, at least, since we set LANG explicitly.

Test Plan

Unit tests. @asherkin, maybe you can confirm this? I can't actually get the warning, but I think my hg in PATH is just a bit out of date.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Afraid this didn't work, although I think it did cut out one case (I only see 2 phantom commits, rather than the previous 4, but the branches box is still erroring).

Failed to parse 'hg branches' output: ignoring untrusted configuration option hooks.pretxnchangegroup.phabricator = '/var/www/phabricator/phabricator/bin/commit-hook' 'GW' 'pretxnchangegroup'
epriestley updated this revision to Unknown Object (????).Dec 18 2013, 1:59 AM
  • Be more aggressive about stripping these messages, as they can appear anywhere in output.

That did the job, thanks.