rscm 0.2.1.1404 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/README +34 -23
  2. data/Rakefile +24 -29
  3. data/bin/touch.exe +0 -0
  4. data/lib/rscm.rb +6 -3
  5. data/lib/rscm/annotations.rb +26 -7
  6. data/lib/rscm/{abstract_scm.rb → base.rb} +109 -71
  7. data/lib/rscm/better.rb +16 -0
  8. data/lib/rscm/logging.rb +11 -5
  9. data/lib/rscm/path_converter.rb +9 -16
  10. data/lib/rscm/revision.rb +201 -0
  11. data/lib/rscm/revision_file.rb +71 -0
  12. data/lib/rscm/scm/clearcase.rb +7 -7
  13. data/lib/rscm/scm/cvs.rb +69 -70
  14. data/lib/rscm/scm/cvs_log_parser.rb +29 -29
  15. data/lib/rscm/scm/darcs.rb +82 -34
  16. data/lib/rscm/scm/darcs_log_parser.rb +65 -0
  17. data/lib/rscm/scm/monotone.rb +249 -77
  18. data/lib/rscm/scm/monotone_log_parser.rb +57 -43
  19. data/lib/rscm/scm/mooky.rb +3 -3
  20. data/lib/rscm/scm/perforce.rb +196 -134
  21. data/lib/rscm/scm/star_team.rb +10 -10
  22. data/lib/rscm/scm/subversion.rb +106 -77
  23. data/lib/rscm/scm/subversion_log_parser.rb +76 -47
  24. data/lib/rscm/time_ext.rb +2 -116
  25. data/test/rscm/annotations_test.rb +15 -2
  26. data/test/rscm/{abstract_scm_test.rb → base_test.rb} +3 -3
  27. data/test/rscm/difftool_test.rb +9 -3
  28. data/test/rscm/generic_scm_tests.rb +195 -124
  29. data/test/rscm/revision_fixture.rb +20 -0
  30. data/test/rscm/revision_test.rb +129 -0
  31. data/test/rscm/{changesets.yaml → revisions.yaml} +10 -10
  32. data/test/rscm/scm/clearcase.log +608 -0
  33. data/test/rscm/scm/clearcase_test.rb +39 -0
  34. data/test/rscm/scm/cvs_log_parser_test.rb +73 -73
  35. data/test/rscm/scm/cvs_test.rb +1 -1
  36. data/test/rscm/scm/darcs_log_parser_test.rb +171 -0
  37. data/test/rscm/scm/monotone_log_parser_test.rb +49 -31
  38. data/test/rscm/scm/monotone_test.rb +3 -2
  39. data/test/rscm/scm/p4client_test.rb +33 -0
  40. data/test/rscm/scm/perforce_test.rb +25 -3
  41. data/test/rscm/scm/star_team.rb +9 -9
  42. data/test/rscm/scm/subversion_log_parser_test.rb +107 -47
  43. metadata +17 -13
  44. data/lib/multipart.rb +0 -95
  45. data/lib/rscm/RSS.txt +0 -41
  46. data/lib/rscm/changes.rb +0 -268
  47. data/lib/rscm/example.yaml +0 -21
  48. data/lib/rubyforge_file_publisher.rb +0 -176
  49. data/test/rscm/changes_fixture.rb +0 -20
  50. data/test/rscm/changes_test.rb +0 -129
