ohloh_scm 3.0.13 → 3.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -7
- data/lib/ohloh_scm/bzr/activity.rb +1 -2
- data/lib/ohloh_scm/git/scm.rb +2 -1
- data/lib/ohloh_scm/git_svn/scm.rb +1 -0
- data/lib/ohloh_scm/hg/scm.rb +1 -0
- data/lib/ohloh_scm/version.rb +1 -1
- data/spec/ohloh_scm/git/scm_spec.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9497b7b0c42cdc606034e2b8aa0307dae5da9cfe6be3f371fb8043e6c4001d2
|
4
|
+
data.tar.gz: 822e2cc571a191231fd441519ba059c86494977bb7403edc83605d7f3d8dd221
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1303a8d011f502ac2c962467e1c1593093255cd31c4ef567a4bbabf89eef10fdcaf409ae30388494c39feb885894de2c991b8e4de7bb6ebc02f954b2794ab930
|
7
|
+
data.tar.gz: 4c5d7fbae432815703ddcb0eade08d19a4c41c163366c3d957672aeca3d82eb34348735ea00b4dc5a02c24fcc13ed492be0e3c3cf451cf62d6a3c0d60fe6f794
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
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=
|
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=main)](https://travis-ci.org/blackducksoftware/ohloh_scm)
|
2
2
|
|
3
3
|
# Ohloh SCM
|
4
4
|
|
@@ -20,17 +20,13 @@ One may use Docker to run Ohloh SCM and test changes.
|
|
20
20
|
```sh
|
21
21
|
$ git clone https://github.com/blackducksoftware/ohloh_scm
|
22
22
|
$ cd ohloh_scm
|
23
|
-
$
|
23
|
+
$ docker build -t ohloh_scm:foobar .
|
24
24
|
|
25
25
|
# To run all tests, we need to start the ssh server and set UTF-8 locale for encoding tests.
|
26
26
|
$ cmd='/etc/init.d/ssh start; LANG=en_US.UTF-8 rake test 2> /dev/null'
|
27
|
-
$ docker run -P -v $(pwd):/home/app/ohloh_scm -ti
|
27
|
+
$ docker run --rm -P -v $(pwd):/home/app/ohloh_scm -ti ohloh_scm:foobar /bin/sh -c "$cmd"
|
28
28
|
# This mounts the current folder into the docker container;
|
29
29
|
# hence any edits made in ohloh_scm on the host machine would reflect in the container.
|
30
|
-
|
31
|
-
# One may also edit the Dockerfile & build the image locally for other distros.
|
32
|
-
$ docker build -t ohloh_scm:custom .
|
33
|
-
$ docker run -P -v $(pwd):/home/app/ohloh_scm -ti ohloh_scm:custom /bin/bash
|
34
30
|
```
|
35
31
|
|
36
32
|
## Development Setup
|
@@ -75,8 +75,7 @@ module OhlohScm
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def head_token
|
78
|
-
run("
|
79
|
-
" | grep ^revision-id | cut -f2 -d' '").strip
|
78
|
+
run("bzr log --limit 1 --show-id #{url} 2> /dev/null | grep ^revision-id | cut -f2 -d' '").strip
|
80
79
|
end
|
81
80
|
|
82
81
|
def head
|
data/lib/ohloh_scm/git/scm.rb
CHANGED
@@ -66,12 +66,13 @@ module OhlohScm
|
|
66
66
|
return if branch_name.to_s.empty?
|
67
67
|
return if activity.branches.include?(branch_name)
|
68
68
|
|
69
|
-
run "cd '#{url}' && git branch -f #{branch_name} origin/#{branch_name}"
|
69
|
+
run "cd '#{url}' && git remote update && git branch -f #{branch_name} origin/#{branch_name}"
|
70
70
|
end
|
71
71
|
|
72
72
|
# Deletes everything but the *.git* folder in the working directory.
|
73
73
|
def clean_up_disk
|
74
74
|
return unless Dir.exist?(url)
|
75
|
+
sleep 1
|
75
76
|
|
76
77
|
run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name . -print0"\
|
77
78
|
' | xargs -0 rm -rf --'
|
data/lib/ohloh_scm/hg/scm.rb
CHANGED
data/lib/ohloh_scm/version.rb
CHANGED
@@ -33,6 +33,27 @@ describe 'Git::Scm' do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
it 'must update branches in local copy' do
|
37
|
+
test_branch_name = 'test' # consider that 'test' is the current *main* branch.
|
38
|
+
|
39
|
+
with_git_repository('git_with_multiple_branch', test_branch_name) do |src_core|
|
40
|
+
tmpdir do |dest_dir|
|
41
|
+
core = OhlohScm::Factory.get_core(scm_type: :git, url: dest_dir, branch_name: test_branch_name)
|
42
|
+
core.scm.pull(src_core.scm, TestCallback.new)
|
43
|
+
|
44
|
+
# Emulate a scenario where the local copy doesn't have the current *main* branch.
|
45
|
+
`cd #{dest_dir} && git checkout master && git branch -D test`
|
46
|
+
|
47
|
+
local_branch_cmd = "cd #{dest_dir} && git branch | grep '\*' | sed 's/^\* //'"
|
48
|
+
`#{ local_branch_cmd }`.chomp.must_equal 'master'
|
49
|
+
|
50
|
+
# On doing a refetch, our local copy will now have the updated *main* branch.
|
51
|
+
core.scm.pull(src_core.scm, TestCallback.new)
|
52
|
+
`#{ local_branch_cmd }`.chomp.must_equal test_branch_name
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
36
57
|
it 'must test the basic conversion to git' do
|
37
58
|
with_cvs_repository('cvs', 'simple') do |src_core|
|
38
59
|
tmpdir do |dest_dir|
|
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.16
|
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: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
The OpenHub source control management library for \
|