Differential D8097 Diff 18346 src/applications/repository/storage/PhabricatorRepositoryTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositoryTransaction.php
Show All 17 Lines | final class PhabricatorRepositoryTransaction | ||||
const TYPE_REMOTE_URI = 'repo:remote-uri'; | const TYPE_REMOTE_URI = 'repo:remote-uri'; | ||||
const TYPE_LOCAL_PATH = 'repo:local-path'; | const TYPE_LOCAL_PATH = 'repo:local-path'; | ||||
const TYPE_HOSTING = 'repo:hosting'; | const TYPE_HOSTING = 'repo:hosting'; | ||||
const TYPE_PROTOCOL_HTTP = 'repo:serve-http'; | const TYPE_PROTOCOL_HTTP = 'repo:serve-http'; | ||||
const TYPE_PROTOCOL_SSH = 'repo:serve-ssh'; | const TYPE_PROTOCOL_SSH = 'repo:serve-ssh'; | ||||
const TYPE_PUSH_POLICY = 'repo:push-policy'; | const TYPE_PUSH_POLICY = 'repo:push-policy'; | ||||
const TYPE_CREDENTIAL = 'repo:credential'; | const TYPE_CREDENTIAL = 'repo:credential'; | ||||
const TYPE_DANGEROUS = 'repo:dangerous'; | const TYPE_DANGEROUS = 'repo:dangerous'; | ||||
const TYPE_CLONE_NAME = 'repo:clone-name'; | |||||
// TODO: Clean up these legacy transaction types. | // TODO: Clean up these legacy transaction types. | ||||
const TYPE_SSH_LOGIN = 'repo:ssh-login'; | const TYPE_SSH_LOGIN = 'repo:ssh-login'; | ||||
const TYPE_SSH_KEY = 'repo:ssh-key'; | const TYPE_SSH_KEY = 'repo:ssh-key'; | ||||
const TYPE_SSH_KEYFILE = 'repo:ssh-keyfile'; | const TYPE_SSH_KEYFILE = 'repo:ssh-keyfile'; | ||||
const TYPE_HTTP_LOGIN = 'repo:http-login'; | const TYPE_HTTP_LOGIN = 'repo:http-login'; | ||||
const TYPE_HTTP_PASS = 'repo:http-pass'; | const TYPE_HTTP_PASS = 'repo:http-pass'; | ||||
▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
return pht( | return pht( | ||||
'%s disabled protection against dangerous changes.', | '%s disabled protection against dangerous changes.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s enabled protection against dangerous changes.', | '%s enabled protection against dangerous changes.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
} | } | ||||
case self::TYPE_CLONE_NAME: | |||||
if (strlen($old) && !strlen($new)) { | |||||
return pht( | |||||
'%s removed the clone name of this repository.', | |||||
$this->renderHandleLink($author_phid)); | |||||
} else if (strlen($new) && !strlen($old)) { | |||||
return pht( | |||||
'%s set the clone name of this repository to "%s".', | |||||
$this->renderHandleLink($author_phid), | |||||
$new); | |||||
} else { | |||||
return pht( | |||||
'%s changed the clone name of this repository from "%s" to "%s".', | |||||
$this->renderHandleLink($author_phid), | |||||
$old, | |||||
$new); | |||||
} | |||||
} | } | ||||
return parent::getTitle(); | return parent::getTitle(); | ||||
} | } | ||||
public function hasChangeDetails() { | public function hasChangeDetails() { | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_DESCRIPTION: | case self::TYPE_DESCRIPTION: | ||||
Show All 19 Lines |