ohloh_scm 2.4.14 → 2.5.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.
- checksums.yaml +4 -4
- data/.travis.yml +5 -14
- data/Dockerfile +31 -0
- data/README.md +44 -25
- data/Rakefile +2 -3
- data/lib/ohloh_scm/adapters/bzr/misc.rb +1 -1
- data/lib/ohloh_scm/adapters/hg/commits.rb +7 -3
- data/lib/ohloh_scm/adapters/hg/head.rb +1 -1
- data/lib/ohloh_scm/adapters/hg/misc.rb +6 -0
- data/lib/ohloh_scm/version.rb +1 -1
- data/test/data/svn_patch.diff +1 -1
- data/test/unit/hg_commits_test.rb +6 -0
- data/test/unit/hg_rev_list_test.rb +3 -3
- data/test/unit/svn_misc_test.rb +1 -1
- data/test/unit/svn_pull_test.rb +1 -1
- data/test/unit/svn_push_test.rb +1 -1
- data/test/unit/svn_validation_test.rb +1 -1
- metadata +3 -5
- data/.travis/.install_dependencies.sh +0 -15
- data/.travis/.install_multiple_scms.sh +0 -6
- data/.travis/.travis_ssh_setup.sh +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aabc469e74657337d3401366c824c144fd4b569
|
4
|
+
data.tar.gz: 2f34967d29e05c980b5c6acc43a10d9f36bcf3a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45e426c1379169bdffcee9683d84bbf6428eb55c727e869c75e6e4b23195aa045e109bbb9be0956ed27b9dd4afb729cdc17c327b842df4692b23910bd688a051
|
7
|
+
data.tar.gz: 30d48db3b286541d580e59a1d432b5bce19808c7ce92b2b322e69ecbbdd746af6e1ca18bccd29a41e4a3c2dafa61df778463c1a2864238bcf545835c43a8d2ff
|
data/.travis.yml
CHANGED
@@ -1,15 +1,6 @@
|
|
1
|
-
language:
|
2
|
-
|
3
|
-
-
|
1
|
+
language: generic
|
2
|
+
services:
|
3
|
+
- docker
|
4
4
|
before_install:
|
5
|
-
-
|
6
|
-
|
7
|
-
install:
|
8
|
-
- sh .install_multiple_scms.sh
|
9
|
-
- sh .install_dependencies.sh
|
10
|
-
- gem install posix-spawn
|
11
|
-
- gem install nokogiri -v 1.8.1
|
12
|
-
- gem install test-unit -v 3.2.7
|
13
|
-
- sudo apt-get install expect
|
14
|
-
before_script:
|
15
|
-
- cd $TRAVIS_BUILD_DIR
|
5
|
+
- docker pull notalex/ohloh_scm:ubuntu18
|
6
|
+
script: docker run -P -w /home/app/ohloh_scm -v $(pwd):/home/app/ohloh_scm -ti notalex/ohloh_scm:ubuntu18 /bin/sh -c "/etc/init.d/ssh start; LANG=en_US.UTF-8 rake test 2> /dev/null"
|
data/Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
FROM ubuntu:18.04
|
2
|
+
MAINTAINER OpenHub <info@openhub.net>
|
3
|
+
|
4
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
5
|
+
|
6
|
+
RUN apt-get update
|
7
|
+
RUN apt-get install -y build-essential software-properties-common locales
|
8
|
+
RUN locale-gen en_US.UTF-8
|
9
|
+
|
10
|
+
RUN apt-add-repository -y ppa:brightbox/ruby-ng
|
11
|
+
RUN apt-get update
|
12
|
+
RUN apt-get install -y ruby2.3 ruby2.3-dev
|
13
|
+
|
14
|
+
RUN apt-get install -y ragel libxml2-dev libpcre3 libpcre3-dev swig gperf openssh-server expect
|
15
|
+
RUN apt-get install -y git git-svn subversion cvs mercurial bzr
|
16
|
+
|
17
|
+
RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa
|
18
|
+
RUN cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
|
19
|
+
RUN echo 'StrictHostKeyChecking no' >> ~/.ssh/config
|
20
|
+
|
21
|
+
RUN mkdir -p ~/.bazaar/plugins
|
22
|
+
RUN cd ~/.bazaar/plugins
|
23
|
+
RUN bzr branch lp:bzr-xmloutput ~/.bazaar/plugins/xmloutput
|
24
|
+
|
25
|
+
RUN ln -s /usr/bin/cvs /usr/bin/cvsnt
|
26
|
+
|
27
|
+
RUN gem install posix-spawn -v '~> 0.3'
|
28
|
+
RUN gem install nokogiri -v '~> 1.8'
|
29
|
+
RUN gem install rake test-unit byebug
|
30
|
+
|
31
|
+
RUN mkdir -p /home/app/ohloh_scm
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
[](https://www.openhub.net/p/ohloh_scm) [](https://travis-ci.org/blackducksoftware/ohloh_scm)
|
2
2
|
|
3
3
|
# Ohloh SCM
|
4
4
|
|
5
|
-
The
|
5
|
+
The OpenHub source control management library
|
6
6
|
|
7
7
|
This program is free software; you can redistribute it and/or modify
|
8
8
|
it under the terms of the GNU General Public License Version 2 as
|
@@ -24,27 +24,30 @@ Ohloh SCM is an abstraction layer for source control management systems,
|
|
24
24
|
allowing an application to interoperate with various SCMs using a
|
25
25
|
single interface.
|
26
26
|
|
27
|
-
It was originally developed at
|
28
|
-
the reports at www.
|
27
|
+
It was originally developed at OpenHub, and is used to generate
|
28
|
+
the reports at www.openhub.net.
|
29
29
|
|
30
30
|
## System Requirements
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
One could use the bundled Dockerfile to test Ohloh SCM in a container and skip
|
33
|
+
this section entirely. See [docker](https://github.com/blackducksoftware/ohloh_scm/#using-docker).
|
34
|
+
|
35
|
+
Ohloh SCM is developed on Mac OS X 10.13.6(High Sierra) and Ubuntu 18.04 LTS.
|
36
|
+
Other Linux environments should also work, but your mileage may vary.
|
34
37
|
|
35
38
|
Ohloh SCM does not support Windows.
|
36
39
|
|
37
|
-
Ohloh SCM targets Ruby
|
40
|
+
Ohloh SCM targets Ruby 2.3 and Rake 12.3.
|
38
41
|
|
39
42
|
Ohloh SCM interfaces with CVSNT, Subversion, Git and Mercurial through the
|
40
|
-
shell.
|
41
|
-
and on your path. Ohloh
|
42
|
-
totally unsupported at this time:
|
43
|
+
shell. In order to pass the unit tests, all three systems must be installed
|
44
|
+
and on your path. Ohloh is currently tested on the following versions:
|
43
45
|
|
44
|
-
cvsnt 2.5.03
|
45
|
-
svn 1.
|
46
|
-
git
|
47
|
-
hg
|
46
|
+
cvsnt 2.5.03
|
47
|
+
svn 1.9.7
|
48
|
+
git 2.17.1
|
49
|
+
hg 4.5.3
|
50
|
+
bzr 2.8.0
|
48
51
|
|
49
52
|
If you are using CVS instead of CVSNT, you can potentially try creating
|
50
53
|
a shell alias or symlink mapping 'cvsnt' to 'cvs'.
|
@@ -72,7 +75,7 @@ Ensure that cvsnt, svn, svnadmin, svnsync, git, and hg are all on your path. You
|
|
72
75
|
$ mkdir plugins
|
73
76
|
$ cd plugins
|
74
77
|
|
75
|
-
Now checkout the latest version of the xmloutput plugin (0.8.8 as of 11/21/2011).
|
78
|
+
Now checkout the latest version of the xmloutput plugin (0.8.8 as of 11/21/2011).
|
76
79
|
|
77
80
|
$ bzr branch lp:~amujumdar/bzr-xmloutput/emit_authors
|
78
81
|
|
@@ -97,9 +100,28 @@ Then you can run the unit tests:
|
|
97
100
|
|
98
101
|
You can load the library into your own Ruby application by requiring lib/ohloh_scm.rb.
|
99
102
|
|
103
|
+
## Using Docker
|
104
|
+
|
105
|
+
One may use Docker to run Ohloh SCM and test changes.
|
106
|
+
|
107
|
+
```sh
|
108
|
+
$ git clone https://github.com/blackducksoftware/ohloh_scm
|
109
|
+
$ cd ohloh_scm
|
110
|
+
|
111
|
+
# To run all tests, we need to start the ssh server and set UTF-8 locale for encoding tests.
|
112
|
+
$ cmd='/etc/init.d/ssh start; LANG=en_US.UTF-8 rake test 2> /dev/null'
|
113
|
+
$ docker run -P -w /home/app/ohloh_scm -v $(pwd):/home/app/ohloh_scm -ti notalex/ohloh_scm:ubuntu18 /bin/sh -c "$cmd"
|
114
|
+
# This mounts the current folder into the docker container;
|
115
|
+
# hence any edits made in ohloh_scm on the host machine would reflect in the container.
|
116
|
+
|
117
|
+
# One may also edit the Dockerfile & build the image locally for other distros.
|
118
|
+
$ docker build -t ohloh_scm:custom .
|
119
|
+
$ docker run -ti ohloh_scm:custom -v $(pwd):/home/app/ohloh_scm /bin/bash
|
120
|
+
```
|
121
|
+
|
100
122
|
# Functionality
|
101
123
|
|
102
|
-
For each tracked repository,
|
124
|
+
For each tracked repository, OpenHub uses the SCM library to maintain a private
|
103
125
|
local mirror. The SCM library hides the differences between source control
|
104
126
|
systems. The SCM library manages all required updates to a mirror, and reports
|
105
127
|
the contents of the mirror in standardized ways.
|
@@ -109,15 +131,15 @@ store any content it desires in that directory. Usually, it's a direct clone of
|
|
109
131
|
the original repository, but in the case of CVS or some Subversion servers, it
|
110
132
|
is a conversion of the original repository to Git.
|
111
133
|
|
112
|
-
The main
|
134
|
+
The main OpenHub application orchestrates the scheduling of all updates and
|
113
135
|
backups. On demand, the SCM library adapter then performs the following basic
|
114
136
|
tasks on the local mirror:
|
115
137
|
|
116
138
|
1. Pull changes -- From a remote repository URL, pull any changes to the local
|
117
139
|
mirror. This step may involve conversion from one system to another.
|
118
|
-
2. Push changes -- From the local mirror, push any changes to another
|
140
|
+
2. Push changes -- From the local mirror, push any changes to another OpenHub
|
119
141
|
server. This is required to create backup copies and perform load balancing on
|
120
|
-
the
|
142
|
+
the OpenHub cluster, and typically occurs over ssh.
|
121
143
|
3. Commit log -- Given the last known commit, report the list of new commits,
|
122
144
|
if any, including their diffs.
|
123
145
|
4. Cat file or parent -- Given a commit, return either the contents of a
|
@@ -128,10 +150,7 @@ to a specified temp directory.
|
|
128
150
|
The adapter must also implement validation routines used to filter user inputs
|
129
151
|
and confirm the presence of the remote server.
|
130
152
|
|
131
|
-
# Contact
|
132
|
-
|
133
|
-
For more information visit the Ohloh website:
|
134
|
-
[Ohloh Labs](http://labs.ohloh.net)
|
153
|
+
# Contact OpenHub
|
135
154
|
|
136
|
-
You can reach
|
137
|
-
[info@
|
155
|
+
You can reach OpenHub via email at:
|
156
|
+
[info@openhub.net](mailto:info@openhub.net)
|
data/Rakefile
CHANGED
@@ -26,9 +26,8 @@ Gem::PackageTask.new(spec) do |pkg|
|
|
26
26
|
pkg.need_zip = true
|
27
27
|
end
|
28
28
|
|
29
|
-
Rake::TestTask.new :
|
29
|
+
Rake::TestTask.new :test do |t|
|
30
30
|
t.test_files = FileList[File.dirname(__FILE__) + '/test/unit/**/*_test.rb']
|
31
31
|
end
|
32
32
|
|
33
|
-
task :default => :
|
34
|
-
|
33
|
+
task :default => :test
|
@@ -14,6 +14,10 @@ module OhlohScm::Adapters
|
|
14
14
|
# Basically, we're trying very hard to make this act just like Git. The hg_rev_list_test checks this.
|
15
15
|
tokens = run("cd '#{self.url}' && #{ hg_log_with_opts } --template='{node}\\n'").split("\n").reverse
|
16
16
|
|
17
|
+
# Since hg v4, --follow-first does not play well with -r N:n. Using them together always returns all commits.
|
18
|
+
# To find trunk commits since a given revision, we get all trunk commits and drop older commits before given revision.
|
19
|
+
tokens = tokens.drop(tokens.index(after)) if tokens.any? && after && after != 0
|
20
|
+
|
17
21
|
# Hg returns everything after *and including* after.
|
18
22
|
# We want to exclude it.
|
19
23
|
if tokens.any? && tokens.first == after
|
@@ -96,13 +100,13 @@ module OhlohScm::Adapters
|
|
96
100
|
up_to = opts[:up_to] || :tip
|
97
101
|
|
98
102
|
options = if opts[:trunk_only]
|
99
|
-
|
103
|
+
'--follow-first'
|
100
104
|
else
|
101
|
-
query = "and (branch(#{
|
105
|
+
query = "and (branch(#{ branch_name_or_default }) or ancestors(#{ branch_name_or_default }))"
|
102
106
|
"-r '#{ up_to }:#{ after } #{ query }'"
|
103
107
|
end
|
104
108
|
|
105
|
-
["hg log -
|
109
|
+
["hg log -v #{ options }", after]
|
106
110
|
end
|
107
111
|
end
|
108
112
|
end
|
@@ -3,7 +3,7 @@ module OhlohScm::Adapters
|
|
3
3
|
def head_token
|
4
4
|
# This only returns first 12 characters.
|
5
5
|
# How can we make it return the entire hash?
|
6
|
-
branch_opts = "--rev #{
|
6
|
+
branch_opts = "--rev #{branch_name_or_default}"
|
7
7
|
token = run("hg id --debug -i -q #{url} #{branch_opts}").strip
|
8
8
|
|
9
9
|
# Recent versions of Hg now somtimes append a '+' char to the token.
|
data/lib/ohloh_scm/version.rb
CHANGED
data/test/data/svn_patch.diff
CHANGED
@@ -29,6 +29,12 @@ module OhlohScm::Adapters
|
|
29
29
|
'75532c1e1f1de55c2271f6fd29d98efbe35397c4',
|
30
30
|
'655f04cf6ad708ab58c7b941672dce09dd369a18'], hg.commit_tokens
|
31
31
|
|
32
|
+
assert_equal ['b14fa4692f949940bd1e28da6fb4617de2615484',
|
33
|
+
'468336c6671cbc58237a259d1b7326866afc2817',
|
34
|
+
'75532c1e1f1de55c2271f6fd29d98efbe35397c4',
|
35
|
+
'655f04cf6ad708ab58c7b941672dce09dd369a18'],
|
36
|
+
hg.commit_tokens(after: '01101d8ef3cea7da9ac6e9a226d645f4418f05c9')
|
37
|
+
|
32
38
|
assert_equal ['655f04cf6ad708ab58c7b941672dce09dd369a18'],
|
33
39
|
hg.commit_tokens(:after => '75532c1e1f1de55c2271f6fd29d98efbe35397c4')
|
34
40
|
|
@@ -16,9 +16,9 @@ module OhlohScm::Adapters
|
|
16
16
|
assert_equal [:A, :B], rev_list_helper(hg, nil, :B)
|
17
17
|
assert_equal [:A, :B, :G, :H, :C], rev_list_helper(hg, nil, :C)
|
18
18
|
assert_equal [:A, :B, :G, :H, :C, :I, :D], rev_list_helper(hg, nil, :D)
|
19
|
-
assert_equal [:A, :G],
|
20
|
-
assert_equal [:A, :G, :H],
|
21
|
-
assert_equal [:A, :G, :H, :I],
|
19
|
+
assert_equal [:A, :B, :G], rev_list_helper(hg, nil, :G)
|
20
|
+
assert_equal [:A, :B, :G, :H], rev_list_helper(hg, nil, :H)
|
21
|
+
assert_equal [:A, :B, :G, :H, :C, :I], rev_list_helper(hg, nil, :I)
|
22
22
|
|
23
23
|
# Limited history from one commit to another
|
24
24
|
assert_equal [], rev_list_helper(hg, :A, :A)
|
data/test/unit/svn_misc_test.rb
CHANGED
@@ -113,7 +113,7 @@ module OhlohScm::Adapters
|
|
113
113
|
|
114
114
|
assert_equal(['2.0', '6'], source_scm.tags.first[0..1])
|
115
115
|
# Avoid millisecond comparision.
|
116
|
-
assert_equal(Time.now.strftime('%F %R'), source_scm.tags.first[-1].strftime('%F %R'))
|
116
|
+
assert_equal(Time.now.utc.strftime('%F %R'), source_scm.tags.first[-1].strftime('%F %R'))
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
data/test/unit/svn_pull_test.rb
CHANGED
@@ -48,7 +48,7 @@ module OhlohScm::Adapters
|
|
48
48
|
|
49
49
|
def test_svnadmin_create_remote
|
50
50
|
OhlohScm::ScratchDir.new do |dir|
|
51
|
-
svn = SvnAdapter.new(:url => "svn+ssh
|
51
|
+
svn = SvnAdapter.new(:url => "svn+ssh://localhost#{dir}")
|
52
52
|
svn.svnadmin_create_remote
|
53
53
|
assert svn.exist?
|
54
54
|
assert FileTest.exist?(File.join(dir, 'hooks', 'pre-revprop-change'))
|
data/test/unit/svn_push_test.rb
CHANGED
@@ -25,7 +25,7 @@ module OhlohScm::Adapters
|
|
25
25
|
with_svn_repository('svn') do |src|
|
26
26
|
OhlohScm::ScratchDir.new do |dest_dir|
|
27
27
|
|
28
|
-
dest = SvnAdapter.new(:url => "svn+ssh
|
28
|
+
dest = SvnAdapter.new(:url => "svn+ssh://localhost#{File.expand_path(dest_dir)}").normalize
|
29
29
|
assert !dest.exist?
|
30
30
|
|
31
31
|
src.push(dest)
|
@@ -169,7 +169,7 @@ module OhlohScm::Adapters
|
|
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 svn.branch_name.to_s.empty?
|
173
173
|
end
|
174
174
|
end
|
175
175
|
end
|
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: 2.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BlackDuck Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: posix-spawn
|
@@ -78,10 +78,8 @@ files:
|
|
78
78
|
- ".gitignore"
|
79
79
|
- ".ruby-version"
|
80
80
|
- ".travis.yml"
|
81
|
-
- ".travis/.install_dependencies.sh"
|
82
|
-
- ".travis/.install_multiple_scms.sh"
|
83
|
-
- ".travis/.travis_ssh_setup.sh"
|
84
81
|
- COPYING
|
82
|
+
- Dockerfile
|
85
83
|
- README.md
|
86
84
|
- Rakefile
|
87
85
|
- bin/accept_svn_ssl_certificate
|
@@ -1,15 +0,0 @@
|
|
1
|
-
#/usr/bin/env sh
|
2
|
-
|
3
|
-
bazaar_plugins_path=`bzr --version | awk '/bzrlib:/ {print $2}'`
|
4
|
-
|
5
|
-
cd "$bazaar_plugins_path/plugins"
|
6
|
-
|
7
|
-
sudo bzr branch lp:bzr-xmloutput
|
8
|
-
|
9
|
-
sudo mv bzr-xmloutput xmloutput
|
10
|
-
|
11
|
-
gem install 'test-unit' -v '3.2.4'
|
12
|
-
|
13
|
-
cd xmloutput
|
14
|
-
|
15
|
-
python setup.py build_ext -i
|