Page MenuHomePhabricator

D14414.id34822.diff
No OneTemporary

D14414.id34822.diff

diff --git a/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php b/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php
--- a/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php
+++ b/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php
@@ -81,17 +81,39 @@
$new);
}
case self::TYPE_URL:
- return pht(
- '%s changed the destination of the URL from %s to %s.',
- $this->renderHandleLink($author_phid),
- $old,
- $new);
+ if ($old != $new) {
+ if ($old === null) {
+ return pht(
+ '%s set the destination of the URL to %s.',
+ $this->renderHandleLink($author_phid),
+ $new);
+ } else {
+ return pht(
+ '%s changed the destination of the URL from %s to %s.',
+ $this->renderHandleLink($author_phid),
+ $old,
+ $new);
+ }
+ }
case self::TYPE_ALIAS:
- return pht(
- '%s changed the alias of the URL from %s to %s.',
- $this->renderHandleLink($author_phid),
- $old,
- $new);
+ if ($old != $new) {
+ if ($old === null) {
+ return pht(
+ '%s set the alias of the URL to %s.',
+ $this->renderHandleLink($author_phid),
+ $new);
+ } else if ($new === null) {
+ return pht(
+ '%s removed the alias of the URL.',
+ $this->renderHandleLink($author_phid));
+ } else {
+ return pht(
+ '%s changed the alias of the URL from %s to %s.',
+ $this->renderHandleLink($author_phid),
+ $old,
+ $new);
+ }
+ }
case self::TYPE_DESCRIPTION:
return pht(
"%s updated the URL's description.",
@@ -126,32 +148,43 @@
$new);
}
case self::TYPE_URL:
- if ($old === null) {
- return pht(
- '%s created %s.',
- $this->renderHandleLink($author_phid),
- $this->renderHandleLink($object_phid));
- } else {
- return pht(
- '%s changed the destination of %s from %s to %s',
- $this->renderHandleLink($author_phid),
- $this->renderHandleLink($object_phid),
- $old,
- $new);
+ if ($old != $new) {
+ if ($old === null) {
+ return pht(
+ '%s set the destination of %s to %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $new);
+ } else {
+ return pht(
+ '%s changed the destination of %s from %s to %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $old,
+ $new);
+ }
}
case self::TYPE_ALIAS:
- if ($old === null) {
- return pht(
- '%s created %s.',
- $this->renderHandleLink($author_phid),
- $this->renderHandleLink($object_phid));
- } else {
- return pht(
- '%s changed the alias of %s from %s to %s',
- $this->renderHandleLink($author_phid),
- $this->renderHandleLink($object_phid),
- $old,
- $new);
+ if ($old != $new) {
+ if ($old === null) {
+ return pht(
+ '%s set the alias of %s to %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $new);
+ } else if ($new === null) {
+ return pht(
+ '%s removed the alias of %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
+ } else {
+ return pht(
+ '%s changed the alias of %s from %s to %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $old,
+ $new);
+ }
}
case self::TYPE_DESCRIPTION:
return pht(

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 10:34 PM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6763521
Default Alt Text
D14414.id34822.diff (4 KB)

Event Timeline