| 
									
										
										
										
											2019-03-16 09:37:35 +00:00
										 |  |  | # frozen_string_literal: true | 
					
						
							| 
									
										
										
										
											2019-03-15 01:32:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-26 14:07:17 +00:00
										 |  |  | # Redmine - project management software | 
					
						
							| 
									
										
										
										
											2024-02-26 22:55:54 +00:00
										 |  |  | # Copyright (C) 2006-  Jean-Philippe Lang | 
					
						
							| 
									
										
										
										
											2023-11-26 14:07:17 +00:00
										 |  |  | # | 
					
						
							|  |  |  | # This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  | # modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  | # as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  | # of the License, or (at your option) any later version. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  | # GNU General Public License for more details. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  | # along with this program; if not, write to the Free Software | 
					
						
							|  |  |  | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-03 13:40:55 +00:00
										 |  |  | require 'redmine/scm/adapters/subversion_adapter' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-04-21 12:08:31 +00:00
										 |  |  | module Redmine | 
					
						
							| 
									
										
										
										
											2018-06-08 00:55:41 +00:00
										 |  |  |   # @private | 
					
						
							|  |  |  |   module VERSION | 
					
						
							| 
									
										
										
										
											2022-03-28 19:36:13 +00:00
										 |  |  |     MAJOR = 5
 | 
					
						
							| 
									
										
										
										
											2023-10-30 22:03:29 +00:00
										 |  |  |     MINOR = 1
 | 
					
						
							| 
									
										
										
										
											2024-06-12 00:27:41 +00:00
										 |  |  |     TINY  = 3
 | 
					
						
							| 
									
										
										
										
											2011-04-25 23:21:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-16 11:49:37 +00:00
										 |  |  |     # Branch values: | 
					
						
							|  |  |  |     # * official release: nil | 
					
						
							|  |  |  |     # * stable branch:    stable | 
					
						
							|  |  |  |     # * trunk:            devel | 
					
						
							|  |  |  |     BRANCH = 'devel' | 
					
						
							| 
									
										
										
										
											2007-04-21 12:08:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-12 14:09:58 +00:00
										 |  |  |     # Retrieves the revision from the working copy | 
					
						
							| 
									
										
										
										
											2007-10-11 16:59:08 +00:00
										 |  |  |     def self.revision | 
					
						
							| 
									
										
										
										
											2012-10-12 14:09:58 +00:00
										 |  |  |       if File.directory?(File.join(Rails.root, '.svn')) | 
					
						
							| 
									
										
										
										
											2007-10-11 16:59:08 +00:00
										 |  |  |         begin | 
					
						
							| 
									
										
										
										
											2012-10-12 14:09:58 +00:00
										 |  |  |           path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s) | 
					
						
							| 
									
										
										
										
											2019-10-05 05:46:39 +00:00
										 |  |  |           if `#{Redmine::Scm::Adapters::SubversionAdapter.client_command} info --xml #{path}` =~ /commit\s+revision="(\d+)"/ | 
					
						
							| 
									
										
										
										
											2012-10-12 14:09:58 +00:00
										 |  |  |             return $1.to_i | 
					
						
							| 
									
										
										
										
											2011-04-25 23:21:06 +00:00
										 |  |  |           end | 
					
						
							|  |  |  |         rescue | 
					
						
							|  |  |  |           # Could not find the current revision | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2012-10-12 14:09:58 +00:00
										 |  |  |       nil | 
					
						
							| 
									
										
										
										
											2007-10-11 16:59:08 +00:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     REVISION = self.revision | 
					
						
							| 
									
										
										
										
											2011-04-25 23:21:06 +00:00
										 |  |  |     ARRAY    = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact | 
					
						
							|  |  |  |     STRING   = ARRAY.join('.') | 
					
						
							| 
									
										
										
										
											2011-08-21 14:13:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-25 23:21:06 +00:00
										 |  |  |     def self.to_a; ARRAY  end | 
					
						
							| 
									
										
										
										
											2011-08-21 14:13:39 +00:00
										 |  |  |     def self.to_s; STRING end | 
					
						
							| 
									
										
										
										
											2007-04-21 12:08:31 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | end |