Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F12661601
ArcanistRemoteRef.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
ArcanistRemoteRef.php
View Options
<?php
final
class
ArcanistRemoteRef
extends
ArcanistRef
{
private
$repositoryAPI
;
private
$remoteName
;
private
$fetchURI
;
private
$pushURI
;
const
HARDPOINT_REPOSITORYREFS
=
'arc.remote.repositoryRefs'
;
public
function
getRefDisplayName
()
{
return
pht
(
'Remote "%s"'
,
$this
->
getRemoteName
());
}
public
function
setRepositoryAPI
(
ArcanistRepositoryAPI
$repository_api
)
{
$this
->
repositoryAPI
=
$repository_api
;
return
$this
;
}
public
function
getRepositoryAPI
()
{
return
$this
->
repositoryAPI
;
}
public
function
setRemoteName
(
$remote_name
)
{
$this
->
remoteName
=
$remote_name
;
return
$this
;
}
public
function
getRemoteName
()
{
return
$this
->
remoteName
;
}
public
function
setFetchURI
(
$fetch_uri
)
{
$this
->
fetchURI
=
$fetch_uri
;
return
$this
;
}
public
function
getFetchURI
()
{
return
$this
->
fetchURI
;
}
public
function
setPushURI
(
$push_uri
)
{
$this
->
pushURI
=
$push_uri
;
return
$this
;
}
public
function
getPushURI
()
{
return
$this
->
pushURI
;
}
protected
function
buildRefView
(
ArcanistRefView
$view
)
{
$view
->
setObjectName
(
$this
->
getRemoteName
());
}
protected
function
newHardpoints
()
{
$object_list
=
new
ArcanistObjectListHardpoint
();
return
array
(
$this
->
newTemplateHardpoint
(
self
::
HARDPOINT_REPOSITORYREFS
,
$object_list
),
);
}
private
function
getRepositoryRefs
()
{
return
$this
->
getHardpoint
(
self
::
HARDPOINT_REPOSITORYREFS
);
}
public
function
getPushRepositoryRef
()
{
return
$this
->
getRepositoryRefByURI
(
$this
->
getPushURI
());
}
public
function
getFetchRepositoryRef
()
{
return
$this
->
getRepositoryRefByURI
(
$this
->
getFetchURI
());
}
private
function
getRepositoryRefByURI
(
$uri
)
{
$api
=
$this
->
getRepositoryAPI
();
$uri
=
$api
->
getNormalizedURI
(
$uri
);
foreach
(
$this
->
getRepositoryRefs
()
as
$repository_ref
)
{
foreach
(
$repository_ref
->
getURIs
()
as
$repository_uri
)
{
$repository_uri
=
$api
->
getNormalizedURI
(
$repository_uri
);
if
(
$repository_uri
===
$uri
)
{
return
$repository_ref
;
}
}
}
return
null
;
}
public
function
isPermanentRef
(
ArcanistMarkerRef
$ref
)
{
$repository_ref
=
$this
->
getPushRepositoryRef
();
if
(!
$repository_ref
)
{
return
false
;
}
return
$repository_ref
->
isPermanentRef
(
$ref
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 28, 15:47 (20 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1040498
Default Alt Text
ArcanistRemoteRef.php (2 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment