Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15419299
D10427.id25126.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D10427.id25126.diff
View Options
diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
--- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php
+++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
@@ -26,6 +26,8 @@
$types[] = ManiphestTransaction::TYPE_CCS;
$types[] = ManiphestTransaction::TYPE_SUBPRIORITY;
$types[] = ManiphestTransaction::TYPE_PROJECT_COLUMN;
+ $types[] = ManiphestTransaction::TYPE_MERGED_INTO;
+ $types[] = ManiphestTransaction::TYPE_MERGED_FROM;
$types[] = ManiphestTransaction::TYPE_UNBLOCK;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
@@ -67,6 +69,9 @@
return $xaction->getOldValue();
case ManiphestTransaction::TYPE_SUBPRIORITY:
return $object->getSubpriority();
+ case ManiphestTransaction::TYPE_MERGED_INTO:
+ case ManiphestTransaction::TYPE_MERGED_FROM:
+ return null;
}
}
@@ -86,6 +91,8 @@
case ManiphestTransaction::TYPE_DESCRIPTION:
case ManiphestTransaction::TYPE_SUBPRIORITY:
case ManiphestTransaction::TYPE_PROJECT_COLUMN:
+ case ManiphestTransaction::TYPE_MERGED_INTO:
+ case ManiphestTransaction::TYPE_MERGED_FROM:
case ManiphestTransaction::TYPE_UNBLOCK:
return $xaction->getNewValue();
}
@@ -161,6 +168,11 @@
case ManiphestTransaction::TYPE_PROJECT_COLUMN:
// these do external (edge) updates
return;
+ case ManiphestTransaction::TYPE_MERGED_INTO:
+ $object->setStatus(ManiphestTaskStatus::getDuplicateStatus());
+ return;
+ case ManiphestTransaction::TYPE_MERGED_FROM:
+ return;
}
}
diff --git a/src/applications/maniphest/storage/ManiphestTransaction.php b/src/applications/maniphest/storage/ManiphestTransaction.php
--- a/src/applications/maniphest/storage/ManiphestTransaction.php
+++ b/src/applications/maniphest/storage/ManiphestTransaction.php
@@ -13,6 +13,8 @@
const TYPE_EDGE = 'edge';
const TYPE_SUBPRIORITY = 'subpriority';
const TYPE_PROJECT_COLUMN = 'projectcolumn';
+ const TYPE_MERGED_INTO = 'mergedinto';
+ const TYPE_MERGED_FROM = 'mergedfrom';
const TYPE_UNBLOCK = 'unblock';
@@ -96,6 +98,12 @@
$phids[] = $new['projectPHID'];
$phids[] = head($new['columnPHIDs']);
break;
+ case self::TYPE_MERGED_INTO:
+ $phids[] = $new;
+ break;
+ case self::TYPE_MERGED_FROM:
+ $phids = array_merge($phids, $new);
+ break;
case self::TYPE_EDGE:
$phids = array_mergev(
array(
@@ -290,6 +298,10 @@
return pht('Blocker');
}
+ case self::TYPE_MERGED_INTO:
+ case self::TYPE_MERGED_FROM:
+ return pht('Merged');
+
}
return parent::getActionName();
@@ -334,6 +346,10 @@
case self::TYPE_PROJECT_COLUMN:
return 'fa-columns';
+ case self::TYPE_MERGED_INTO:
+ case self::TYPE_MERGED_FROM:
+ return 'fa-compress';
+
case self::TYPE_PRIORITY:
if ($old == ManiphestTaskPriority::getDefaultPriority()) {
return 'fa-arrow-right';
@@ -571,7 +587,22 @@
$this->renderHandleLink($author_phid),
$this->renderHandleLink($column_phid),
$this->renderHandleLink($project_phid));
- break;
+ break;
+
+ case self::TYPE_MERGED_INTO:
+ return pht(
+ '%s merged this task into %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($new));
+ break;
+
+ case self::TYPE_MERGED_FROM:
+ return pht(
+ '%s merged %d task(s): %s.',
+ $this->renderHandleLink($author_phid),
+ count($new),
+ $this->renderHandleList($new));
+ break;
}
@@ -815,7 +846,22 @@
$this->renderHandleLink($object_phid),
$this->renderHandleLink($column_phid),
$this->renderHandleLink($project_phid));
- break;
+
+ case self::TYPE_MERGED_INTO:
+ return pht(
+ '%s merged task %s into %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $this->renderHandleLink($new));
+
+ case self::TYPE_MERGED_FROM:
+ return pht(
+ '%s merged %d task(s) %s into %s.',
+ $this->renderHandleLink($author_phid),
+ count($new),
+ $this->renderHandleList($new),
+ $this->renderHandleLink($object_phid));
+
}
return parent::getTitleForFeed($story);
diff --git a/src/applications/search/controller/PhabricatorSearchAttachController.php b/src/applications/search/controller/PhabricatorSearchAttachController.php
--- a/src/applications/search/controller/PhabricatorSearchAttachController.php
+++ b/src/applications/search/controller/PhabricatorSearchAttachController.php
@@ -154,10 +154,6 @@
->setContinueOnNoEffect(true)
->setContinueOnMissingFields(true);
- $task_names = array();
-
- $merge_into_name = 'T'.$task->getID();
-
$cc_vector = array();
$cc_vector[] = $task->getCCPHIDs();
foreach ($targets as $target) {
@@ -166,42 +162,30 @@
$target->getAuthorPHID(),
$target->getOwnerPHID());
- $close_task = id(new ManiphestTransaction())
- ->setTransactionType(ManiphestTransaction::TYPE_STATUS)
- ->setNewValue(ManiphestTaskStatus::getDuplicateStatus());
-
- $merge_comment = id(new ManiphestTransaction())
- ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
- ->attachComment(
- id(new ManiphestTransactionComment())
- ->setContent("\xE2\x9C\x98 Merged into {$merge_into_name}."));
+ $merged_into_txn = id(new ManiphestTransaction())
+ ->setTransactionType(ManiphestTransaction::TYPE_MERGED_INTO)
+ ->setNewValue($task->getPHID());
$editor->applyTransactions(
$target,
- array(
- $close_task,
- $merge_comment,
- ));
+ array($merged_into_txn));
- $task_names[] = 'T'.$target->getID();
}
$all_ccs = array_mergev($cc_vector);
$all_ccs = array_filter($all_ccs);
$all_ccs = array_unique($all_ccs);
- $task_names = implode(', ', $task_names);
-
$add_ccs = id(new ManiphestTransaction())
->setTransactionType(ManiphestTransaction::TYPE_CCS)
->setNewValue($all_ccs);
- $merged_comment = id(new ManiphestTransaction())
- ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
- ->attachComment(
- id(new ManiphestTransactionComment())
- ->setContent("\xE2\x97\x80 Merged tasks: {$task_names}."));
+ $merged_from_txn = id(new ManiphestTransaction())
+ ->setTransactionType(ManiphestTransaction::TYPE_MERGED_FROM)
+ ->setNewValue(mpull($targets, 'getPHID'));
- $editor->applyTransactions($task, array($add_ccs, $merged_comment));
+ $editor->applyTransactions(
+ $task,
+ array($add_ccs, $merged_from_txn));
return $response;
}
diff --git a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
--- a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
+++ b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php
@@ -341,6 +341,20 @@
),
),
+ '%s merged %d task(s): %s.' => array(
+ array(
+ '%s merged a task: %3$s.',
+ '%s merged tasks: %3$s.',
+ ),
+ ),
+
+ '%s merged %d task(s) %s into %s.' => array(
+ array(
+ '%s merged %3$s into %4$s.',
+ '%s merged tasks %3$s into %4$s.',
+ ),
+ ),
+
'%s edited voting user(s), added %d: %s; removed %d: %s.' =>
'%s edited voting users, added: %3$s; removed: %5$s',
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 5:09 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704034
Default Alt Text
D10427.id25126.diff (7 KB)
Attached To
Mode
D10427: Maniphest - upgrade merging to real transactions
Attached
Detach File
Event Timeline
Log In to Comment