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