diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-02 04:44:20 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-02 04:44:20 +0000 |
commit | d301b8c0c1806a5cdb3a00b671058023a7619e09 (patch) | |
tree | e9e20199dd65fb6a55d85dad13c5c4ab111710eb /app/models/repository | |
parent | eb1866036935161f0566293a9fc9c7f4a95004ff (diff) | |
download | redmine-d301b8c0c1806a5cdb3a00b671058023a7619e09.tar.gz redmine-d301b8c0c1806a5cdb3a00b671058023a7619e09.zip |
scm: mercurial: switch short or long id of entry by existing value in DB (#14361)
git-svn-id: http://svn.redmine.org/redmine/trunk@12760 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository')
-rw-r--r-- | app/models/repository/mercurial.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index 1a5fd4b1e..36b73e920 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -71,12 +71,25 @@ class Repository::Mercurial < Repository super(cs, cs_to, ' ') end + def modify_entry_lastrev_identifier(entry) + if entry.lastrev && entry.lastrev.identifier + entry.lastrev.identifier = scmid_for_inserting_db(entry.lastrev.identifier) + end + end + private :modify_entry_lastrev_identifier + def entry(path=nil, identifier=nil) - scm.entry(path, identifier) + entry = scm.entry(path, identifier) + return nil if entry.nil? + modify_entry_lastrev_identifier(entry) + entry end def scm_entries(path=nil, identifier=nil) - scm.entries(path, identifier) + entries = scm.entries(path, identifier) + return nil if entries.nil? + entries.each {|entry| modify_entry_lastrev_identifier(entry)} + entries end protected :scm_entries |