1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00

Merge pull request #88 from dingram/mark-paths-generated

Add support for marking files as "generated" by regexp against path
This commit is contained in:
Evan Priestley 2012-01-19 10:36:50 -08:00
commit e367bfd804
3 changed files with 19 additions and 0 deletions

View file

@ -605,6 +605,13 @@ return array(
// interact with the revisions.
'differential.anonymous-access' => false,
// List of file regexps that should be treated as if they are generated by
// an automatic process, and thus get hidden by default in differential
'differential.generated-paths' => array(
// '/config\.h$/',
// '#/autobuilt/#',
),
// -- Maniphest ------------------------------------------------------------- //

View file

@ -508,6 +508,17 @@ class DifferentialChangesetParser {
$generated_guess = (strpos($new_corpus_block, '@'.'generated') !== false);
if (!$generated_guess) {
$config_key = 'differential.generated-paths';
$generated_path_regexps = PhabricatorEnv::getEnvConfig($config_key);
foreach ($generated_path_regexps as $regexp) {
if (preg_match($regexp, $this->changeset->getFilename())) {
$generated_guess = true;
break;
}
}
}
$event = new PhabricatorEvent(
PhabricatorEventType::TYPE_DIFFERENTIAL_WILLMARKGENERATED,
array(

View file

@ -15,6 +15,7 @@ phutil_require_module('phabricator', 'applications/differential/view/inlinecomme
phutil_require_module('phabricator', 'applications/files/storage/file');
phutil_require_module('phabricator', 'applications/markup/syntax');
phutil_require_module('phabricator', 'infrastructure/diff/engine');
phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phabricator', 'infrastructure/events/constant/type');
phutil_require_module('phabricator', 'infrastructure/events/event');
phutil_require_module('phabricator', 'infrastructure/javelin/markup');