Project

General

Profile

Actions

Defect #29601

closed

Redmine::VERSION::revision may return wrong value

Added by Yuichi HARADA over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Administration
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Currently, Redmine::VERSION::revision return 'Revision'.

$ ruby bin/about

Environment:
  Redmine version                3.4.3.stable.17480
  Ruby version                   2.2.5-p319 (2016-04-26) [x86_64-darwin17]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               SQLite
SCM:
  Subversion                     1.9.7
  Git                            2.15.2
  Filesystem
Redmine plugins:
  no plugin installed

But, Revision of checkout URL is 'Last Changed Rev'.
$ svn info --xml

<?xml version="1.0" encoding="UTF-8"?>
<info>
<entry
   path="." 
   revision="17480" 
   kind="dir">               <!-- Currently shown Redmine::VERSION::revision (17480) -->
<url>https://svn.redmine.org/redmine/tags/3.4.3</url>
<relative-url>^/tags/3.4.3</relative-url>
<repository>
<root>https://svn.redmine.org/redmine</root>
<uuid>e93f8b46-1217-0410-a6f0-8f06a7374b81</uuid>
</repository>
<wc-info>
<wcroot-abspath>/path/to/redmine</wcroot-abspath>
<schedule>normal</schedule>
<depth>infinity</depth>
</wc-info>
<commit
   revision="17010">         <!-- Revision of checkout URL (17010) -->
<author>jplang</author>
<date>2017-10-15T19:54:11.195354Z</date>
</commit>
</entry>
</info>

I would like to change it as follows.
Index: lib/redmine/version.rb
===================================================================
diff --git a/trunk/lib/redmine/version.rb b/trunk/lib/redmine/version.rb
--- a/trunk/lib/redmine/version.rb    (revision 17480)
+++ b/trunk/lib/redmine/version.rb    (working copy)
@@ -18,7 +18,7 @@
       if File.directory?(File.join(Rails.root, '.svn'))
         begin
           path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s)
-          if `#{Redmine::Scm::Adapters::SubversionAdapter.client_command} info --xml #{path}` =~ /revision="(\d+)"/
+          if `#{Redmine::Scm::Adapters::SubversionAdapter.client_command} info --xml #{path}` =~ /commit\s+revision="(\d+)"/
             return $1.to_i
           end
         rescue


Files

Actions

Also available in: Atom PDF