rscm 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +15 -0
- data/README +91 -81
- data/Rakefile +5 -1
- data/lib/rscm/base.rb +20 -27
- data/lib/rscm/command_line.rb +2 -2
- data/lib/rscm/difftool.rb +19 -8
- data/lib/rscm/revision.rb +14 -1
- data/lib/rscm/revision_file.rb +10 -0
- data/lib/rscm/scm/cvs.rb +3 -3
- data/lib/rscm/scm/mooky.rb +0 -6
- data/lib/rscm/scm/perforce.rb +112 -451
- data/lib/rscm/tempdir.rb +5 -0
- data/lib/rscm/version.rb +1 -1
- data/test/rscm/compatibility/config.yml +4 -0
- data/test/rscm/compatibility/cvs_metaproject/files_0.yml +13 -0
- data/test/rscm/compatibility/cvs_metaproject/revisions.yml +129 -0
- data/test/rscm/compatibility/cvs_metaproject/scm.yml +3 -0
- data/test/rscm/compatibility/damage_control_minimal.rb +104 -0
- data/test/rscm/{generic_scm_tests.rb → compatibility/full.rb} +8 -15
- data/test/rscm/compatibility/subversion_rscm/files_0.yml +35 -0
- data/test/rscm/compatibility/subversion_rscm/revisions.yml +69 -0
- data/test/rscm/compatibility/subversion_rscm/scm.yml +2 -0
- data/test/rscm/compatibility/subversion_rscm/svn_log_bug_irc.txt +87 -0
- data/test/rscm/scm/cvs_log_parser_test.rb +1 -0
- data/test/rscm/scm/cvs_test.rb +9 -15
- data/test/rscm/scm/mooky_test.rb +2 -9
- data/test/rscm/scm/perforce_test.rb +2 -31
- data/test/rscm/scm/subversion_test.rb +3 -6
- data/test/rscm/test_helper.rb +9 -0
- metadata +16 -4
- data/lib/rscm/scm/subversion_log_parser.rb.rej +0 -39
data/lib/rscm/tempdir.rb
CHANGED
data/lib/rscm/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
- CHANGES
|
3
|
+
- MIT-LICENSE
|
4
|
+
- README
|
5
|
+
- Rakefile
|
6
|
+
- TODO
|
7
|
+
- doc/base_attrs.rdoc
|
8
|
+
- lib/rake/contrib/xforge.rb
|
9
|
+
- lib/rake/contrib/xforge/base.rb
|
10
|
+
- lib/rake/contrib/xforge/release.rb
|
11
|
+
- lib/xforge.rb
|
12
|
+
- lib/xforge/version_parser.rb
|
13
|
+
- test/xforge/version_parser_specification.rb
|
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:RSCM::Revisions
|
2
|
+
revisions:
|
3
|
+
- !ruby/object:RSCM::Revision
|
4
|
+
developer: aslak_hellesoy
|
5
|
+
files:
|
6
|
+
- !ruby/object:RSCM::RevisionFile
|
7
|
+
native_revision_identifier: "1.1"
|
8
|
+
path: .cvsignore
|
9
|
+
previous_native_revision_identifier:
|
10
|
+
status: ADDED
|
11
|
+
- !ruby/object:RSCM::RevisionFile
|
12
|
+
native_revision_identifier: "1.3"
|
13
|
+
path: CHANGES
|
14
|
+
previous_native_revision_identifier: "1.2"
|
15
|
+
status: MODIFIED
|
16
|
+
- !ruby/object:RSCM::RevisionFile
|
17
|
+
native_revision_identifier: "1.2"
|
18
|
+
path: README
|
19
|
+
previous_native_revision_identifier: "1.1"
|
20
|
+
status: MODIFIED
|
21
|
+
- !ruby/object:RSCM::RevisionFile
|
22
|
+
native_revision_identifier: "1.4"
|
23
|
+
path: Rakefile
|
24
|
+
previous_native_revision_identifier: "1.3"
|
25
|
+
status: MODIFIED
|
26
|
+
- !ruby/object:RSCM::RevisionFile
|
27
|
+
native_revision_identifier: "1.2"
|
28
|
+
path: lib/xforge.rb
|
29
|
+
previous_native_revision_identifier: "1.1"
|
30
|
+
status: MODIFIED
|
31
|
+
- !ruby/object:RSCM::RevisionFile
|
32
|
+
native_revision_identifier: "1.3"
|
33
|
+
path: lib/rake/contrib/xforge/release.rb
|
34
|
+
previous_native_revision_identifier: "1.2"
|
35
|
+
status: MODIFIED
|
36
|
+
- !ruby/object:RSCM::RevisionFile
|
37
|
+
native_revision_identifier: "1.1"
|
38
|
+
path: lib/xforge/version_parser.rb
|
39
|
+
previous_native_revision_identifier:
|
40
|
+
status: ADDED
|
41
|
+
- !ruby/object:RSCM::RevisionFile
|
42
|
+
native_revision_identifier: "1.1"
|
43
|
+
path: test/xforge/version_parser_specification.rb
|
44
|
+
previous_native_revision_identifier:
|
45
|
+
status: ADDED
|
46
|
+
identifier: &id001 2005-08-12 03:22:09 Z
|
47
|
+
message: Added support for CHANGELOG parsing
|
48
|
+
time: *id001
|
49
|
+
- !ruby/object:RSCM::Revision
|
50
|
+
developer: aslak_hellesoy
|
51
|
+
files:
|
52
|
+
- !ruby/object:RSCM::RevisionFile
|
53
|
+
native_revision_identifier: "1.4"
|
54
|
+
path: CHANGES
|
55
|
+
previous_native_revision_identifier: "1.3"
|
56
|
+
status: MODIFIED
|
57
|
+
- !ruby/object:RSCM::RevisionFile
|
58
|
+
native_revision_identifier: "1.5"
|
59
|
+
path: Rakefile
|
60
|
+
previous_native_revision_identifier: "1.4"
|
61
|
+
status: MODIFIED
|
62
|
+
- !ruby/object:RSCM::RevisionFile
|
63
|
+
native_revision_identifier: "1.1"
|
64
|
+
path: xforge.tmproj
|
65
|
+
previous_native_revision_identifier:
|
66
|
+
status: ADDED
|
67
|
+
- !ruby/object:RSCM::RevisionFile
|
68
|
+
native_revision_identifier: "1.3"
|
69
|
+
path: lib/xforge.rb
|
70
|
+
previous_native_revision_identifier: "1.2"
|
71
|
+
status: MODIFIED
|
72
|
+
- !ruby/object:RSCM::RevisionFile
|
73
|
+
native_revision_identifier: "1.1"
|
74
|
+
path: lib/scm_web/view_cvs.rb
|
75
|
+
previous_native_revision_identifier:
|
76
|
+
status: ADDED
|
77
|
+
- !ruby/object:RSCM::RevisionFile
|
78
|
+
native_revision_identifier: "1.1"
|
79
|
+
path: lib/xforge/host.rb
|
80
|
+
previous_native_revision_identifier:
|
81
|
+
status: ADDED
|
82
|
+
- !ruby/object:RSCM::RevisionFile
|
83
|
+
native_revision_identifier: "1.1"
|
84
|
+
path: lib/xforge/project.rb
|
85
|
+
previous_native_revision_identifier:
|
86
|
+
status: ADDED
|
87
|
+
- !ruby/object:RSCM::RevisionFile
|
88
|
+
native_revision_identifier: "1.1"
|
89
|
+
path: lib/xforge/rubyforge.rb
|
90
|
+
previous_native_revision_identifier:
|
91
|
+
status: ADDED
|
92
|
+
- !ruby/object:RSCM::RevisionFile
|
93
|
+
native_revision_identifier: "1.1"
|
94
|
+
path: lib/xforge/session.rb
|
95
|
+
previous_native_revision_identifier:
|
96
|
+
status: ADDED
|
97
|
+
- !ruby/object:RSCM::RevisionFile
|
98
|
+
native_revision_identifier: "1.1"
|
99
|
+
path: lib/xforge/sourceforge.rb
|
100
|
+
previous_native_revision_identifier:
|
101
|
+
status: ADDED
|
102
|
+
- !ruby/object:RSCM::RevisionFile
|
103
|
+
native_revision_identifier: "1.1"
|
104
|
+
path: lib/xforge/xfile.rb
|
105
|
+
previous_native_revision_identifier:
|
106
|
+
status: ADDED
|
107
|
+
- !ruby/object:RSCM::RevisionFile
|
108
|
+
native_revision_identifier: "1.1"
|
109
|
+
path: lib/xforge/xforge.rd
|
110
|
+
previous_native_revision_identifier:
|
111
|
+
status: ADDED
|
112
|
+
- !ruby/object:RSCM::RevisionFile
|
113
|
+
native_revision_identifier: "1.1"
|
114
|
+
path: test/xforge/rubyforge_specification.rb
|
115
|
+
previous_native_revision_identifier:
|
116
|
+
status: ADDED
|
117
|
+
- !ruby/object:RSCM::RevisionFile
|
118
|
+
native_revision_identifier: "1.1"
|
119
|
+
path: test/xforge/sourceforge_specification.rb
|
120
|
+
previous_native_revision_identifier:
|
121
|
+
status: ADDED
|
122
|
+
- !ruby/object:RSCM::RevisionFile
|
123
|
+
native_revision_identifier: "1.1"
|
124
|
+
path: test/xforge/test_helper.rb
|
125
|
+
previous_native_revision_identifier:
|
126
|
+
status: ADDED
|
127
|
+
identifier: &id002 2005-08-13 01:23:50 Z
|
128
|
+
message: refactored into seperate files and added scm support
|
129
|
+
time: *id002
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module RSCM
|
2
|
+
module Compatibility
|
3
|
+
# These tests verify that an RSCM adapter implements
|
4
|
+
# the API that is required in order to use the adapter with DamageControl
|
5
|
+
module DamageControlMinimal
|
6
|
+
include Difftool
|
7
|
+
|
8
|
+
def setup
|
9
|
+
config_yml = File.dirname(__FILE__) + '/config.yml'
|
10
|
+
config = YAML::load_file(config_yml)
|
11
|
+
raise "#{config_yml} must have an entry for #{self.class.name}" if config[self.class.name].nil?
|
12
|
+
@testdata_dir = File.dirname(__FILE__) + '/' + config[self.class.name]
|
13
|
+
raise "#{@testdata_dir} directory doesn't exist" unless File.directory?(@testdata_dir)
|
14
|
+
@scm = YAML::load_file(@testdata_dir + '/scm.yml')
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_should_get_revisions_by_revision_identifier
|
18
|
+
suffix = method_name
|
19
|
+
do_verify_revisions_by_property(suffix, :identifier)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_should_get_revisions_by_time
|
23
|
+
# Subversion 1.3.0 currently has an unresolved bug:
|
24
|
+
# http://subversion.tigris.org/issues/show_bug.cgi?id=1642
|
25
|
+
#
|
26
|
+
# svn log http://buildpatterns.com/svn/repos/rscm/trunk/test/ --revision {"2006-03-03 11:55:55"}:{"2006-03-03 18:24:08"}
|
27
|
+
#
|
28
|
+
# returns revisions outside the lower bounds.
|
29
|
+
# we therefore exclude this test when running svn tests - it's not that important since DC only uses timestamps
|
30
|
+
# on the first run for a project, and it's not important that it is accurate.
|
31
|
+
unless self.class.name == 'RSCM::SubversionTest'
|
32
|
+
suffix = method_name
|
33
|
+
do_verify_revisions_by_property(suffix, :time)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def do_verify_revisions_by_property(suffix, something)
|
38
|
+
dir = File.expand_path(RSCM.new_temp_dir(suffix))
|
39
|
+
options = {:stdout => "#{dir}/stdout.log", :stderr => "#{dir}/stderr.log"}.freeze
|
40
|
+
@scm.checkout_dir = "#{dir}/checkout"
|
41
|
+
|
42
|
+
expected_yaml = @testdata_dir + '/revisions.yml'
|
43
|
+
expected = YAML::load_file(expected_yaml)
|
44
|
+
opts = options.dup.merge :to_identifier => expected.last.send(something)
|
45
|
+
actual = @scm.revisions(expected.first.send(something)-1, opts)
|
46
|
+
|
47
|
+
if(expected != actual)
|
48
|
+
assert_equal_with_diff(expected_yaml, actual.to_yaml, "See logs in #{dir}")
|
49
|
+
end
|
50
|
+
|
51
|
+
opts = options.dup.merge :to_identifier => expected.last.send(something)
|
52
|
+
later = @scm.revisions(expected.first.send(something), opts)
|
53
|
+
assert_not_equal(expected, later)
|
54
|
+
|
55
|
+
opts = options.dup.merge :to_identifier => expected.last.send(something)
|
56
|
+
earlier = @scm.revisions(expected.first.send(something)+1, opts)
|
57
|
+
assert_not_equal(expected, earlier)
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_should_checkout_sources_to_particular_revision
|
61
|
+
dirname = method_name
|
62
|
+
dir = File.expand_path(RSCM.new_temp_dir(dirname))
|
63
|
+
options = {:stdout => "#{dir}/stdout.log", :stderr => "#{dir}/stderr.log"}.freeze
|
64
|
+
revisions_yml = @testdata_dir + '/revisions.yml'
|
65
|
+
revisions = YAML::load_file(revisions_yml)
|
66
|
+
@scm.checkout_dir = RSCM.new_temp_dir("#{dirname}_0")
|
67
|
+
files_0 = @scm.checkout(revisions[0].identifier, options)
|
68
|
+
expected_yaml = @testdata_dir + "/files_0.yml"
|
69
|
+
expected = YAML::load_file(expected_yaml)
|
70
|
+
if(expected != files_0)
|
71
|
+
assert_equal_with_diff(expected_yaml, files_0.to_yaml)
|
72
|
+
end
|
73
|
+
|
74
|
+
# We can predict what the next checked out files should be
|
75
|
+
expected_files = files_0.dup
|
76
|
+
revisions[1].each do |file|
|
77
|
+
expected_files.delete(file.path) if file.status == "DELETED"
|
78
|
+
expected_files.push(file.path) if file.status == "ADDED"
|
79
|
+
end
|
80
|
+
expected_files.sort!
|
81
|
+
if(files_0 == expected_files)
|
82
|
+
flunk "The 2nd revision in #{revisions_yml} must have at least one added or deleted file"
|
83
|
+
end
|
84
|
+
|
85
|
+
@scm.checkout_dir = RSCM.new_temp_dir("#{dirname}_1")
|
86
|
+
files_1 = @scm.checkout(revisions[1].identifier, options)
|
87
|
+
assert_equal(expected_files, files_1)
|
88
|
+
|
89
|
+
# Now check out to the 1st revision again and verify files were removed
|
90
|
+
added_paths = revisions[1].find_all{|rf| rf.status=="ADDED"}.collect{|rf| rf.path}
|
91
|
+
assert added_paths.size > 0
|
92
|
+
added_paths.each do |p|
|
93
|
+
full_path = @scm.checkout_dir + '/' + p
|
94
|
+
assert File.exist?(full_path), "Should exist: #{full_path}"
|
95
|
+
end
|
96
|
+
@scm.checkout(revisions[0].identifier, options)
|
97
|
+
added_paths.each do |p|
|
98
|
+
full_path = @scm.checkout_dir + '/' + p
|
99
|
+
assert !File.exist?(full_path), "Should no longer exist: #{full_path}"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'rscm/tempdir'
|
3
3
|
require 'rscm/path_converter'
|
4
|
-
require 'rscm/
|
4
|
+
require 'rscm/difftool'
|
5
5
|
|
6
|
-
module RSCM
|
7
|
-
|
8
|
-
|
9
|
-
module GenericSCMTests
|
6
|
+
module RSCM
|
7
|
+
module Compatibility
|
8
|
+
module Full
|
10
9
|
|
11
10
|
include FileUtils
|
12
11
|
|
@@ -130,10 +129,7 @@ module RSCM
|
|
130
129
|
assert(scm.uptodate?(revisions.latest.identifier))
|
131
130
|
|
132
131
|
# 15
|
133
|
-
|
134
|
-
assert_equal(2, files.length)
|
135
|
-
assert_equal("build.xml", files[0])
|
136
|
-
assert_equal("src/java/com/thoughtworks/damagecontrolled/Thingy.java", files[1])
|
132
|
+
other_scm.checkout(nil).sort
|
137
133
|
|
138
134
|
# 16
|
139
135
|
assert(other_scm.uptodate?(nil))
|
@@ -179,7 +175,7 @@ module RSCM
|
|
179
175
|
@scm = scm
|
180
176
|
|
181
177
|
# Verify that install/uninstall works
|
182
|
-
touch = WINDOWS ? PathConverter.filepath_to_nativepath(File.dirname(__FILE__) + "
|
178
|
+
touch = WINDOWS ? PathConverter.filepath_to_nativepath(File.dirname(__FILE__) + "/../../../bin/touch.exe", true) : `which touch`.strip
|
183
179
|
trigger_command = "#{touch} " + PathConverter.filepath_to_nativepath(trigger_proof, true)
|
184
180
|
trigger_files_checkout_dir = File.expand_path("#{checkout_dir}/../trigger")
|
185
181
|
(1..3).each do |i|
|
@@ -327,7 +323,7 @@ EOF
|
|
327
323
|
|
328
324
|
def import_damagecontrolled(scm, import_copy_dir)
|
329
325
|
mkdir_p(import_copy_dir)
|
330
|
-
path = File.dirname(__FILE__) + "
|
326
|
+
path = File.dirname(__FILE__) + "/../../../testproject/damagecontrolled"
|
331
327
|
path = File.expand_path(path)
|
332
328
|
dirname = File.dirname(import_copy_dir)
|
333
329
|
cp_r(path, dirname)
|
@@ -391,8 +387,5 @@ EOF
|
|
391
387
|
)
|
392
388
|
end
|
393
389
|
end
|
394
|
-
|
395
|
-
module ApplyLabelTest
|
396
|
-
|
397
|
-
end
|
390
|
+
end
|
398
391
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
- rscm/apply_label_scm_tests.rb
|
3
|
+
- rscm/command_line_test.rb
|
4
|
+
- rscm/compatibility/damage_control_minimal.rb
|
5
|
+
- rscm/compatibility/full.rb
|
6
|
+
- rscm/difftool_test.rb
|
7
|
+
- rscm/file_after_edit
|
8
|
+
- rscm/file_ext.rb
|
9
|
+
- rscm/file_to_edit
|
10
|
+
- rscm/line_editor_test.rb
|
11
|
+
- rscm/mockit_test.rb
|
12
|
+
- rscm/parser_test.rb
|
13
|
+
- rscm/path_converter_test.rb
|
14
|
+
- rscm/revision_fixture.rb
|
15
|
+
- rscm/revision_test.rb
|
16
|
+
- rscm/revisions.yaml
|
17
|
+
- rscm/scm/cvs-dataforge.log
|
18
|
+
- rscm/scm/cvs-test.log
|
19
|
+
- rscm/scm/cvs_log_parser_test.rb
|
20
|
+
- rscm/scm/cvs_test.rb
|
21
|
+
- rscm/scm/darcs_log_parser_test.rb
|
22
|
+
- rscm/scm/darcs_test.rb
|
23
|
+
- rscm/scm/keys
|
24
|
+
- rscm/scm/monotone_log_parser_test.rb
|
25
|
+
- rscm/scm/monotone_test.rb
|
26
|
+
- rscm/scm/mooky_test.rb
|
27
|
+
- rscm/scm/p4client_test.rb
|
28
|
+
- rscm/scm/perforce_test.rb
|
29
|
+
- rscm/scm/star_team.rb
|
30
|
+
- rscm/scm/subversion_log_parser_test.rb
|
31
|
+
- rscm/scm/subversion_test.rb
|
32
|
+
- rscm/scm/svn-cargo.log
|
33
|
+
- rscm/scm/svn-growl.log
|
34
|
+
- rscm/scm/svn-growl2.log
|
35
|
+
- rscm/scm/svn-proxytoys.log
|
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:RSCM::Revisions
|
2
|
+
revisions:
|
3
|
+
- !ruby/object:RSCM::Revision
|
4
|
+
developer: aslak
|
5
|
+
files:
|
6
|
+
- !ruby/object:RSCM::RevisionFile
|
7
|
+
native_revision_identifier: 156
|
8
|
+
path: rscm/compatibility/damage_control_minimal.rb
|
9
|
+
previous_native_revision_identifier: 155
|
10
|
+
status: ADDED
|
11
|
+
- !ruby/object:RSCM::RevisionFile
|
12
|
+
native_revision_identifier: 156
|
13
|
+
path: rscm/compatibility/full.rb
|
14
|
+
previous_native_revision_identifier: 155
|
15
|
+
status: MOVED
|
16
|
+
- !ruby/object:RSCM::RevisionFile
|
17
|
+
native_revision_identifier: 156
|
18
|
+
path: rscm/generic_scm_tests.rb
|
19
|
+
previous_native_revision_identifier: 155
|
20
|
+
status: DELETED
|
21
|
+
- !ruby/object:RSCM::RevisionFile
|
22
|
+
native_revision_identifier: 156
|
23
|
+
path: rscm/scm/cvs_log_parser_test.rb
|
24
|
+
previous_native_revision_identifier: 155
|
25
|
+
status: MODIFIED
|
26
|
+
- !ruby/object:RSCM::RevisionFile
|
27
|
+
native_revision_identifier: 156
|
28
|
+
path: rscm/scm/cvs_test.rb
|
29
|
+
previous_native_revision_identifier: 155
|
30
|
+
status: MODIFIED
|
31
|
+
- !ruby/object:RSCM::RevisionFile
|
32
|
+
native_revision_identifier: 156
|
33
|
+
path: rscm/scm/perforce_test.rb
|
34
|
+
previous_native_revision_identifier: 155
|
35
|
+
status: MODIFIED
|
36
|
+
- !ruby/object:RSCM::RevisionFile
|
37
|
+
native_revision_identifier: 156
|
38
|
+
path: rscm/scm/subversion_test.rb
|
39
|
+
previous_native_revision_identifier: 155
|
40
|
+
status: MODIFIED
|
41
|
+
identifier: 156
|
42
|
+
message: reorganisations for compat suites
|
43
|
+
time: 2006-03-03 17:55:54 Z
|
44
|
+
- !ruby/object:RSCM::Revision
|
45
|
+
developer: aslak
|
46
|
+
files:
|
47
|
+
- !ruby/object:RSCM::RevisionFile
|
48
|
+
native_revision_identifier: 157
|
49
|
+
path: rscm/compatibility/damage_control_minimal.rb
|
50
|
+
previous_native_revision_identifier: 156
|
51
|
+
status: MODIFIED
|
52
|
+
- !ruby/object:RSCM::RevisionFile
|
53
|
+
native_revision_identifier: 157
|
54
|
+
path: rscm/compatibility/subversion_rscm/files.yml
|
55
|
+
previous_native_revision_identifier: 156
|
56
|
+
status: ADDED
|
57
|
+
- !ruby/object:RSCM::RevisionFile
|
58
|
+
native_revision_identifier: 157
|
59
|
+
path: rscm/compatibility/subversion_rscm/revisions.yml
|
60
|
+
previous_native_revision_identifier: 156
|
61
|
+
status: ADDED
|
62
|
+
- !ruby/object:RSCM::RevisionFile
|
63
|
+
native_revision_identifier: 157
|
64
|
+
path: rscm/compatibility/subversion_rscm/scm.yml
|
65
|
+
previous_native_revision_identifier: 156
|
66
|
+
status: ADDED
|
67
|
+
identifier: 157
|
68
|
+
message: Added settings for subversion dc compat test
|
69
|
+
time: 2006-03-03 18:24:07 Z
|