summaryrefslogtreecommitdiffstats
path: root/app/models/repository
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-06-11 00:18:24 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-06-11 00:18:24 +0000
commit74a2c5a521872280b49077688ccc9fb6234d150d (patch)
treeb999a96b451883e370dcacbcd6c6932a6edafa6e /app/models/repository
parent96f5d315ea029e2f49df462cd20320869bf10ee3 (diff)
downloadredmine-74a2c5a521872280b49077688ccc9fb6234d150d.tar.gz
redmine-74a2c5a521872280b49077688ccc9fb6234d150d.zip
scm: mercurial: use Rails3 ActiveRecord syntax with same as git r9807 at find_changeset_by_name
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9812 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository')
-rw-r--r--app/models/repository/mercurial.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb
index bc4962a67..54262d9a6 100644
--- a/app/models/repository/mercurial.rb
+++ b/app/models/repository/mercurial.rb
@@ -76,12 +76,12 @@ class Repository::Mercurial < Repository
return nil if name.blank?
s = name.to_s
if /[^\d]/ =~ s or s.size > 8
- e = changesets.find(:first, :conditions => ['scmid = ?', s])
+ cs = changesets.where(:scmid => s).first
else
- e = changesets.find(:first, :conditions => ['revision = ?', s])
+ cs = changesets.where(:revision => s).first
end
- return e if e
- changesets.find(:first, :conditions => ['scmid LIKE ?', "#{s}%"]) # last ditch
+ return cs if cs
+ changesets.where('scmid LIKE ?', "#{s}%").first
end
# Returns the latest changesets for +path+; sorted by revision number