Differential D21677 Diff 51604 src/applications/diffusion/protocol/DiffusionMercurialCommandEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/protocol/DiffusionMercurialCommandEngine.php
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | final class DiffusionMercurialCommandEngine | ||||
* | * | ||||
* @param string Output from `hg --debug ...` | * @param string Output from `hg --debug ...` | ||||
* @return string Usable output. | * @return string Usable output. | ||||
*/ | */ | ||||
public static function filterMercurialDebugOutput($stdout) { | public static function filterMercurialDebugOutput($stdout) { | ||||
// When hg commands are run with `--debug` and some config file isn't | // When hg commands are run with `--debug` and some config file isn't | ||||
// trusted, Mercurial prints out a warning to stdout, twice, after Feb 2011. | // trusted, Mercurial prints out a warning to stdout, twice, after Feb 2011. | ||||
// | // | ||||
// http://selenic.com/pipermail/mercurial-devel/2011-February/028541.html | // http://selenic.com/pipermail/mercurial-devel/2011-February/028541.html | ||||
cspeckmim: I was going to update this to be the new URL
https://www.mercurial-scm.org/pipermail/mercurial… | |||||
// | // | ||||
// After Jan 2015, it may also fail to write to a revision branch cache. | // After Jan 2015, it may also fail to write to a revision branch cache. | ||||
// | // | ||||
// Separately, it may fail to write to a different branch cache, and may | // Separately, it may fail to write to a different branch cache, and may | ||||
// encounter issues reading the branch cache. | // encounter issues reading the branch cache. | ||||
// | |||||
// When Mercurial repositories are hosted on external systems with | |||||
// multi-user environments it's possible that the branch cache is computed | |||||
// on a revision which does not end up being published. When this happens it | |||||
// will recompute the cache but also print out "invalid branch cache". | |||||
// | |||||
// https://www.mercurial-scm.org/pipermail/mercurial/2014-June/047239.html | |||||
// | |||||
// When observing a repository which uses largefiles, the debug output may | |||||
// also contain extraneous output about largefile changes. | |||||
// | |||||
// At some point Mercurial added/improved support for pager used when | |||||
// command output is large. It includes printing out debug information that | |||||
// the pager is being started for a command. This seems to happen despite | |||||
// the output of the command being piped/read from another process. | |||||
// | |||||
// When printing color output Mercurial may run into some issue with the | |||||
// terminal info. This should never happen in Phabricator since color | |||||
// output should be turned off, however in the event it shows up we should | |||||
// filter it out anyways. | |||||
$ignore = array( | $ignore = array( | ||||
'ignoring untrusted configuration option', | 'ignoring untrusted configuration option', | ||||
"couldn't write revision branch cache:", | "couldn't write revision branch cache:", | ||||
"couldn't write branch cache:", | "couldn't write branch cache:", | ||||
'invalid branchheads cache', | 'invalid branchheads cache', | ||||
'invalid branch cache', | |||||
Done Inline ActionsJust in case, I'm going to make a quick update so remove the (served) part of this since it looks like it might print something different for hosted repositories (though for a hosted repo it's unlikely to ever get into this state to begin with). cspeckmim: Just in case, I'm going to make a quick update so remove the ` (served)` part of this since it… | |||||
'updated patterns: .hglf', | |||||
'starting pager for command', | |||||
'no terminfo entry for', | |||||
); | ); | ||||
foreach ($ignore as $key => $pattern) { | foreach ($ignore as $key => $pattern) { | ||||
$ignore[$key] = preg_quote($pattern, '/'); | $ignore[$key] = preg_quote($pattern, '/'); | ||||
} | } | ||||
$ignore = '('.implode('|', $ignore).')'; | $ignore = '('.implode('|', $ignore).')'; | ||||
Show All 11 Lines |
I was going to update this to be the new URL
https://www.mercurial-scm.org/pipermail/mercurial-devel/2011-February/028541.html
However using that URL results in a line that is >80 characters long. What format should be used in a situation where it doesn't make sense to split onto multiple lines? Keep the protocol/domain on one line and the path on another (in this case path is <80 chars)?