diff app/models/.svn/text-base/repository.rb.svn-base @ 119:8661b858af72

* Update to Redmine trunk rev 4705
author Chris Cannam
date Thu, 13 Jan 2011 14:12:06 +0000
parents 513646585e45
children cd2282d2aa55 07fa8a8b56a8
line wrap: on
line diff
--- a/app/models/.svn/text-base/repository.rb.svn-base	Fri Nov 19 14:05:24 2010 +0000
+++ b/app/models/.svn/text-base/repository.rb.svn-base	Thu Jan 13 14:12:06 2011 +0000
@@ -86,7 +86,14 @@
   def diff(path, rev, rev_to)
     scm.diff(path, rev, rev_to)
   end
-  
+
+  def diff_format_revisions(cs, cs_to, sep=':')
+    text = ""
+    text << cs_to.format_identifier + sep if cs_to
+    text << cs.format_identifier if cs
+    text
+  end
+
   # Returns a path relative to the url of the repository
   def relative_path(path)
     path
@@ -94,6 +101,7 @@
   
   # Finds and returns a revision with a number or the beginning of a hash
   def find_changeset_by_name(name)
+    return nil if name.nil? || name.empty?
     changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%']))
   end