ohloh_scm 2.0.0 → 2.0.1
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/lib/ohloh_scm/adapters/svn/commits.rb +1 -1
- data/lib/ohloh_scm/commit.rb +1 -1
- data/lib/ohloh_scm/diff.rb +4 -4
- data/lib/ohloh_scm/parsers/bzr_parser.rb +4 -4
- data/lib/ohloh_scm/parsers/bzr_xml_parser.rb +13 -13
- data/lib/ohloh_scm/parsers/cvs_parser.rb +1 -1
- data/lib/ohloh_scm/parsers/git_parser.rb +2 -2
- data/lib/ohloh_scm/parsers/git_styled_parser.rb +2 -2
- data/lib/ohloh_scm/parsers/hg_parser.rb +2 -2
- data/lib/ohloh_scm/parsers/hg_styled_parser.rb +2 -2
- data/lib/ohloh_scm/parsers/svn_parser.rb +2 -2
- data/lib/ohloh_scm/parsers/svn_xml_parser.rb +2 -2
- data/lib/ohloh_scm/scratch_dir.rb +1 -1
- data/lib/ohloh_scm/version.rb +2 -2
- data/ohloh_scm.gemspec +1 -1
- data/test/test_helper.rb +2 -2
- data/test/unit/abstract_adapter_test.rb +4 -4
- data/test/unit/adapter_factory_test.rb +7 -7
- data/test/unit/array_writer_test.rb +1 -1
- data/test/unit/bzr_cat_file_test.rb +12 -12
- data/test/unit/bzr_commits_test.rb +12 -12
- data/test/unit/bzr_head_test.rb +1 -1
- data/test/unit/bzr_misc_test.rb +2 -2
- data/test/unit/bzr_parser_test.rb +5 -5
- data/test/unit/bzr_pull_test.rb +2 -2
- data/test/unit/bzr_push_test.rb +2 -2
- data/test/unit/bzr_validation_test.rb +3 -3
- data/test/unit/bzr_xml_parser_test.rb +20 -20
- data/test/unit/bzrlib_cat_file_test.rb +10 -10
- data/test/unit/bzrlib_head_test.rb +1 -1
- data/test/unit/cvs_branch_number_test.rb +1 -1
- data/test/unit/cvs_commits_test.rb +1 -1
- data/test/unit/cvs_convert_test.rb +2 -2
- data/test/unit/cvs_misc_test.rb +1 -1
- data/test/unit/cvs_parser_test.rb +1 -1
- data/test/unit/cvs_validation_test.rb +1 -1
- data/test/unit/git_cat_file_test.rb +2 -2
- data/test/unit/git_commit_all_test.rb +3 -3
- data/test/unit/git_commits_test.rb +1 -1
- data/test/unit/git_head_test.rb +1 -1
- data/test/unit/git_log_parser_test.rb +2 -2
- data/test/unit/git_misc_test.rb +4 -4
- data/test/unit/git_parser_test.rb +1 -1
- data/test/unit/git_patch_test.rb +1 -1
- data/test/unit/git_pull_test.rb +2 -2
- data/test/unit/git_push_test.rb +3 -3
- data/test/unit/git_rev_list_test.rb +1 -1
- data/test/unit/git_styled_parser_test.rb +4 -4
- data/test/unit/git_token_test.rb +6 -6
- data/test/unit/git_validation_test.rb +1 -1
- data/test/unit/hg_cat_file_test.rb +6 -6
- data/test/unit/hg_commits_test.rb +1 -1
- data/test/unit/hg_head_test.rb +1 -1
- data/test/unit/hg_misc_test.rb +2 -2
- data/test/unit/hg_parser_test.rb +1 -1
- data/test/unit/hg_patch_test.rb +1 -1
- data/test/unit/hg_pull_test.rb +2 -2
- data/test/unit/hg_push_test.rb +2 -2
- data/test/unit/hg_rev_list_test.rb +1 -1
- data/test/unit/hg_validation_test.rb +1 -1
- data/test/unit/hglib_cat_file_test.rb +6 -6
- data/test/unit/hglib_head_test.rb +1 -1
- data/test/unit/ohlog_command_line_test.rb +1 -1
- data/test/unit/shellout_test.rb +1 -1
- data/test/unit/string_encoder_command_line_test.rb +1 -1
- data/test/unit/svn_cat_file_test.rb +3 -3
- data/test/unit/svn_chain_cat_file_test.rb +3 -3
- data/test/unit/svn_chain_commits_test.rb +1 -1
- data/test/unit/svn_chain_test.rb +2 -2
- data/test/unit/svn_commits_test.rb +15 -15
- data/test/unit/svn_convert_test.rb +2 -2
- data/test/unit/svn_head_test.rb +1 -1
- data/test/unit/svn_misc_test.rb +2 -2
- data/test/unit/svn_parser_test.rb +1 -1
- data/test/unit/svn_patch_test.rb +1 -1
- data/test/unit/svn_pull_test.rb +5 -5
- data/test/unit/svn_push_test.rb +3 -3
- data/test/unit/svn_validation_test.rb +3 -3
- data/test/unit/svn_xml_parser_test.rb +2 -2
- metadata +2 -2
data/test/unit/shellout_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Parsers
|
4
|
-
class StringEncoderCommandLineTest <
|
4
|
+
class StringEncoderCommandLineTest < OhlohScm::Test
|
5
5
|
def test_length_of_content_unchanged
|
6
6
|
file_path = File.expand_path('../../data/sample-content', __FILE__)
|
7
7
|
original_content_length = File.size(file_path)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class SvnCatFileTest <
|
4
|
+
class SvnCatFileTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_cat_file
|
7
7
|
with_svn_repository('svn') do |svn|
|
@@ -13,9 +13,9 @@ main()
|
|
13
13
|
printf("Hello, World!\\n");
|
14
14
|
}
|
15
15
|
EXPECTED
|
16
|
-
assert_equal expected, svn.cat_file(
|
16
|
+
assert_equal expected, svn.cat_file(OhlohScm::Commit.new(:token => 1), OhlohScm::Diff.new(:path => "trunk/helloworld.c"))
|
17
17
|
|
18
|
-
assert_equal nil, svn.cat_file(
|
18
|
+
assert_equal nil, svn.cat_file(OhlohScm::Commit.new(:token => 1), OhlohScm::Diff.new(:path => "file not found"))
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class SvnChainCatFileTest <
|
4
|
+
class SvnChainCatFileTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_cat_file_with_chaining
|
7
7
|
goodbye = <<-EXPECTED
|
@@ -13,11 +13,11 @@ main()
|
|
13
13
|
EXPECTED
|
14
14
|
with_svn_chain_repository('svn_with_branching', '/trunk') do |svn|
|
15
15
|
# The first case asks for the file on the HEAD, so it should easily be found
|
16
|
-
assert_equal goodbye, svn.cat_file(
|
16
|
+
assert_equal goodbye, svn.cat_file(OhlohScm::Commit.new(:token => 8), OhlohScm::Diff.new(:path => "goodbyeworld.c"))
|
17
17
|
|
18
18
|
# The next test asks for the file as it appeared before /branches/development was moved to /trunk,
|
19
19
|
# so this request requires traversal up the chain to the parent SvnAdapter.
|
20
|
-
assert_equal goodbye, svn.cat_file(
|
20
|
+
assert_equal goodbye, svn.cat_file(OhlohScm::Commit.new(:token => 5), OhlohScm::Diff.new(:path => "goodbyeworld.c"))
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/test/unit/svn_chain_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Parsers
|
4
|
-
class SvnChainTest <
|
4
|
+
class SvnChainTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_chain
|
7
7
|
with_svn_chain_repository('svn_with_branching', '/trunk') do |svn|
|
@@ -54,7 +54,7 @@ module OhlohScm::Parsers
|
|
54
54
|
def test_parent_branch_name
|
55
55
|
svn = OhlohScm::Adapters::SvnChainAdapter.new(:branch_name => "/trunk")
|
56
56
|
|
57
|
-
assert_equal "/branches/b", svn.parent_branch_name(
|
57
|
+
assert_equal "/branches/b", svn.parent_branch_name(OhlohScm::Diff.new(:action => 'A',
|
58
58
|
:path => "/trunk", :from_revision => 1, :from_path => "/branches/b"))
|
59
59
|
end
|
60
60
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class SvnCommitsTest <
|
4
|
+
class SvnCommitsTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_commits
|
7
7
|
with_svn_repository('svn') do |svn|
|
@@ -32,8 +32,8 @@ module OhlohScm::Adapters
|
|
32
32
|
# Given a commit with diffs, fill in all of the SHA1 values.
|
33
33
|
def test_populate_sha1
|
34
34
|
with_svn_repository('svn') do |svn|
|
35
|
-
c =
|
36
|
-
c.diffs = [
|
35
|
+
c = OhlohScm::Commit.new(:token => 3)
|
36
|
+
c.diffs = [OhlohScm::Diff.new(:path => "/trunk/helloworld.c", :action => "M")]
|
37
37
|
svn.populate_commit_sha1s!(c)
|
38
38
|
assert_equal 'f6adcae4447809b651c787c078d255b2b4e963c5', c.diffs.first.sha1
|
39
39
|
assert_equal '4c734ad53b272c9b3d719f214372ac497ff6c068', c.diffs.first.parent_sha1
|
@@ -42,7 +42,7 @@ module OhlohScm::Adapters
|
|
42
42
|
|
43
43
|
def test_strip_commit_branch
|
44
44
|
svn = SvnAdapter.new(:branch_name => "/trunk")
|
45
|
-
commit =
|
45
|
+
commit = OhlohScm::Commit.new
|
46
46
|
|
47
47
|
# nil diffs before => nil diffs after
|
48
48
|
assert !svn.strip_commit_branch(commit).diffs
|
@@ -52,19 +52,19 @@ module OhlohScm::Adapters
|
|
52
52
|
assert_equal [], svn.strip_commit_branch(commit).diffs
|
53
53
|
|
54
54
|
commit.diffs = [
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
OhlohScm::Diff.new(:path => "/trunk"),
|
56
|
+
OhlohScm::Diff.new(:path => "/trunk/helloworld.c"),
|
57
|
+
OhlohScm::Diff.new(:path => "/branches/a")
|
58
58
|
]
|
59
59
|
assert_equal ['', '/helloworld.c'], svn.strip_commit_branch(commit).diffs.collect { |d| d.path }.sort
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_strip_diff_branch
|
63
63
|
svn = SvnAdapter.new(:branch_name => "/trunk")
|
64
|
-
assert !svn.strip_diff_branch(
|
65
|
-
assert !svn.strip_diff_branch(
|
66
|
-
assert_equal '', svn.strip_diff_branch(
|
67
|
-
assert_equal '/helloworld.c', svn.strip_diff_branch(
|
64
|
+
assert !svn.strip_diff_branch(OhlohScm::Diff.new)
|
65
|
+
assert !svn.strip_diff_branch(OhlohScm::Diff.new(:path => "/branches/b"))
|
66
|
+
assert_equal '', svn.strip_diff_branch(OhlohScm::Diff.new(:path => "/trunk")).path
|
67
|
+
assert_equal '/helloworld.c', svn.strip_diff_branch(OhlohScm::Diff.new(:path => "/trunk/helloworld.c")).path
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_strip_path_branch
|
@@ -88,8 +88,8 @@ module OhlohScm::Adapters
|
|
88
88
|
|
89
89
|
def test_remove_dupes_add_modify
|
90
90
|
svn = SvnAdapter.new
|
91
|
-
c =
|
92
|
-
|
91
|
+
c = OhlohScm::Commit.new(:diffs => [ OhlohScm::Diff.new(:action => "A", :path => "foo"),
|
92
|
+
OhlohScm::Diff.new(:action => "M", :path => "foo") ])
|
93
93
|
|
94
94
|
svn.remove_dupes(c)
|
95
95
|
assert_equal 1, c.diffs.size
|
@@ -98,8 +98,8 @@ module OhlohScm::Adapters
|
|
98
98
|
|
99
99
|
def test_remove_dupes_add_replace
|
100
100
|
svn = SvnAdapter.new
|
101
|
-
c =
|
102
|
-
|
101
|
+
c = OhlohScm::Commit.new(:diffs => [ OhlohScm::Diff.new(:action => "R", :path => "foo"),
|
102
|
+
OhlohScm::Diff.new(:action => "A", :path => "foo") ])
|
103
103
|
|
104
104
|
svn.remove_dupes(c)
|
105
105
|
assert_equal 1, c.diffs.size
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class SvnConvertTest <
|
4
|
+
class SvnConvertTest < OhlohScm::Test
|
5
5
|
def test_basic_convert
|
6
6
|
with_svn_repository('svn') do |src|
|
7
|
-
|
7
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
8
8
|
dest = GitAdapter.new(:url => dest_dir).normalize
|
9
9
|
assert !dest.exist?
|
10
10
|
|
data/test/unit/svn_head_test.rb
CHANGED
data/test/unit/svn_misc_test.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class SvnMiscTest <
|
4
|
+
class SvnMiscTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_export
|
7
7
|
with_svn_repository('svn') do |svn|
|
8
|
-
|
8
|
+
OhlohScm::ScratchDir.new do |dir|
|
9
9
|
svn.export(dir)
|
10
10
|
assert_equal ['.','..','branches','tags','trunk'], Dir.entries(dir).sort
|
11
11
|
end
|
data/test/unit/svn_patch_test.rb
CHANGED
data/test/unit/svn_pull_test.rb
CHANGED
@@ -2,10 +2,10 @@ require_relative '../test_helper'
|
|
2
2
|
require 'socket'
|
3
3
|
|
4
4
|
module OhlohScm::Adapters
|
5
|
-
class SvnPullTest <
|
5
|
+
class SvnPullTest < OhlohScm::Test
|
6
6
|
|
7
7
|
def test_svnadmin_create
|
8
|
-
|
8
|
+
OhlohScm::ScratchDir.new do |dir|
|
9
9
|
url = File.join(dir, "my_svn_repo")
|
10
10
|
svn = SvnAdapter.new(:url => url).normalize
|
11
11
|
|
@@ -22,7 +22,7 @@ module OhlohScm::Adapters
|
|
22
22
|
|
23
23
|
def test_basic_pull_using_svnsync
|
24
24
|
with_svn_repository('svn') do |src|
|
25
|
-
|
25
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
26
26
|
|
27
27
|
dest = SvnAdapter.new(:url => dest_dir).normalize
|
28
28
|
assert !dest.exist?
|
@@ -36,7 +36,7 @@ module OhlohScm::Adapters
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_svnadmin_create_local
|
39
|
-
|
39
|
+
OhlohScm::ScratchDir.new do |dir|
|
40
40
|
svn = SvnAdapter.new(:url => "file://#{dir}")
|
41
41
|
svn.svnadmin_create_local
|
42
42
|
assert svn.exist?
|
@@ -47,7 +47,7 @@ module OhlohScm::Adapters
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def test_svnadmin_create_remote
|
50
|
-
|
50
|
+
OhlohScm::ScratchDir.new do |dir|
|
51
51
|
svn = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{dir}")
|
52
52
|
svn.svnadmin_create_remote
|
53
53
|
assert svn.exist?
|
data/test/unit/svn_push_test.rb
CHANGED
@@ -2,11 +2,11 @@ require_relative '../test_helper'
|
|
2
2
|
require 'socket'
|
3
3
|
|
4
4
|
module OhlohScm::Adapters
|
5
|
-
class SvnPushTest <
|
5
|
+
class SvnPushTest < OhlohScm::Test
|
6
6
|
|
7
7
|
def test_basic_push_using_svnsync
|
8
8
|
with_svn_repository('svn') do |src|
|
9
|
-
|
9
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
10
10
|
|
11
11
|
dest = SvnAdapter.new(:url => dest_dir).normalize
|
12
12
|
assert !dest.exist?
|
@@ -23,7 +23,7 @@ module OhlohScm::Adapters
|
|
23
23
|
# Simulates pushing to another server in our cluster.
|
24
24
|
def test_ssh_push_using_svnsync
|
25
25
|
with_svn_repository('svn') do |src|
|
26
|
-
|
26
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
27
27
|
|
28
28
|
dest = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{File.expand_path(dest_dir)}").normalize
|
29
29
|
assert !dest.exist?
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class SvnValidationTest <
|
4
|
+
class SvnValidationTest < OhlohScm::Test
|
5
5
|
def test_valid_usernames
|
6
6
|
[nil,'','joe_36','a'*32,'robin@ohloh.net'].each do |username|
|
7
7
|
assert !SvnAdapter.new(:username => username).validate_username
|
8
8
|
end
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def test_for_blank_svn_urls
|
12
12
|
svn = SvnAdapter.new(:url =>"")
|
13
13
|
assert_nil svn.path_to_file_url(svn.url)
|
@@ -167,7 +167,7 @@ module OhlohScm::Adapters
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def test_empty_branch_name_with_file_system
|
170
|
-
|
170
|
+
OhlohScm::ScratchDir.new do |dir|
|
171
171
|
svn = SvnAdapter.new(:url => dir).normalize
|
172
172
|
assert_equal '', svn.branch_name
|
173
173
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Parsers
|
4
|
-
class SvnXmlParserTest <
|
4
|
+
class SvnXmlParserTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_basic
|
7
7
|
assert_convert(SvnXmlParser, DATA_DIR + '/simple.svn_xml_log', DATA_DIR + '/simple.ohlog')
|
@@ -14,7 +14,7 @@ module OhlohScm::Parsers
|
|
14
14
|
def test_empty_xml
|
15
15
|
assert_equal("<?xml version=\"1.0\"?>\n<ohloh_log scm=\"svn\">\n</ohloh_log>\n", SvnXmlParser.parse('', :writer => XmlWriter.new))
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def test_copy_from
|
19
19
|
xml = <<-XML
|
20
20
|
<?xml version="1.0"?>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohloh_scm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: The Ohloh source control management library for interacting with Git,
|
15
15
|
SVN, CVS, Hg and Bzr repositories.
|