inc/SCM/Svn/CommitHookBridge.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 27 Jan 2011 14:22:15 +0000 (22:22 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 27 Jan 2011 14:22:15 +0000 (22:22 +0800)
inc/SCM/Svn/CommitHookBridge.php [deleted file]

diff --git a/inc/SCM/Svn/CommitHookBridge.php b/inc/SCM/Svn/CommitHookBridge.php
deleted file mode 100644 (file)
index e9321f1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php 
-
-
-class MTrack_SCM_Svn_CommitHookBridge extends  IMTrackCommitHookBridge 
-{
-    var $repo;
-    var $svnlook;
-    var $svnrepo;
-    var $svntxn;
-
-    function __construct($repo, $svnrepo, $svntxn) 
-    {
-        $this->repo = $repo;
-        $this->svnlook = MTrackConfig::get('tools', 'svnlook');
-        $this->svnrepo = $svnrepo;
-        $this->svntxn = explode(' ', $svntxn,2);
-    }
-
-    function enumChangedOrModifiedFileNames() 
-    {
-        $files = array();
-        $fp = $this->run($this->svnlook, 'changed', $this->svntxn, $this->svnrepo);
-        while (($line = fgets($fp)) !== false) {
-          if (preg_match("/^(\w)\s+(.*)$/", trim($line), $M)) {
-            $action = $M[1];
-            $path = $M[2];
-            if ($action == 'A' || $action == 'U' || $action == 'UU') {
-              $files[] = $path;
-            }
-          }
-        }
-        return $files;
-    }
-
-    function getCommitMessage()
-    {
-        $fp = $this->run($this->svnlook, 'log', $this->svntxn, $this->svnrepo);
-        
-        $log = stream_get_contents($fp);
-        $log = preg_replace('/\[(\d+)\]/',
-          "[changeset:" . $this->repo->getBrowseRootName() . ",\$1]", $log);
-        return $log;
-    }
-    
-    function getDiffStream($path)
-    {
-        return  $this->run($this->svnlook, 'diff', $this->svntxn, $this->svnrepo, $path);
-    }
-    
-    function getFileStream($path) 
-    {
-        return  $this->run($this->svnlook, 'cat', $this->svntxn, $this->svnrepo, $path);
-    }
-
-    function getChangesetDescriptor()
-    {
-        $rev = $this->svntxn[1];
-        return '[changeset:' . $this->repo->getBrowseRootName() . ",$rev]";
-    }
-}