rscm 0.2.0 → 0.2.1.1404

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG ADDED
@@ -0,0 +1,9 @@
1
+ *0.2.1*
2
+
3
+ * implemented add method for monotone [srbaker]
4
+
5
+ * Fixed monotone test and added some doco [rinkrank]
6
+
7
+ * add server and port options to Monotone::initialize [srbaker]
8
+
9
+ * Added changelog file [rinkrank]
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ require 'lib/rubyforge_file_publisher'
11
11
 
12
12
  PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
13
13
  PKG_NAME = 'rscm'
14
- PKG_VERSION = '0.2.0' + PKG_BUILD
14
+ PKG_VERSION = '0.2.1' + PKG_BUILD
15
15
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
16
16
 
17
17
  desc "Default Task"
@@ -36,6 +36,7 @@ rd = Rake::RDocTask.new { |rdoc|
36
36
  rdoc.title = 'RSCM - Ruby Source Control Management API'
37
37
  rdoc.options << '--line-numbers' << '--inline-source'
38
38
  rdoc.rdoc_files.include('README')
39
+ rdoc.rdoc_files.include('CHANGELOG')
39
40
  rdoc.rdoc_files.include('lib/**/*.rb')
40
41
  rdoc.rdoc_files.include('docs/**/*.rd')
41
42
  }
@@ -131,15 +131,15 @@ module RSCM
131
131
  # For some SCMs this is not possible, or at least very hard. In that case, just override
132
132
  # the checkout_silent method instead of this method (should be protected).
133
133
  def checkout(checkout_dir, to_identifier=Time.infinity) # :yield: file
134
- checkout_time = Time.now
134
+ # the OS doesn't store file timestamps with fractions.
135
+ before_checkout_time = Time.now.utc - 1
135
136
 
136
137
  # We expect subclasses to implement this as a protected method (unless this whole method is overridden).
137
138
  checkout_silent(checkout_dir, to_identifier)
138
-
139
139
  files = Dir["#{checkout_dir}/**/*"]
140
140
  added = []
141
141
  files.each do |file|
142
- added << file if File.mtime(file) > checkout_time
142
+ added << file if File.mtime(file).utc > before_checkout_time
143
143
  end
144
144
  ignore_paths.each do |regex|
145
145
  added.delete_if{|path| path =~ regex}
@@ -0,0 +1,85 @@
1
+ require 'rscm/abstract_scm'
2
+ require 'rscm/path_converter'
3
+ require 'fileutils'
4
+
5
+ module RSCM
6
+ class ClearCase < AbstractSCM
7
+
8
+ LOG_FORMAT = "Developer:%u\\nTime:%Nd\\nExtendedName:%Xn\\nVersionId:%Vn\\nPreviousVersionId:%PVn\\nElementName:%En\\nOID:%On\\nO:%o\\nMessage:%Nc\\n------------------------------------------\\n"
9
+
10
+ def name
11
+ "ClearCase"
12
+ end
13
+
14
+ def changesets(checkout_dir, from_identifier, to_identifier=Time.infinity)
15
+ result = ChangeSets.new
16
+ with_working_dir(checkout_dir) do
17
+ since = from_identifier.strftime("%d-%b-%Y.%H:%M:%S")
18
+ cleartool("lshistory -recurse -nco -since #{since} -fmt #{LOG_FORMAT}") do |io|
19
+ io.each_line {|l| puts l}
20
+ changesets << ChangeSet.new()
21
+ end
22
+ end
23
+ result
24
+ end
25
+
26
+ def diff(checkout_dir, change)
27
+ with_working_dir(checkout_dir) do
28
+ cleartool("diff -diff_format #{change.path}@@#{change.previous_revision} #{change.path}@@#{change.revision}")
29
+ end
30
+ end
31
+
32
+ def checked_out?(checkout_dir)
33
+ File.exists?("#{checkout_dir}")
34
+ end
35
+
36
+ def uptodate?(checkout_dir, from_identifier)
37
+ if (!checked_out?(checkout_dir))
38
+ false
39
+ else
40
+ with_working_dir(checkout_dir) do
41
+ false
42
+ end
43
+ end
44
+ end
45
+
46
+ def commit(checkout_dir, message)
47
+
48
+ end
49
+
50
+ def import
51
+ # clearfsimport -preview -recurse -nsetevent <from> <to>
52
+ end
53
+
54
+ protected
55
+
56
+ # Checks out silently. Called by superclass' checkout.
57
+ def checkout_silent(checkout_dir, to_identifier)
58
+ with_working_dir(checkout_dir) do
59
+ cleartool("update .") { |io|
60
+ #io.each_line {|l| puts l}
61
+ }
62
+ end
63
+ end
64
+
65
+ # Administrative files that should be ignored when counting files.
66
+ def ignore_paths
67
+ return [/.*\.updt/]
68
+ end
69
+
70
+ private
71
+
72
+ def cleartool(cleartool_cmd)
73
+ cmd = "cleartool #{cleartool_cmd}"
74
+ safer_popen(cmd, "r+") do |io|
75
+ if(block_given?)
76
+ return(yield(io))
77
+ else
78
+ # just read stdout so we can exit
79
+ io.read
80
+ end
81
+ end
82
+ end
83
+
84
+ end
85
+ end
data/lib/rscm/scm/cvs.rb CHANGED
@@ -16,7 +16,7 @@ module RSCM
16
16
  ann :description => "CVSROOT"
