Distinguish between ported-forward and ported-backward comments
Summary:
Ref T7447. This might be overkill, but I want to over-explain things until we have more confidence that this is rarely confusing.
NOTE: I'm playing it a bit fast and loose with `setIsGhost()` (passing a dictionary) because making API changes requires changing the interface and Diffusion, which is a pain. I'll clean this up at the end once the interface is more final. This is well-contained for now.
Test Plan:
- Viewed "base vs 2" in a diff with 3 diffs, saw some "older comments" and some "newer comments".
- Hovered the tags for an explanation of comment spookiness.
{F377703}
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7447
Differential Revision: https://secure.phabricator.com/D12490
This commit is contained in:
@@ -368,8 +368,10 @@ final class DifferentialChangesetViewController extends DifferentialController {
|
||||
|
||||
if ($changeset_id >= $first_new_id) {
|
||||
$name_map = $name_map_new;
|
||||
$is_new = true;
|
||||
} else {
|
||||
$name_map = $name_map_old;
|
||||
$is_new = false;
|
||||
}
|
||||
|
||||
$filename = $changeset->getFilename();
|
||||
@@ -377,6 +379,15 @@ final class DifferentialChangesetViewController extends DifferentialController {
|
||||
// This changeset is on a file with the same name as the current
|
||||
// changeset, so we're going to port it forward or backward.
|
||||
$target_id = $name_map[$filename];
|
||||
if ($is_new) {
|
||||
$reason = pht(
|
||||
'This comment was made on a file with the same name, but '.
|
||||
'in a newer diff.');
|
||||
} else {
|
||||
$reason = pht(
|
||||
'This comment was made on a file with the same name, but '.
|
||||
'in an older diff.');
|
||||
}
|
||||
}
|
||||
|
||||
// If we found a changeset to port this comment to, bring it forward
|
||||
@@ -385,7 +396,11 @@ final class DifferentialChangesetViewController extends DifferentialController {
|
||||
$inline
|
||||
->makeEphemeral(true)
|
||||
->setChangesetID($target_id)
|
||||
->setIsGhost(true);
|
||||
->setIsGhost(
|
||||
array(
|
||||
'new' => $is_new,
|
||||
'reason' => $reason,
|
||||
));
|
||||
|
||||
$results[] = $inline;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user