diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-06-11 00:18:24 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-06-11 00:18:24 +0000 |
commit | 74a2c5a521872280b49077688ccc9fb6234d150d (patch) | |
tree | b999a96b451883e370dcacbcd6c6932a6edafa6e /app/models/repository | |
parent | 96f5d315ea029e2f49df462cd20320869bf10ee3 (diff) | |
download | redmine-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.rb | 8 |
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 |