17
17
  attr_accessor :root
18
18
 
19
- ann :description => "module"
19
+ ann :description => "Module"
20
20
  attr_accessor :mod
21
21
 
22
22
  ann :description => "Branch"
@@ -32,6 +32,12 @@ module RSCM
32
32
  "Monotone"
33
33
  end
34
34
 
35
+ def add(checkout_dir, relative_filename)
36
+ with_working_dir(checkout_dir) do
37
+ monotone("add #{relative_filename}")
38
+ end
39
+ end
40
+
35
41
  def create
36
42
  FileUtils.mkdir_p(File.dirname(@db_file))
37
43
  monotone("db init")
@@ -17,7 +17,8 @@ module RSCM
17
17
  include PathConverter
18
18
 
19
19
  ann :description => "Repository URL"
20
- ann :tip => "If you specify a local URL (starting with file://) DamageControl can create the repository for you after you save (unless the repository already exists).<br>Using a file:// URL will also give you the option to have DamageControl install a trigger in Subversion, so that you don't have to use polling to detect changes.<br>On Windows, file URLs must look like file:///C:/jupiter/mars"
20
+ # ann :tip => "If you specify a local URL (starting with file://) DamageControl can create the repository for you after you save (unless the repository already exists).<br>Using a file:// URL will also give you the option to have DamageControl install a trigger in Subversion, so that you don't have to use polling to detect changes.<br>On Windows, file URLs must look like file:///C:/jupiter/mars"
21
+ ann :tip => "If you use ssh, specify the URL as svn+ssh://username@server/path/to/repo"
21
22
  attr_accessor :url
22
23
 
23
24
  ann :description => "Path"
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.6
3
3
  specification_version: 1
4
4
  name: rscm
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2005-03-09
6
+ version: 0.2.1.1404
7
+ date: 2005-03-10
8
8
  summary: "RSCM - Ruby Source Control Management"
9
9
  require_paths:
10
10
  - lib
@@ -27,6 +27,7 @@ platform: ruby
27
27
  authors:
28
28
  - Aslak Hellesoy
29
29
  files:
30
+ - CHANGELOG
30
31
  - Rakefile
31
32
  - README
32
33
  - lib/multipart.rb
@@ -45,6 +46,7 @@ files:
45
46
  - lib/rscm/RSS.txt
46
47
  - lib/rscm/scm
47
48
  - lib/rscm/time_ext.rb
49
+ - lib/rscm/scm/clearcase.rb
48
50
  - lib/rscm/scm/cvs.rb
49
51
  - lib/rscm/scm/cvs_log_parser.rb
50
52
  - lib/rscm/scm/darcs.rb
@@ -114,6 +116,7 @@ rdoc_options:
114
116
  - "--inline-source"
115
117
  extra_rdoc_files:
116
118
  - README
119
+ - CHANGELOG
117
120
  executables: []
118
121
  extensions: []
119
122
  requirements: []