Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15392171
D15883.id38263.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D15883.id38263.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -775,6 +775,7 @@
'DiffusionRepositoryStagingManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php',
'DiffusionRepositoryStatusManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStatusManagementPanel.php',
'DiffusionRepositoryStorageManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php',
+ 'DiffusionRepositorySubversionManagementPanel' => 'applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php',
'DiffusionRepositorySymbolsManagementPanel' => 'applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php',
'DiffusionRepositoryTag' => 'applications/diffusion/data/DiffusionRepositoryTag.php',
'DiffusionRepositoryTestAutomationController' => 'applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php',
@@ -4995,6 +4996,7 @@
'DiffusionRepositoryStagingManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositoryStatusManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositoryStorageManagementPanel' => 'DiffusionRepositoryManagementPanel',
+ 'DiffusionRepositorySubversionManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositorySymbolsManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositoryTag' => 'Phobject',
'DiffusionRepositoryTestAutomationController' => 'DiffusionRepositoryManageController',
diff --git a/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php b/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php
--- a/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php
+++ b/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php
@@ -226,6 +226,11 @@
"IMPORTANT: This feature is new, experimental, and not supported. ".
"Use it at your own risk.");
+ $subpath_instructions = pht(
+ 'If you want to import only part of a repository, like `trunk/`, '.
+ 'you can set a path in **Import Only**. Phabricator will ignore '.
+ 'commits which do not affect this path.');
+
return array(
id(new PhabricatorSelectEditField())
->setKey('vcs')
@@ -339,6 +344,17 @@
->setConduitTypeDescription(pht('New default tracked branchs.'))
->setValue($autoclose_value),
id(new PhabricatorTextEditField())
+ ->setKey('importOnly')
+ ->setLabel(pht('Import Only'))
+ ->setTransactionType(
+ PhabricatorRepositoryTransaction::TYPE_SVN_SUBPATH)
+ ->setIsCopyable(true)
+ ->setDescription(pht('Subpath to selectively import.'))
+ ->setConduitDescription(pht('Set the subpath to import.'))
+ ->setConduitTypeDescription(pht('New subpath to import.'))
+ ->setValue($object->getDetail('svn-subpath'))
+ ->setControlInstructions($subpath_instructions),
+ id(new PhabricatorTextEditField())
->setKey('stagingAreaURI')
->setLabel(pht('Staging Area URI'))
->setTransactionType(
diff --git a/src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php
new file mode 100644
--- /dev/null
+++ b/src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php
@@ -0,0 +1,77 @@
+<?php
+
+final class DiffusionRepositorySubversionManagementPanel
+ extends DiffusionRepositoryManagementPanel {
+
+ const PANELKEY = 'subversion';
+
+ public function getManagementPanelLabel() {
+ return pht('Subversion');
+ }
+
+ public function getManagementPanelOrder() {
+ return 1000;
+ }
+
+ public function shouldEnableForRepository(
+ PhabricatorRepository $repository) {
+ return $repository->isSVN();
+ }
+
+ public function getManagementPanelIcon() {
+ $repository = $this->getRepository();
+
+ $has_any = (bool)$repository->getDetail('svn-subpath');
+
+ if ($has_any) {
+ return 'fa-database';
+ } else {
+ return 'fa-database grey';
+ }
+ }
+
+ protected function getEditEngineFieldKeys() {
+ return array(
+ 'importOnly',
+ );
+ }
+
+ protected function buildManagementPanelActions() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $subversion_uri = $this->getEditPageURI();
+
+ return array(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-pencil')
+ ->setName(pht('Edit Properties'))
+ ->setHref($subversion_uri)
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit),
+ );
+ }
+
+ public function buildManagementPanelContent() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+
+ $view = id(new PHUIPropertyListView())
+ ->setViewer($viewer)
+ ->setActionList($this->newActions());
+
+ $default_branch = nonempty(
+ $repository->getHumanReadableDetail('svn-subpath'),
+ phutil_tag('em', array(), pht('Import Entire Repository')));
+ $view->addProperty(pht('Import Only'), $default_branch);
+
+
+ return $this->newBox(pht('Subversion'), $view);
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 1:36 PM (3 w, 48 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225173
Default Alt Text
D15883.id38263.diff (5 KB)
Attached To
Mode
D15883: Restore edit UI for "Import Only" in Subversion
Attached
Detach File
Event Timeline
Log In to Comment