Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F12661670
ArcanistGitWorkEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistGitWorkEngine.php
View Options
<?php
final
class
ArcanistGitWorkEngine
extends
ArcanistWorkEngine
{
protected
function
getDefaultStartSymbol
()
{
$api
=
$this
->
getRepositoryAPI
();
// NOTE: In Git, we're trying to find the current branch name because the
// behavior of "--track" depends on the symbol we pass.
$marker
=
$api
->
newMarkerRefQuery
()
->
withIsActive
(
true
)
->
withMarkerTypes
(
array
(
ArcanistMarkerRef
::
TYPE_BRANCH
))
->
executeOne
();
if
(
$marker
)
{
return
$marker
->
getName
();
}
return
$api
->
getWorkingCopyRevision
();
}
protected
function
newMarker
(
$symbol
,
$start
)
{
$api
=
$this
->
getRepositoryAPI
();
$log
=
$this
->
getLogEngine
();
$log
->
writeStatus
(
pht
(
'NEW BRANCH'
),
pht
(
'Creating new branch "%s" from "%s".'
,
$symbol
,
$start
));
$future
=
$api
->
newFuture
(
'checkout --track -b %s %s --'
,
$symbol
,
$start
);
$future
->
resolve
();
}
protected
function
moveToMarker
(
ArcanistMarkerRef
$marker
)
{
$api
=
$this
->
getRepositoryAPI
();
$log
=
$this
->
getLogEngine
();
$log
->
writeStatus
(
pht
(
'BRANCH'
),
pht
(
'Checking out branch "%s".'
,
$marker
->
getName
()));
$future
=
$api
->
newFuture
(
'checkout %s --'
,
$marker
->
getName
());
$future
->
resolve
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 28, 15:47 (17 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1044561
Default Alt Text
ArcanistGitWorkEngine.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment