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:
commit
e367bfd804
3 changed files with 19 additions and 0 deletions
|
@ -605,6 +605,13 @@ return array(
|
||||||
// interact with the revisions.
|
// interact with the revisions.
|
||||||
'differential.anonymous-access' => false,
|
'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 ------------------------------------------------------------- //
|
// -- Maniphest ------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|
|
@ -508,6 +508,17 @@ class DifferentialChangesetParser {
|
||||||
|
|
||||||
$generated_guess = (strpos($new_corpus_block, '@'.'generated') !== false);
|
$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(
|
$event = new PhabricatorEvent(
|
||||||
PhabricatorEventType::TYPE_DIFFERENTIAL_WILLMARKGENERATED,
|
PhabricatorEventType::TYPE_DIFFERENTIAL_WILLMARKGENERATED,
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -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/files/storage/file');
|
||||||
phutil_require_module('phabricator', 'applications/markup/syntax');
|
phutil_require_module('phabricator', 'applications/markup/syntax');
|
||||||
phutil_require_module('phabricator', 'infrastructure/diff/engine');
|
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/constant/type');
|
||||||
phutil_require_module('phabricator', 'infrastructure/events/event');
|
phutil_require_module('phabricator', 'infrastructure/events/event');
|
||||||
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
|
phutil_require_module('phabricator', 'infrastructure/javelin/markup');
|
||||||
|
|
Loading…
Reference in a new issue