@@ -1,20 +0,0 @@
1
- require 'test/unit'
2
- require 'rscm/changes'
3
-
4
- module RSCM
5
- module ChangesFixture
6
- def setup_changes
7
- #1
8
- @change1 = RSCM::Change.new("path/one", nil, "jon", "Fixed CATCH-22", nil, Time.utc(2004,7,5,12,0,2))
9
- @change2 = RSCM::Change.new("path/two", nil, "jon", "Fixed CATCH-22", nil, Time.utc(2004,7,5,12,0,4))
10
- #2
11
- @change3 = RSCM::Change.new("path/three", nil, "jon", "hipp hurra", nil, Time.utc(2004,7,5,12,0,6))
12
- #3
13
- @change4 = RSCM::Change.new("path/four", nil, "aslak", "hipp hurraX", nil, Time.utc(2004,7,5,12,0,8))
14
- #4
15
- @change5 = RSCM::Change.new("path/five", nil, "aslak", "hipp hurra", nil, Time.utc(2004,7,5,12,0,10))
16
- @change6 = RSCM::Change.new("path/six", nil, "aslak", "hipp hurra", nil, Time.utc(2004,7,5,12,0,12))
17
- @change7 = RSCM::Change.new("path/seven", nil, "aslak", "hipp hurra", nil, Time.utc(2004,7,5,12,0,14))
18
- end
19
- end
20
- end
@@ -1,129 +0,0 @@
1
- require 'yaml'
2
- require 'rscm/changes_fixture'
3
-
4
- module RSCM
5
- class ChangesTest < Test::Unit::TestCase
6
- include ChangesFixture
7
-
8
- def setup
9
- setup_changes
10
- end
11
-
12
- def test_convert_changes_to_changesets_should_match_user_message_and_timestamp_
13
- changesets = ChangeSets.new
14
- changesets.add(@change1)
15
- changesets.add(@change2)
16
- changesets.add(@change3)
17
- changesets.add(@change4)
18
- changesets.add(@change5)
19
- changesets.add(@change6)
20
- changesets.add(@change7)
21
-
22
- changeset_0 = ChangeSet.new
23
- changeset_0 << @change1
24
- changeset_0 << @change2
25
-
26
- changeset_1 = ChangeSet.new
27
- changeset_1 << @change3
28
-
29
- changeset_2 = ChangeSet.new
30
- changeset_2 << @change4
31
-
32
- changeset_3 = ChangeSet.new
33
- changeset_3 << @change5
34
- changeset_3 << @change6
35
- changeset_3 << @change7
36
-
37
- assert_equal(4, changesets.length)
38
-
39
- expected_changesets = ChangeSets.new
40
- expected_changesets.add(changeset_0)
41
- expected_changesets.add(changeset_1)
42
- expected_changesets.add(changeset_2)
43
- expected_changesets.add(changeset_3)
44
-
45
- assert_equal(expected_changesets, changesets)
46
- end
47
-
48
- def test_changesets_can_add_individual_changes_and_group_in_changeset_instances
49
- changesets = ChangeSets.new
50
- assert(0, changesets.length)
51
-
52
- changesets.add(@change1)
53
- changesets.add(@change2)
54
- changesets.add(@change3)
55
- changesets.add(@change4)
56
- assert(3, changesets.length)
57
-
58
- tjo_bing_changeset = changesets[0]
59
- hipp_hurra_changeset = changesets[1]
60
- hipp_hurraX_changeset = changesets[2]
61
- assert(2, tjo_bing_changeset.length)
62
- assert(1, hipp_hurra_changeset.length)
63
- assert(1, hipp_hurraX_changeset.length)
64
-
65
- assert_same(@change1, tjo_bing_changeset[0])
66
- assert_same(@change2, tjo_bing_changeset[1])
67
- assert_same(@change3, hipp_hurra_changeset[0])
68
- assert_same(@change4, hipp_hurraX_changeset[0])
69
- end
70
-
71
- def test_should_sort_by_time
72
- changesets = ChangeSets.new
73
- changesets.add(@change1)
74
- changesets.add(@change4)
75
- changesets.add(@change2)
76
- changesets.add(@change7)
77
- changesets.add(@change5)
78
- changesets.add(@change3)
79
- changesets.add(@change6)
80
-
81
- changesets = changesets.sort do |a,b|
82
- a.time <=> b.time
83
- end
84
- assert_equal(4, changesets.length)
85
-
86
- assert_equal(@change2.time, changesets[0].time)
87
- assert_equal(@change7.time, changesets[-1].time)
88
- end
89
-
90
- def test_can_parse_changesets_from_yaml
91
- changesets = File.open(File.dirname(__FILE__) + "/changesets.yaml") do |io|
92
- YAML::load(io)
93
- end
94
- assert_equal("rinkrank", changesets[0][1].developer)
95
- assert_equal("En to\ntre buksa \nned\n", changesets[0][1].message)
96
- end
97
-
98
- def test_reports_timestamp_of_latest_change
99
- changeset = ChangeSet.new
100
- changeset << Change.new(nil, nil, nil, nil, nil, Time.utc(2004))
101
- changeset << Change.new(nil, nil, nil, nil, nil, Time.utc(2005))
102
- changeset << Change.new(nil, nil, nil, nil, nil, Time.utc(2003))
103
- assert_equal(Time.utc(2005), changeset.time)
104
- end
105
-
106
- def test_should_sort_changesets
107
- changesets = ChangeSets.new
108
- changesets.add(@change1)
109
- changesets.add(@change4)
110
- changesets.add(@change2)
111
- changesets.add(@change7)
112
- changesets.add(@change5)
113
- changesets.add(@change3)
114
- changesets.add(@change6)
115
-
116
- cs0 = changesets[0]
117
- cs1 = changesets[1]
118
- cs2 = changesets[2]
119
- cs3 = changesets[3]
120
-
121
- reversed = changesets.reverse
122
- assert_equal(cs0, reversed[3])
123
- assert_equal(cs1, reversed[2])
124
- assert_equal(cs2, reversed[1])
125
- assert_equal(cs3, reversed[0])
126
- end
127
- end
128
-
129
- end