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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b5eee387fc16072f68fc114f53f5f3fbd638098
4
- data.tar.gz: 4941a24cde55b370c29cf244f0569236a0fe310c
3
+ metadata.gz: 7aabc469e74657337d3401366c824c144fd4b569
4
+ data.tar.gz: 2f34967d29e05c980b5c6acc43a10d9f36bcf3a8
5
5
  SHA512:
6
- metadata.gz: 361d713273ad486790c2374b71e3214002806b19c31874768bfd9bf9c1747f718ddec25a9875e38451ca041b5c7fe3fc7c5c711e71b82167632e89c832b80db6
7
- data.tar.gz: 8730d06656f7e9c6cfdb252ba74905064638738f0869d098d52cf66ede7030ecbda7f8a249ba8c4a21878f837878a956c566780be0f5c21cae37509219bc1ce8
6
+ metadata.gz: 45e426c1379169bdffcee9683d84bbf6428eb55c727e869c75e6e4b23195aa045e109bbb9be0956ed27b9dd4afb729cdc17c327b842df4692b23910bd688a051
7
+ data.tar.gz: 30d48db3b286541d580e59a1d432b5bce19808c7ce92b2b322e69ecbbdd746af6e1ca18bccd29a41e4a3c2dafa61df778463c1a2864238bcf545835c43a8d2ff
@@ -1,15 +1,6 @@
1
- language: ruby
2
- env:
3
- - TRAVIS_CONFIG_DIR=.travis
1
+ language: generic
2
+ services:
3
+ - docker
4
4
  before_install:
5
- - cd $TRAVIS_CONFIG_DIR
6
- - sh .travis_ssh_setup.sh
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"
@@ -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
- [![Ohloh SCM on Ohloh](https://www.ohloh.net/p/ohloh_scm/widgets/project_partner_badge.gif)](https://www.ohloh.net/p/ohloh_scm) [![Build Status](https://travis-ci.org/blackducksoftware/ohloh_scm.svg?branch=master)](https://travis-ci.org/blackducksoftware/ohloh_scm)
1
+ [![Ohloh SCM on OpenHub](https://www.openhub.net/p/ohloh_scm/widgets/project_partner_badge.gif)](https://www.openhub.net/p/ohloh_scm) [![Build Status](https://travis-ci.org/blackducksoftware/ohloh_scm.svg?branch=master)](https://travis-ci.org/blackducksoftware/ohloh_scm)
2
2
 
3
3
  # Ohloh SCM
4
4
 
5
- The Ohloh source control management library
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 Ohloh, and is used to generate
28
- the reports at www.ohloh.net.
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
- Ohloh SCM is developed on Mac OS X 10.5 and Ubuntu 6.06 LTS. Other Linux
33
- environments should also work, but your mileage may vary.
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 1.8.6 and Rake 0.8.1
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. In order to pass the unit tests, all three systems must be installed
41
- and on your path. Ohloh uses the following versions, and other versions are
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.4.2
46
- git 1.8.2.1
47
- hg 1.1.2
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, Ohloh uses the SCM library to maintain a private
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 Ohloh application orchestrates the scheduling of all updates and
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 Ohloh
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 Ohloh cluster, and typically occurs over ssh.
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 Ohloh
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 Ohloh via email at:
137
- [info@ohloh.net](mailto:info@ohloh.net)
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 :unit_tests do |t|
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 => :unit_tests
34
-
33
+ task :default => :test
@@ -31,7 +31,7 @@ module OhlohScm::Adapters
31
31
  end
32
32
 
33
33
  def export_tag(dest_dir, tag_name)
34
- run "cd '#{path}' && bzr export -r tag:#{tag_name} #{dest_dir}"
34
+ run "cd '#{path}' && bzr export -r #{tag_name} #{dest_dir}"
35
35
  end
36
36
 
37
37
  def export(dest_dir, token=head_token)
@@ -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
- "--follow-first -r #{ up_to }:#{ after }"
103
+ '--follow-first'
100
104
  else
101
- query = "and (branch(#{ branch_name }) or ancestors(#{ branch_name }))" if branch_name && branch_name != 'default'
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 -f -v #{ options }", after]
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 #{branch_name || :default}"
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.
@@ -30,5 +30,11 @@ module OhlohScm::Adapters
30
30
  [tag_name, rev, Time.parse(time_string)]
31
31
  end
32
32
  end
33
+
34
+ protected
35
+
36
+ def branch_name_or_default
37
+ branch_name || :default
38
+ end
33
39
  end
34
40
  end
@@ -1,5 +1,5 @@
1
1
  module OhlohScm
2
2
  module Version
3
- STRING = '2.4.14'
3
+ STRING = '2.5.1'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  Index: trunk/makefile
2
2
  ===================================================================
3
- --- trunk/makefile (revision 0)
3
+ --- trunk/makefile (nonexistent)
4
4
  +++ trunk/makefile (revision 2)
5
5
  @@ -0,0 +1,4 @@
6
6
  +all: helloworld
@@ -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], rev_list_helper(hg, nil, :G)
20
- assert_equal [:A, :G, :H], rev_list_helper(hg, nil, :H)
21
- assert_equal [:A, :G, :H, :I], rev_list_helper(hg, nil, :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)
@@ -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
@@ -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://#{Socket.gethostname}#{dir}")
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'))
@@ -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://#{Socket.gethostname}#{File.expand_path(dest_dir)}").normalize
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
- assert_equal '', svn.branch_name
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.14
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-03-26 00:00:00.000000000 Z
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
@@ -1,6 +0,0 @@
1
- sudo apt-get update
2
- sudo pip uninstall mercurial -y
3
- sudo apt-get install -y git subversion cvs bzr mercurial
4
- sudo ln -s /usr/bin/cvs /usr/bin/cvsnt
5
-
6
- sudo apt-get install git-svn
@@ -1,3 +0,0 @@
1
- ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
2
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3
- ssh-keyscan -t rsa `hostname` >> ~/.ssh/known_hosts