4 class MTrack_SCM_Svn_CommitHookBridge extends IMTrackCommitHookBridge
11 function __construct($repo, $svnrepo, $svntxn)
14 $this->svnlook = MTrackConfig::get('tools', 'svnlook');
15 $this->svnrepo = $svnrepo;
16 $this->svntxn = explode(' ', $svntxn,2);
19 function enumChangedOrModifiedFileNames()
22 $fp = $this->run($this->svnlook, 'changed', $this->svntxn, $this->svnrepo);
23 while (($line = fgets($fp)) !== false) {
24 if (preg_match("/^(\w)\s+(.*)$/", trim($line), $M)) {
27 if ($action == 'A' || $action == 'U' || $action == 'UU') {
35 function getCommitMessage()
37 $fp = $this->run($this->svnlook, 'log', $this->svntxn, $this->svnrepo);
39 $log = stream_get_contents($fp);
40 $log = preg_replace('/\[(\d+)\]/',
41 "[changeset:" . $this->repo->getBrowseRootName() . ",\$1]", $log);
45 function getDiffStream($path)
47 return $this->run($this->svnlook, 'diff', $this->svntxn, $this->svnrepo, $path);
50 function getFileStream($path)
52 return $this->run($this->svnlook, 'cat', $this->svntxn, $this->svnrepo, $path);
55 function getChangesetDescriptor()
57 $rev = $this->svntxn[1];
58 return '[changeset:' . $this->repo->getBrowseRootName() . ",$rev]";