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
@@ -1,10 +1,10 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class GitCommitAllTest <
|
4
|
+
class GitCommitAllTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_commit_all
|
7
|
-
|
7
|
+
OhlohScm::ScratchDir.new do |dir|
|
8
8
|
git = GitAdapter.new(:url => dir).normalize
|
9
9
|
|
10
10
|
git.init_db
|
@@ -13,7 +13,7 @@ module OhlohScm::Adapters
|
|
13
13
|
File.open(File.join(dir, 'README'), 'w') {}
|
14
14
|
assert git.anything_to_commit?
|
15
15
|
|
16
|
-
c =
|
16
|
+
c = OhlohScm::Commit.new
|
17
17
|
c.author_name = "John Q. Developer"
|
18
18
|
c.message = "Initial checkin."
|
19
19
|
git.commit_all(c)
|
data/test/unit/git_head_test.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative '../test_helper'
|
|
2
2
|
require 'date'
|
3
3
|
|
4
4
|
module OhlohScm::Parsers
|
5
|
-
class GitStyledParserTest <
|
5
|
+
class GitStyledParserTest < OhlohScm::Test
|
6
6
|
|
7
7
|
def test_basic
|
8
8
|
commits = []
|
@@ -187,7 +187,7 @@ __END_COMMENT__
|
|
187
187
|
|
188
188
|
__BEGIN_COMMIT__
|
189
189
|
Commit: fa3ee9d4cefc2db81adadf36da9cacbe92ce96f1
|
190
|
-
Author:
|
190
|
+
Author:
|
191
191
|
AuthorEmail: mickeyl@openembedded.org
|
192
192
|
Date: Wed, 11 Jun 2008 00:37:06 +0000
|
193
193
|
__BEGIN_COMMENT__
|
data/test/unit/git_misc_test.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class GitMiscTest <
|
4
|
+
class GitMiscTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_export
|
7
7
|
with_git_repository('git') do |git|
|
8
|
-
|
8
|
+
OhlohScm::ScratchDir.new do |dir|
|
9
9
|
git.export(dir)
|
10
10
|
assert_equal ['.','..','.gitignore','COPYING','README','helloworld.c','makefile','ohloh_token'], Dir.entries(dir).sort
|
11
11
|
end
|
@@ -27,8 +27,8 @@ module OhlohScm::Adapters
|
|
27
27
|
|
28
28
|
def test_is_merge_commit
|
29
29
|
with_git_repository('git_walk') do |git|
|
30
|
-
assert git.is_merge_commit?(
|
31
|
-
assert !git.is_merge_commit?(
|
30
|
+
assert git.is_merge_commit?(OhlohScm::Commit.new(:token => 'f264fb40c340a415b305ac1f0b8f12502aa2788f'))
|
31
|
+
assert !git.is_merge_commit?(OhlohScm::Commit.new(:token => 'd067161caae2eeedbd74976aeff5c4d8f1ccc946'))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
data/test/unit/git_patch_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class GitPatchTest <
|
4
|
+
class GitPatchTest < OhlohScm::Test
|
5
5
|
def test_patch_for_commit
|
6
6
|
with_git_repository('git') do |repo|
|
7
7
|
commit = repo.verbose_commit('b6e9220c3cabe53a4ed7f32952aeaeb8a822603d')
|
data/test/unit/git_pull_test.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class GitPullTest <
|
4
|
+
class GitPullTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_basic_pull
|
7
7
|
with_git_repository('git') do |src|
|
8
|
-
|
8
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
9
9
|
|
10
10
|
dest = GitAdapter.new(:url => dest_dir).normalize
|
11
11
|
assert !dest.exist?
|
data/test/unit/git_push_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class GitPushTest <
|
4
|
+
class GitPushTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_hostname
|
7
7
|
assert_equal "foo", GitAdapter.new(:url => 'foo:/bar').hostname
|
@@ -23,7 +23,7 @@ module OhlohScm::Adapters
|
|
23
23
|
|
24
24
|
def test_basic_push
|
25
25
|
with_git_repository('git') do |src|
|
26
|
-
|
26
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
27
27
|
|
28
28
|
dest = GitAdapter.new(:url => dest_dir).normalize
|
29
29
|
assert !dest.exist?
|
@@ -34,7 +34,7 @@ module OhlohScm::Adapters
|
|
34
34
|
|
35
35
|
# Now push again. This tests a different code path!
|
36
36
|
File.open(File.join(src.url, 'foo'), 'w') { }
|
37
|
-
src.commit_all(
|
37
|
+
src.commit_all(OhlohScm::Commit.new)
|
38
38
|
|
39
39
|
src.push(dest)
|
40
40
|
assert dest.exist?
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Parsers
|
4
|
-
class GitStyledParserTest <
|
4
|
+
class GitStyledParserTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_empty_array
|
7
7
|
assert_equal([], GitStyledParser.parse(''))
|
@@ -13,13 +13,13 @@ __BEGIN_COMMIT__
|
|
13
13
|
Commit: 1df547800dcd168e589bb9b26b4039bff3a7f7e4
|
14
14
|
Author: Jason Allen
|
15
15
|
AuthorEmail: jason@ohloh.net
|
16
|
-
Date:
|
16
|
+
Date:
|
17
17
|
__BEGIN_COMMENT__
|
18
18
|
moving COPYING
|
19
19
|
|
20
20
|
__END_COMMENT__
|
21
21
|
SAMPLE
|
22
|
-
|
22
|
+
|
23
23
|
commits = GitStyledParser.parse(sample_log)
|
24
24
|
assert_equal 1, commits.size
|
25
25
|
assert_equal Time.utc(1970,1,1,0,0,0), commits[0].author_date
|
@@ -37,7 +37,7 @@ __BEGIN_COMMENT__
|
|
37
37
|
|
38
38
|
__END_COMMENT__
|
39
39
|
SAMPLE
|
40
|
-
|
40
|
+
|
41
41
|
commits = GitStyledParser.parse(sample_log)
|
42
42
|
assert_equal 1, commits.size
|
43
43
|
assert_equal Time.utc(1970,1,1,0,0,0), commits[0].author_date
|
data/test/unit/git_token_test.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class GitTokenTest <
|
4
|
+
class GitTokenTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_no_token_returns_nil
|
7
|
-
|
7
|
+
OhlohScm::ScratchDir.new do |dir|
|
8
8
|
git = GitAdapter.new(:url => dir).normalize
|
9
9
|
assert !git.read_token
|
10
10
|
git.init_db
|
@@ -13,21 +13,21 @@ module OhlohScm::Adapters
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_write_and_read_token
|
16
|
-
|
16
|
+
OhlohScm::ScratchDir.new do |dir|
|
17
17
|
git = GitAdapter.new(:url => dir).normalize
|
18
18
|
git.init_db
|
19
19
|
git.write_token("FOO")
|
20
20
|
assert !git.read_token # Token not valid until committed
|
21
|
-
git.commit_all(
|
21
|
+
git.commit_all(OhlohScm::Commit.new)
|
22
22
|
assert_equal "FOO", git.read_token
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_commit_all_includes_write_token
|
27
|
-
|
27
|
+
OhlohScm::ScratchDir.new do |dir|
|
28
28
|
git = GitAdapter.new(:url => dir).normalize
|
29
29
|
git.init_db
|
30
|
-
c =
|
30
|
+
c = OhlohScm::Commit.new
|
31
31
|
c.token = "BAR"
|
32
32
|
git.commit_all(c)
|
33
33
|
assert_equal c.token, git.read_token
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class GitValidationTest <
|
4
|
+
class GitValidationTest < OhlohScm::Test
|
5
5
|
def test_rejected_urls
|
6
6
|
[ nil, "", "foo", "http:/", "http:://", "http://", "http://a",
|
7
7
|
"kernel.org/linux/linux.git", # missing a protocol prefix
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class HgCatFileTest <
|
4
|
+
class HgCatFileTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_cat_file
|
7
7
|
with_hg_repository('hg') do |hg|
|
@@ -21,15 +21,15 @@ main()
|
|
21
21
|
EXPECTED
|
22
22
|
|
23
23
|
# The file was deleted in revision 468336c6671c. Check that it does not exist now, but existed in parent.
|
24
|
-
assert_equal nil, hg.cat_file(
|
25
|
-
assert_equal expected, hg.cat_file_parent(
|
26
|
-
assert_equal expected, hg.cat_file(
|
24
|
+
assert_equal nil, hg.cat_file(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
|
25
|
+
assert_equal expected, hg.cat_file_parent(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
|
26
|
+
assert_equal expected, hg.cat_file(OhlohScm::Commit.new(:token => '468336c6671c'), OhlohScm::Diff.new(:path => 'helloworld.c'))
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
# Ensure that we escape bash-significant characters like ' and & when they appear in the filename
|
31
31
|
def test_funny_file_name_chars
|
32
|
-
|
32
|
+
OhlohScm::ScratchDir.new do |dir|
|
33
33
|
# Make a file with a problematic filename
|
34
34
|
funny_name = '#|file_name` $(&\'")#'
|
35
35
|
File.open(File.join(dir, funny_name), 'w') { |f| f.write "contents" }
|
@@ -39,7 +39,7 @@ EXPECTED
|
|
39
39
|
|
40
40
|
# Confirm that we can read the file back
|
41
41
|
hg = HgAdapter.new(:url => dir).normalize
|
42
|
-
assert_equal "contents", hg.cat_file(hg.head,
|
42
|
+
assert_equal "contents", hg.cat_file(hg.head, OhlohScm::Diff.new(:path => funny_name))
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
data/test/unit/hg_head_test.rb
CHANGED
data/test/unit/hg_misc_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class HgMiscTest <
|
4
|
+
class HgMiscTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_exist
|
7
7
|
save_hg = nil
|
@@ -20,7 +20,7 @@ module OhlohScm::Adapters
|
|
20
20
|
|
21
21
|
def test_export
|
22
22
|
with_hg_repository('hg') do |hg|
|
23
|
-
|
23
|
+
OhlohScm::ScratchDir.new do |dir|
|
24
24
|
hg.export(dir)
|
25
25
|
assert_equal ['.', '..', 'README', 'makefile'], Dir.entries(dir).sort
|
26
26
|
end
|
data/test/unit/hg_parser_test.rb
CHANGED
data/test/unit/hg_patch_test.rb
CHANGED
data/test/unit/hg_pull_test.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class HgPullTest <
|
4
|
+
class HgPullTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_pull
|
7
7
|
with_hg_repository('hg') do |src|
|
8
|
-
|
8
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
9
9
|
|
10
10
|
dest = HgAdapter.new(:url => dest_dir).normalize
|
11
11
|
assert !dest.exist?
|
data/test/unit/hg_push_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class HgPushTest <
|
4
|
+
class HgPushTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_hostname
|
7
7
|
assert !HgAdapter.new.hostname
|
@@ -36,7 +36,7 @@ module OhlohScm::Adapters
|
|
36
36
|
|
37
37
|
def test_push
|
38
38
|
with_hg_repository('hg') do |src|
|
39
|
-
|
39
|
+
OhlohScm::ScratchDir.new do |dest_dir|
|
40
40
|
|
41
41
|
dest = HgAdapter.new(:url => dest_dir).normalize
|
42
42
|
assert !dest.exist?
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class HgValidationTest <
|
4
|
+
class HgValidationTest < OhlohScm::Test
|
5
5
|
def test_rejected_urls
|
6
6
|
[ nil, "", "foo", "http:/", "http:://", "http://", "http://a",
|
7
7
|
"www.selenic.com/repo/hello", # missing a protool prefix
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
2
|
|
3
3
|
module OhlohScm::Adapters
|
4
|
-
class HglibCatFileTest <
|
4
|
+
class HglibCatFileTest < OhlohScm::Test
|
5
5
|
|
6
6
|
def test_cat_file
|
7
7
|
with_hglib_repository('hg') do |hg|
|
@@ -21,15 +21,15 @@ main()
|
|
21
21
|
EXPECTED
|
22
22
|
|
23
23
|
# The file was deleted in revision 468336c6671c. Check that it does not exist now, but existed in parent.
|
24
|
-
assert_equal nil, hg.cat_file(
|
25
|
-
assert_equal expected, hg.cat_file_parent(
|
26
|
-
assert_equal expected, hg.cat_file(
|
24
|
+
assert_equal nil, hg.cat_file(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
|
25
|
+
assert_equal expected, hg.cat_file_parent(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
|
26
|
+
assert_equal expected, hg.cat_file(OhlohScm::Commit.new(:token => '468336c6671c'), OhlohScm::Diff.new(:path => 'helloworld.c'))
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
# Ensure that we escape bash-significant characters like ' and & when they appear in the filename
|
31
31
|
def test_funny_file_name_chars
|
32
|
-
|
32
|
+
OhlohScm::ScratchDir.new do |dir|
|
33
33
|
# Make a file with a problematic filename
|
34
34
|
funny_name = '#|file_name` $(&\'")#'
|
35
35
|
File.open(File.join(dir, funny_name), 'w') { |f| f.write "contents" }
|
@@ -39,7 +39,7 @@ EXPECTED
|
|
39
39
|
|
40
40
|
# Confirm that we can read the file back
|
41
41
|
hg = HglibAdapter.new(:url => dir).normalize
|
42
|
-
assert_equal "contents", hg.cat_file(hg.head,
|
42
|
+
assert_equal "contents", hg.cat_file(hg.head, OhlohScm::Diff.new(:path => funny_name))
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|