OSDN Git Service

scm: cvs: override annotate() in model.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 15:43:50 +0000 (15:43 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 15:43:50 +0000 (15:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5410 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/cvs.rb

index c8f9885..c11500c 100644 (file)
@@ -63,7 +63,7 @@ class Repository::Cvs < Repository
     end
     entries
   end
-  
+
   def cat(path, identifier=nil)
     rev = nil
     if ! identifier.nil?
@@ -72,7 +72,16 @@ class Repository::Cvs < Repository
     end
     scm.cat(path, rev.nil? ? nil : rev.committed_on)
   end
-  
+
+  def annotate(path, identifier=nil)
+    rev = nil
+    if ! identifier.nil?
+      rev = changesets.find_by_revision(identifier)
+      return nil if rev.nil?
+    end
+    scm.annotate(path, rev.nil? ? nil : rev.committed_on)
+  end
+
   def diff(path, rev, rev_to)
     # convert rev to revision. CVS can't handle changesets here
     diff=[]