diff --git a/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php b/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php index 1bfc79da9b..6d275bcefb 100644 --- a/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php +++ b/src/applications/phurl/storage/PhabricatorPhurlURLTransaction.php @@ -81,17 +81,35 @@ final class PhabricatorPhurlURLTransaction $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 === 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 === 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.", @@ -128,12 +146,13 @@ final class PhabricatorPhurlURLTransaction case self::TYPE_URL: if ($old === null) { return pht( - '%s created %s.', + '%s set the destination of %s to %s.', $this->renderHandleLink($author_phid), - $this->renderHandleLink($object_phid)); + $this->renderHandleLink($object_phid), + $new); } else { return pht( - '%s changed the destination of %s from %s to %s', + '%s changed the destination of %s from %s to %s.', $this->renderHandleLink($author_phid), $this->renderHandleLink($object_phid), $old, @@ -142,12 +161,18 @@ final class PhabricatorPhurlURLTransaction case self::TYPE_ALIAS: if ($old === null) { return pht( - '%s created %s.', + '%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', + '%s changed the alias of %s from %s to %s.', $this->renderHandleLink($author_phid), $this->renderHandleLink($object_phid), $old,