Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79220047
PhabricatorRepositoryVersion.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
Sun, Aug 25, 08:21
Size
555 B
Mime Type
text/x-php
Expires
Tue, Aug 27, 08:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20164266
Attached To
rPH Phabricator
PhabricatorRepositoryVersion.php
View Options
<?php
final
class
PhabricatorRepositoryVersion
extends
Phobject
{
public
static
function
getMercurialVersion
()
{
list
(
$err
,
$stdout
,
$stderr
)
=
exec_manual
(
'hg --version --quiet'
);
// NOTE: At least on OSX, recent versions of Mercurial report this
// string in this format:
//
// Mercurial Distributed SCM (version 3.1.1+20140916)
$matches
=
null
;
$pattern
=
'/^Mercurial Distributed SCM
\(
version ([
\d
.]+)/m'
;
if
(
preg_match
(
$pattern
,
$stdout
,
$matches
))
{
return
$matches
[
1
];
}
return
null
;
}
}
Event Timeline
Log In to Comment