php8
[web.mtrack] / MTrack / SCMFile.php
1 <?php
2 require_once 'MTrack/SCM.php';
3
4 abstract class MTrackSCMFile {
5   /** reference to the associated MTrackSCM object */
6   public $repo;
7
8   /** full path to file, with a leading slash (which represents
9    * the root of its respective repo */
10   public $name;
11
12   /** if true, this file represents a directory */
13   public $is_dir = false;
14
15   /** revision */
16   public $rev;
17
18   function __construct(MTrackSCM $repo, $name, $rev, $is_dir = false)
19   {
20     $this->repo = $repo;
21     $this->name = $name;
22     $this->rev = $rev;
23     $this->is_dir = $is_dir;
24   }
25
26   /** Returns an MTrackSCMEvent corresponding to this revision of
27    * the file */
28   abstract public function getChangeEvent();
29
30   /** Returns a stream representing the contents of the file at
31    * this revision */
32   abstract public function cat();
33
34   /** Returns an array of MTrackSCMAnnotation objects that correspond to
35    * each line of file content, annotating when the line was last
36    * changed.  The array is keyed by line number, 1-based. */
37   abstract public function annotate($include_line_content = false);
38
39   
40   
41   
42 }