]> source.dussan.org Git - redmine.git/commitdiff
scm: cvs: code clean up adapter entries().
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Mar 2011 01:48:36 +0000 (01:48 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Mar 2011 01:48:36 +0000 (01:48 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5086 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/cvs_adapter.rb

index cc3ebcd2a19af3134a634e6b6b5044c40a1ed0ea..12300af7c81a80f4622f545b5a4ae17e7fcab7a3 100644 (file)
@@ -103,32 +103,36 @@ module Redmine
           cmd_args << "-D" << time_to_cvstime(identifier) if identifier
           cmd_args << path_with_project
           scm_cmd(*cmd_args) do |io|
-            io.each_line(){|line|
-              fields=line.chop.split('/',-1)
+            io.each_line() do |line|
+              fields = line.chop.split('/',-1)
               logger.debug(">>InspectLine #{fields.inspect}")
-
               if fields[0]!="D"
-                entries << Entry.new({:name => fields[-5],
+                entries << Entry.new(
+                 {
+                  :name => fields[-5],
                   #:path => fields[-4].include?(path)?fields[-4]:(path + "/"+ fields[-4]),
                   :path => "#{path}/#{fields[-5]}",
                   :kind => 'file',
                   :size => nil,
-                  :lastrev => Revision.new({
-                    :revision => fields[-4],
-                    :name => fields[-4],
-                    :time => Time.parse(fields[-3]),
-                    :author => ''
+                  :lastrev => Revision.new(
+                      {
+                        :revision => fields[-4],
+                        :name => fields[-4],
+                        :time => Time.parse(fields[-3]),
+                        :author => ''
+                      })
                   })
-                })
               else
-                entries << Entry.new({:name => fields[1],
+                entries << Entry.new(
+                 {
+                  :name => fields[1],
                   :path => "#{path}/#{fields[1]}",
                   :kind => 'dir',
                   :size => nil,
                   :lastrev => nil
-                })
+                 })
               end
-            }
+            end
           end
           entries.sort_by_name
         rescue ScmCommandAborted