Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93529276
PhabricatorRepositoryTrackOnlyTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 29, 12:00
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 12:00 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22660306
Attached To
rPH Phabricator
PhabricatorRepositoryTrackOnlyTransaction.php
View Options
<?php
final
class
PhabricatorRepositoryTrackOnlyTransaction
extends
PhabricatorRepositoryTransactionType
{
const
TRANSACTIONTYPE
=
'repo:track-only'
;
public
function
generateOldValue
(
$object
)
{
return
array_keys
(
$object
->
getDetail
(
'branch-filter'
,
array
()));
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setDetail
(
'branch-filter'
,
array_fill_keys
(
$value
,
true
));
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
if
(!
$new
)
{
return
pht
(
'%s set this repository to track all branches.'
,
$this
->
renderAuthor
());
}
else
if
(!
$old
)
{
return
pht
(
'%s set this repository to track branches: %s.'
,
$this
->
renderAuthor
(),
$this
->
renderValue
(
implode
(
', '
,
$new
)));
}
else
{
return
pht
(
'%s changed tracked branches from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderValue
(
implode
(
', '
,
$old
)),
$this
->
renderValue
(
implode
(
', '
,
$new
)));
}
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
return
$this
->
validateRefList
(
$object
,
$xactions
);
}
}
Event Timeline
Log In to Comment