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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf0cce0039d7ed0c71c841edf71fed33eb962093d88c149dd6c75a29b8f05425
4
- data.tar.gz: 900243a6614515e950e68cc8e2bfdbe790fa9651113d50bbb8a06b1d7ee76bae
3
+ metadata.gz: a9497b7b0c42cdc606034e2b8aa0307dae5da9cfe6be3f371fb8043e6c4001d2
4
+ data.tar.gz: 822e2cc571a191231fd441519ba059c86494977bb7403edc83605d7f3d8dd221
5
5
  SHA512:
6
- metadata.gz: b3cd4508600d221c9b3456f054e5845392d23e2483609d560afc3eeb137b16a786164d92df3a935b0fd5939f318f6f48844f84a32b247ac3ab094dec2abb7715
7
- data.tar.gz: c4649e65d09e9639876344ab6e9ed89ba81396809a80fa26278b0488ec43c81fcc4d44db093fdeceed9a42cfbd9b2360e2bb1db3861691881088fe7b47a80651
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=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=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
- $ git checkout -b v3
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 ohdeployer/ohloh_scm:ubuntu18 /bin/sh -c "$cmd"
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("cd '#{url}' && bzr log --limit 1 --show-id #{url} 2> /dev/null"\
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
@@ -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 --'
@@ -82,6 +82,7 @@ module OhlohScm
82
82
 
83
83
  def clean_up_disk
84
84
  return unless File.exist?(url)
85
+ sleep 1
85
86
 
86
87
  run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name . -print0"\
87
88
  ' | xargs -0 rm -rf --'
@@ -42,6 +42,7 @@ module OhlohScm
42
42
 
43
43
  def clean_up_disk
44
44
  return unless FileTest.exist?(url)
45
+ sleep 1
45
46
 
46
47
  run "cd #{url} && find . -maxdepth 1 -not -name .hg -not -name . -print0"\
47
48
  ' | xargs -0 rm -rf --'
@@ -2,7 +2,7 @@
2
2
 
3
3
  module OhlohScm
4
4
  module Version
5
- STRING = '3.0.13'
5
+ STRING = '3.0.16'
6
6
  GIT = '2.17.1'
7
7
  SVN = '1.9.7'
8
8
  CVSNT = '2.5.04'
@@ -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.13
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: 2021-04-29 00:00:00.000000000 Z
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 \