r10k 2.5.0 → 2.5.1

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
  SHA1:
3
- metadata.gz: 63ae184bd31860c410b82f60bdaba13629c4ae6e
4
- data.tar.gz: 708bfd7a7f4ef35c41110b437d06bcbd87187dc6
3
+ metadata.gz: fcc5c7609c7aa68f74545644538fa9278ae502e2
4
+ data.tar.gz: 4b1189b790b61de1adbe675b429dd40c076d9e10
5
5
  SHA512:
6
- metadata.gz: da91a8d786f1cfe7a6f403456c8c044d2e1801a918c8cf4f18fbb783f06a8ef108974795e94b652a3172d97876e13eea8a2beb7fc9bc75a09b3eed2aa8a58da1
7
- data.tar.gz: 0ed3a7a5992a1cefbb6dd1dfd27df636fdc6c680757029892b4aa7101d20a8714b7f829ebdbe4fb10d546e07f3391f20ec1661869b3d6ef6838585826d0a52fa
6
+ metadata.gz: e0678b2a9d4d18933cfe062c7225fe2efca4ecb509e69010427d9a8ff7c9cc88ac05a579e4e6267406e061b1f378f4b2516cf5f7073236d4828c1d680d0440bb
7
+ data.tar.gz: d98754d7d90a4783349a73c362c733a27cd20e6e34664833c68a1514217d177eb76553a66cdbc9c49fecfb582824a6f2389a0c9aecf63519906bbc094968e69d
@@ -1,6 +1,25 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 2.5.1
5
+ -----
6
+
7
+ 2016/12/05
8
+
9
+ (RK-78) Use :prune option for #fetch in Rugged::BareRepository
10
+
11
+ Versions of the "rugged" gem prior to 0.24.0 lacked the ability to automatically
12
+ "prune" branches from a local repo that no longer existed in the matching remote
13
+ repo after a fetch. To work around this issue, r10k included code that would
14
+ manually remove/recreate branches during a fetch. Since "rugged" 0.24.0 is now
15
+ widely available, r10k has been updated to use the built-in "prune" option
16
+ during a fetch and the workaround code has been removed.
17
+
18
+ NOTE: If you use the "rugged" gem with r10k, you will need to manually upgrade
19
+ it to a version >= 0.24.0 to take advantage of the new functionality. If you
20
+ are using a "rugged" version less than 0.24.0, r10k will now issue a warning
21
+ every time it fetches from a remote git repository.
22
+
4
23
  2.5.0
5
24
  -----
6
25
 
@@ -49,9 +49,14 @@ class R10K::Git::Rugged::BareRepository < R10K::Git::Rugged::BaseRepository
49
49
  #
50
50
  # @return [void]
51
51
  def fetch(remote_name='origin')
52
- backup_branches = wipe_branches
53
52
  logger.debug1 { _("Fetching remote '%{remote_name}' at %{path}") % {remote_name: remote_name, path: @path } }
54
- options = {:credentials => credentials}
53
+
54
+ # Check to see if we have a version of Rugged that supports "fetch --prune" and warn if not
55
+ if defined?(Rugged::Version) && !Gem::Dependency.new('rugged', '>= 0.24.0').match?('rugged', Rugged::Version)
56
+ logger.warn { _("Rugged versions prior to 0.24.0 do not support pruning stale branches during fetch, please upgrade your \'rugged\' gem. (Current version is: %{version})") % {version: Rugged::Version} }
57
+ end
58
+
59
+ options = {:credentials => credentials, :prune => true}
55
60
  refspecs = ['+refs/*:refs/*']
56
61
 
57
62
  remote = remotes[remote_name]
@@ -64,7 +69,6 @@ class R10K::Git::Rugged::BareRepository < R10K::Git::Rugged::BaseRepository
64
69
 
65
70
  report_transfer(results, remote_name)
66
71
  rescue Rugged::SshError, Rugged::NetworkError => e
67
- restore_branches(backup_branches)
68
72
  if e.message =~ /Unsupported proxy scheme for/
69
73
  message = e.message + "As of curl ver 7.50.2, unsupported proxy schemes no longer fall back to HTTP."
70
74
  else
@@ -72,34 +76,10 @@ class R10K::Git::Rugged::BareRepository < R10K::Git::Rugged::BaseRepository
72
76
  end
73
77
  raise R10K::Git::GitError.new(message, :git_dir => git_dir, :backtrace => e.backtrace)
74
78
  rescue
75
- restore_branches(backup_branches)
76
79
  raise
77
80
  end
78
81
 
79
82
  def exist?
80
83
  @path.exist?
81
84
  end
82
-
83
- def wipe_branches
84
- backup_branches = {}
85
- with_repo do |repo|
86
- repo.branches.each do |branch|
87
- if !branch.head?
88
- backup_branches[branch.name] = branch.target_id
89
- repo.branches.delete(branch)
90
- end
91
- end
92
- end
93
- backup_branches
94
- end
95
-
96
- def restore_branches(backup_branches)
97
- with_repo do |repo|
98
- backup_branches.each_pair do |name, ref|
99
- if !repo.branches.exist?(name)
100
- repo.create_branch(name, ref)
101
- end
102
- end
103
- end
104
- end
105
85
  end
@@ -1,3 +1,3 @@
1
1
  module R10K
2
- VERSION = '2.5.0'
2
+ VERSION = '2.5.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r10k
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -538,7 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
538
538
  version: '0'
539
539
  requirements: []
540
540
  rubyforge_project:
541
- rubygems_version: 2.2.5
541
+ rubygems_version: 2.5.1
542
542
  signing_key:
543
543
  specification_version: 4
544
544
  summary: Puppet environment and module deployment