]> source.dussan.org Git - redmine.git/commitdiff
scm: cvs: use localtime at cvs rlog -d option (#996, #3761).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 2 Feb 2011 13:13:44 +0000 (13:13 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 2 Feb 2011 13:13:44 +0000 (13:13 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4794 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/cvs_adapter.rb
test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb

index 5ca9e74121545b78adf7ab62a102d4de0a74a47a..44a252fce7441fc291e7e593faa0c3bb626ab410 100644 (file)
@@ -109,7 +109,7 @@ module Redmine
           
           path_with_project="#{url}#{with_leading_slash(path)}"
           cmd = "#{CVS_BIN} -d #{shell_quote root_url} rlog"
-          cmd << " -d\">#{time_to_cvstime(identifier_from)}\"" if identifier_from
+          cmd << " -d\">#{time_to_cvstime_rlog(identifier_from)}\"" if identifier_from
           cmd << " #{shell_quote path_with_project}"
           shellout(cmd) do |io|
             state="entry_start"
@@ -290,6 +290,12 @@ module Redmine
           end
           return time.strftime("%Y-%m-%d %H:%M:%S")
         end
+
+        def time_to_cvstime_rlog(time)
+          return nil if time.nil?
+          t1 = time.clone.localtime
+          return t1.strftime("%Y-%m-%d %H:%M:%S")
+        end
           
         def normalize_cvs_path(path)
           normalize_path(path.gsub(/Attic\//,''))
index c6c4558ea1e23dd35492d9ffaaf81864001daf3a..e063d44fdbe5a5c21ee990ab91cc406c2de30ae5 100644 (file)
@@ -19,6 +19,15 @@ begin
         end
         assert_equal 14, cnt
       end
+
+      def test_revisions_from_rev3
+        rev3_committed_on = Time.gm(2007, 12, 13, 16, 27, 22)
+        cnt = 0
+        @adapter.revisions('', rev3_committed_on, nil, :with_paths => true) do |revision|
+          cnt += 1
+        end
+        assert_equal 2, cnt
+      end
     else
       puts "Cvs test repository NOT FOUND. Skipping unit tests !!!"
       def test_fake; assert true end