SVN developers usually need to know the files modified or added in a certain period of time during the development or code launch process. Therefore, a small program is written in PHP and can be called directly in the browser.
The code is as follows:
$ User = trim ($ _ GET ['user']);
$ D = $ _ GET ['Date'];
If (! $ D ){
$ D = date ('ymmd', time ()-86400*14 );
}
If (empty ($ user )){
Echo "example: svn_log.php? User = wang & date = 20130118 ";
Exit;
}
$ Cmd = '/usr/bin/svn log-v-r {'. $ d. '}: "HEAD" -- username -- password -- no-auth-cache | sed-n "/'. $ user. '/,/----- $/p "2> & 1 ';
$ P = dirname (_ FILE __);
Exec ('CD'. $ p, $ output );
Exec ($ cmd, $ output );
$ D = date ('y, m, dday', strtotime ($ d ));
Echo $ user. 'From '. $ d:
';
Echo '---------------------------------------------
';
$ Out = '';
Krsort ($ output );
If (! Empty ($ output )){
Foreach ($ output as $ v ){
$ P1 = strpos ($ v, '/branch /');
$ P2 = strpos ($ v, '/tg /');
If ($ p1! = False | $ p2! = False ){
If ($ p1! = False ){
$ V = substr ($ v, $ p1 + 9 );
} Else {
$ V = substr ($ v, $ p2 + 4 );
}
If ($ out = ''){
$ Out = $ v;
Echo $ v .'
';
} Else {
If (strpos ($ out, $ v) === false ){
$ Out. = ','. $ v;
Echo $ v .'
';
}
}
}
}
} Else {
Echo "no file ";
}
?>