1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Separate field for branch in revision

Summary:
The main purpose of this change is to allow selecting the branch by
triple-click.
Plus it is not perfectly clear that the text in brackets means branch.

Test Plan: Display revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1585
This commit is contained in:
vrana 2012-02-06 16:34:25 -08:00
parent e0c38b0644
commit 18ba5fa0ad
7 changed files with 64 additions and 10 deletions

View file

@ -597,9 +597,9 @@ return array(
'differential.field-selector' => 'DifferentialDefaultFieldSelector',
// Differential can show "Host" and "Path" fields on revisions, with
// information about the machine and working directory where the change
// came from. These fields are disabled by default because they may
// Differential can show "Host", "Path" and "Branch" fields on revisions, with
// information about the machine, working directory and branch where the
// change came from. These fields are disabled by default because they may
// occasionally have sensitive information; you can set this to true to
// enable them.
'differential.show-host-field' => false,

View file

@ -180,6 +180,7 @@ phutil_register_library_map(array(
'DifferentialAuthorFieldSpecification' => 'applications/differential/field/specification/author',
'DifferentialAuxiliaryField' => 'applications/differential/storage/auxiliaryfield',
'DifferentialBlameRevisionFieldSpecification' => 'applications/differential/field/specification/blamerev',
'DifferentialBranchFieldSpecification' => 'applications/differential/field/specification/branch',
'DifferentialCCWelcomeMail' => 'applications/differential/mail/ccwelcome',
'DifferentialCCsFieldSpecification' => 'applications/differential/field/specification/ccs',
'DifferentialChangeType' => 'applications/differential/constants/changetype',
@ -982,6 +983,7 @@ phutil_register_library_map(array(
'DifferentialAuthorFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialAuxiliaryField' => 'DifferentialDAO',
'DifferentialBlameRevisionFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialBranchFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialCCWelcomeMail' => 'DifferentialReviewRequestMail',
'DifferentialCCsFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialChangeset' => 'DifferentialDAO',

View file

@ -42,6 +42,7 @@ final class DifferentialDefaultFieldSelector
array(
new DifferentialHostFieldSpecification(),
new DifferentialPathFieldSpecification(),
new DifferentialBranchFieldSpecification(),
));
}

View file

@ -10,6 +10,7 @@ phutil_require_module('phabricator', 'applications/differential/field/selector/b
phutil_require_module('phabricator', 'applications/differential/field/specification/applypatch');
phutil_require_module('phabricator', 'applications/differential/field/specification/arcanistproject');
phutil_require_module('phabricator', 'applications/differential/field/specification/author');
phutil_require_module('phabricator', 'applications/differential/field/specification/branch');
phutil_require_module('phabricator', 'applications/differential/field/specification/ccs');
phutil_require_module('phabricator', 'applications/differential/field/specification/commits');
phutil_require_module('phabricator', 'applications/differential/field/specification/dependencies');

View file

@ -0,0 +1,41 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class DifferentialBranchFieldSpecification
extends DifferentialFieldSpecification {
public function shouldAppearOnRevisionView() {
return true;
}
public function renderLabelForRevisionView() {
return 'Branch:';
}
public function renderValueForRevisionView() {
$diff = $this->getDiff();
$branch = $diff->getBranch();
if ($branch == '') {
return null;
}
return phutil_escape_html($branch);
}
}

View file

@ -0,0 +1,14 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_module('phabricator', 'applications/differential/field/specification/base');
phutil_require_module('phutil', 'markup');
phutil_require_source('DifferentialBranchFieldSpecification.php');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,12 +35,7 @@ final class DifferentialPathFieldSpecification
return null;
}
$branch = $diff->getBranch();
if ($branch) {
$branch = ' ('.$branch.')';
}
return phutil_escape_html($path.$branch);
return phutil_escape_html($path);
}
}