ohloh_scm 3.0.6 → 3.0.11
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.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +0 -15
- data/lib/ohloh_scm/bzr/activity.rb +1 -1
- data/lib/ohloh_scm/git/scm.rb +6 -10
- data/lib/ohloh_scm/git/validation.rb +7 -1
- data/lib/ohloh_scm/git_svn/activity.rb +4 -4
- data/lib/ohloh_scm/version.rb +1 -1
- data/spec/ohloh_scm/git/scm_spec.rb +0 -1
- data/spec/ohloh_scm/git/validation_spec.rb +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb22e846629bf5c28b1fe9cff788eaf8911e2fff2084909bdade85271540822c
|
4
|
+
data.tar.gz: 15337965a2be09e7bb21a3cac07d5124f9142dee4bb34aee3c9f55b008010f3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c50fdce652b21742d4d73e0ec8c800cdbca176f9e464d5ad2ad9ca7c85bff6cb44581cbe7ad8996d481999ac30a2ace6a860054f8a4d09bb29ee1a5f0a34bacf
|
7
|
+
data.tar.gz: 1bfc619bb9eb7b43d11c6403ba763a1e1878b02c849067226fd42773e81a822625002f595814105f84c9826a633cb352fd715c9edc2d3b6e769512f2821df42d
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,7 +3,6 @@ GEM
|
|
3
3
|
specs:
|
4
4
|
ast (2.4.0)
|
5
5
|
byebug (11.0.1)
|
6
|
-
diff-lcs (1.3)
|
7
6
|
docile (1.3.1)
|
8
7
|
jaro_winkler (1.5.2)
|
9
8
|
json (2.2.0)
|
@@ -20,19 +19,6 @@ GEM
|
|
20
19
|
psych (3.1.0)
|
21
20
|
rainbow (3.0.0)
|
22
21
|
rake (12.3.2)
|
23
|
-
rspec (3.8.0)
|
24
|
-
rspec-core (~> 3.8.0)
|
25
|
-
rspec-expectations (~> 3.8.0)
|
26
|
-
rspec-mocks (~> 3.8.0)
|
27
|
-
rspec-core (3.8.2)
|
28
|
-
rspec-support (~> 3.8.0)
|
29
|
-
rspec-expectations (3.8.4)
|
30
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
-
rspec-support (~> 3.8.0)
|
32
|
-
rspec-mocks (3.8.1)
|
33
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.8.0)
|
35
|
-
rspec-support (3.8.2)
|
36
22
|
rubocop (0.67.2)
|
37
23
|
jaro_winkler (~> 1.5.1)
|
38
24
|
parallel (~> 1.10)
|
@@ -60,7 +46,6 @@ DEPENDENCIES
|
|
60
46
|
mocha
|
61
47
|
nokogiri
|
62
48
|
rake
|
63
|
-
rspec
|
64
49
|
rubocop (~> 0.67)
|
65
50
|
rubocop-performance
|
66
51
|
simplecov
|
@@ -23,7 +23,7 @@ module OhlohScm
|
|
23
23
|
# rubocop:enable Metrics/MethodLength
|
24
24
|
|
25
25
|
def export_tag(dest_dir, tag_name)
|
26
|
-
run "cd '#{
|
26
|
+
run "cd '#{url}' && bzr export -r #{tag_name} #{dest_dir}"
|
27
27
|
end
|
28
28
|
|
29
29
|
def export(dest_dir, token = head_token)
|
data/lib/ohloh_scm/git/scm.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module OhlohScm
|
4
4
|
module Git
|
5
|
-
class Scm < OhlohScm::Scm
|
5
|
+
class Scm < OhlohScm::Scm
|
6
6
|
def initialize(core:, url:, branch_name:, username:, password:)
|
7
7
|
super
|
8
8
|
@branch_name = branch_name || 'master'
|
@@ -27,7 +27,7 @@ module OhlohScm
|
|
27
27
|
|
28
28
|
def clone_or_fetch(remote_scm, callback)
|
29
29
|
callback.update(0, 1)
|
30
|
-
if status.branch?(branch_name)
|
30
|
+
if status.exist? && status.branch?(branch_name)
|
31
31
|
clean_and_checkout_branch # must be on correct branch, but we want to be careful.
|
32
32
|
fetch_new_commits(remote_scm)
|
33
33
|
else
|
@@ -43,7 +43,7 @@ module OhlohScm
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def clone_and_create_tracking_branch(remote_scm)
|
46
|
-
unless status.scm_dir_exist?
|
46
|
+
unless status.scm_dir_exist? || status.exist?
|
47
47
|
run "rm -rf '#{url}'"
|
48
48
|
run "git clone -q -n '#{remote_scm.url}' '#{url}'"
|
49
49
|
end
|
@@ -54,16 +54,12 @@ module OhlohScm
|
|
54
54
|
# We need very high reliability and this sequence gets the job done every time.
|
55
55
|
def clean_and_checkout_branch
|
56
56
|
return unless status.scm_dir_exist?
|
57
|
-
return unless status.branch?(branch_name)
|
58
57
|
|
59
58
|
run "cd '#{url}' && git clean -f -d -x"
|
60
|
-
|
61
|
-
run "cd '#{url}' && git reset --hard HEAD"
|
62
|
-
run "cd '#{url}' && git checkout #{branch_name} --"
|
63
|
-
end
|
59
|
+
return unless status.branch?(branch_name)
|
64
60
|
|
65
|
-
|
66
|
-
run "
|
61
|
+
run "cd '#{url}' && git checkout #{branch_name} --"
|
62
|
+
run "cd '#{url}' && git reset --hard heads/#{branch_name} --"
|
67
63
|
end
|
68
64
|
|
69
65
|
def create_tracking_branch(branch_name)
|
@@ -3,10 +3,16 @@
|
|
3
3
|
module OhlohScm
|
4
4
|
module Git
|
5
5
|
class Validation < OhlohScm::Validation
|
6
|
+
def validate
|
7
|
+
super
|
8
|
+
@errors << [:branch_name, 'Invalid Branch Name.'] if scm.branch_name.to_s.empty?
|
9
|
+
end
|
10
|
+
|
6
11
|
private
|
7
12
|
|
8
13
|
def validate_server_connection
|
9
|
-
msg = "The server did not respond to the 'git-ls-remote' command.
|
14
|
+
msg = "The server did not respond to the 'git-ls-remote' command."
|
15
|
+
msg << ' Are the URL and Branch fields correct?'
|
10
16
|
@errors << [:failed, msg] unless status.exist?
|
11
17
|
end
|
12
18
|
|
@@ -40,6 +40,10 @@ module OhlohScm
|
|
40
40
|
cat("#{git_commit(commit)}^", diff.path)
|
41
41
|
end
|
42
42
|
|
43
|
+
def git_commit(commit)
|
44
|
+
run("cd #{url} && git svn find-rev r#{commit.token}").strip
|
45
|
+
end
|
46
|
+
|
43
47
|
private
|
44
48
|
|
45
49
|
def open_log_file(opts = {})
|
@@ -72,10 +76,6 @@ module OhlohScm
|
|
72
76
|
run("cd #{url} && git show #{revision}:#{file_path.shellescape}").strip
|
73
77
|
end
|
74
78
|
|
75
|
-
def git_commit(commit)
|
76
|
-
run("cd #{url} && git svn find-rev r#{commit.token}").strip
|
77
|
-
end
|
78
|
-
|
79
79
|
def git_svn_log_cmd
|
80
80
|
"cd #{url} && git svn log"
|
81
81
|
end
|
data/lib/ohloh_scm/version.rb
CHANGED
@@ -7,6 +7,10 @@ describe 'Git::Validation' do
|
|
7
7
|
core.errors.must_be :empty?
|
8
8
|
end
|
9
9
|
|
10
|
+
it 'must have errors for no branch_name' do
|
11
|
+
get_core(:git, branch_name: '').validation.send(:branch_name_errors).wont_be :empty?
|
12
|
+
end
|
13
|
+
|
10
14
|
it 'must have errors for invalid branch_name' do
|
11
15
|
get_core(:git, branch_name: 'x' * 81).validation.send(:branch_name_errors).wont_be :empty?
|
12
16
|
get_core(:git, branch_name: 'foo@bar').validation.send(:branch_name_errors).wont_be :empty?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohloh_scm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenHub Team at Synopsys
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
The OpenHub source control management library for \
|
@@ -190,7 +190,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
|
-
|
193
|
+
rubyforge_project:
|
194
|
+
rubygems_version: 2.7.6
|
194
195
|
signing_key:
|
195
196
|
specification_version: 4
|
196
197
|
summary: Source Control Management
|