Created
February 6, 2015 12:24
-
-
Save ZiTAL/e8fa5320819ef632f5f2 to your computer and use it in GitHub Desktop.
php: svn get revision files info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
su | |
aptitute install subversion | |
exit | |
*/ | |
$params = array | |
( | |
'revision' => 100, | |
'user' => 'zital', | |
'passwd' => 'zital', | |
'repo' => 'http://zitalsvnrepo/myproject' | |
); | |
$cli = "2>&1 svn log -v -r ".$params['revision']." --stop-on-copy --non-interactive --no-auth-cache --username ".$params['user']." --password ".$params['passwd']." ".$params['repo']; | |
$shell = shell_exec($cli); | |
/* | |
----------------------------------------------------------------------- | |
r100 | zital | 2011-03-10 15:53:04 +0100 (Thu, 10 Mar 2011) | 1 line | |
Changed paths: | |
A /trunk/public_html/application/helpers/pqp | |
A /trunk/public_html/application/helpers/pqp/README.txt | |
A /trunk/public_html/application/helpers/pqp/classes | |
A /trunk/public_html/application/helpers/pqp/classes/Console.php | |
A /trunk/public_html/application/helpers/pqp/classes/MySqlDatabase.php | |
A /trunk/public_html/application/helpers/pqp/classes/PhpQuickProfiler.php | |
A /trunk/public_html/application/helpers/pqp/css | |
A /trunk/public_html/application/helpers/pqp/css/pQp.css | |
A /trunk/public_html/application/helpers/pqp/display.php | |
A /trunk/public_html/application/helpers/pqp/images | |
A /trunk/public_html/application/helpers/pqp/images/Thumbs.db | |
A /trunk/public_html/application/helpers/pqp/images/overlay.gif | |
A /trunk/public_html/application/helpers/pqp/images/side.png | |
A /trunk/public_html/application/helpers/pqp/index.php | |
A /trunk/public_html/application/helpers/pqp/pqp.tpl | |
profiler | |
------------------------------------------------------------------------ | |
*/ | |
preg_match("/Changed\ paths:\s+([\s\S]+)\s+profiler/", $shell, $m); | |
if($m) | |
{ | |
$files = array(); | |
$i = 0; | |
$s = preg_split("/\n/", $m[1]); | |
foreach($s as $l) | |
{ | |
preg_match("/([AMD])\ ([^\s]+)$/", $l, $n); | |
if($n) | |
{ | |
$files[$i]['MODE'] = trim($n[1]); | |
$files[$i]['PATH'] = trim($n[2]); | |
$i++; | |
} | |
} | |
} | |
if(isset($files)) | |
print_r($files); | |
/* | |
Array | |
( | |
[0] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp | |
) | |
[1] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/README.txt | |
) | |
[2] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/classes | |
) | |
[3] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/classes/Console.php | |
) | |
[4] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/classes/MySqlDatabase.php | |
) | |
[5] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/classes/PhpQuickProfiler.php | |
) | |
[6] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/css | |
) | |
[7] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/css/pQp.css | |
) | |
[8] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/display.php | |
) | |
[9] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/images | |
) | |
[10] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/images/Thumbs.db | |
) | |
[11] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/images/overlay.gif | |
) | |
[12] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/images/side.png | |
) | |
[13] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/index.php | |
) | |
[14] => Array | |
( | |
[MODE] => A | |
[PATH] => /trunk/public_html/application/helpers/pqp/pqp.tpl | |
) | |
) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment