##// END OF EJS Templates
scm: mercurial: improvement latest_changesets without supporting tags and named branches (#4455)....
Toshi MARUYAMA -
r4748:b3c517387a74
parent child
Show More
@@ -61,14 +61,17 class Repository::Mercurial < Repository
61 61 end
62 62
63 63 # Returns the latest changesets for +path+; sorted by revision number
64 # Default behavior is to search in cached changesets
64 65 def latest_changesets(path, rev, limit=10)
65 66 if path.blank?
66 67 changesets.find(:all, :include => :user, :limit => limit)
67 68 else
68 changes.find(:all, :include => {:changeset => :user},
69 :conditions => ["path = ?", path.with_leading_slash],
70 :order => "#{Changeset.table_name}.id DESC",
71 :limit => limit).collect(&:changeset)
69 changesets.find(:all, :select => "DISTINCT #{Changeset.table_name}.*",
70 :joins => :changes,
71 :conditions => ["#{Change.table_name}.path = ? OR #{Change.table_name}.path LIKE ? ESCAPE ?",
72 path.with_leading_slash,
73 "#{path.with_leading_slash.gsub(/[%_\\]/) { |s| "\\#{s}" }}/%", '\\'],
74 :include => :user, :limit => limit)
72 75 end
73 76 end
74 77
General Comments 0
You need to be logged in to leave comments. Login now