Page MenuHomePhabricator

D12490.id.diff
No OneTemporary

D12490.id.diff

diff --git a/src/applications/differential/controller/DifferentialChangesetViewController.php b/src/applications/differential/controller/DifferentialChangesetViewController.php
--- a/src/applications/differential/controller/DifferentialChangesetViewController.php
+++ b/src/applications/differential/controller/DifferentialChangesetViewController.php
@@ -368,8 +368,10 @@
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 @@
// 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 @@
$inline
->makeEphemeral(true)
->setChangesetID($target_id)
- ->setIsGhost(true);
+ ->setIsGhost(
+ array(
+ 'new' => $is_new,
+ 'reason' => $reason,
+ ));
$results[] = $inline;
}
diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
--- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
+++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
@@ -123,14 +123,25 @@
}
$ghost_tag = null;
- if ($inline->getIsGhost()) {
- // TODO: This could also be a newer comment, not necessarily an older
- // comment.
+ $ghost = $inline->getIsGhost();
+ if ($ghost) {
+ if ($ghost['new']) {
+ $ghost_text = pht('Newer Comment');
+ } else {
+ $ghost_text = pht('Older Comment');
+ }
+
$ghost_tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE)
- ->setName(pht('Old Comment'))
+ ->setName($ghost_text)
->setSlimShady(true)
->setShade(PHUITagView::COLOR_BLUE)
+ ->addSigil('has-tooltip')
+ ->setMetadata(
+ array(
+ 'tip' => $ghost['reason'],
+ 'size' => 300,
+ ))
->addClass('mml');
$classes[] = 'inline-comment-ghost';
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 10, 8:55 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723235
Default Alt Text
D12490.id.diff (2 KB)

Event Timeline