gergich 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gergich.rb +6 -3
- data/spec/gergich_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc6e202255732bf23a6df2c75e18250897744e99
|
4
|
+
data.tar.gz: 1942f228ae335675740fa7ae626a92204ce7e7a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88c9113246e2e97fda409346032d88de432c910c360ec72c28b368e33e9bb34606663f2588601ef2be3e4bdab18644eac6498cc94749404dc941a373b0865238
|
7
|
+
data.tar.gz: d3266350ace476809d572e191275a7a18dab184d48954f8e3407680f8ec2b3e5840524c3c626d98ea6f7bd970ca21fa7a46108c67894d6e75153de430ef9ce28
|
data/lib/gergich.rb
CHANGED
@@ -81,7 +81,7 @@ module Gergich
|
|
81
81
|
|
82
82
|
def change_id
|
83
83
|
if info[:project] && info[:branch]
|
84
|
-
|
84
|
+
"#{info[:project]}~#{ERB::Util.url_encode info[:branch]}~#{info[:change_id]}"
|
85
85
|
else
|
86
86
|
info[:change_id]
|
87
87
|
end
|
@@ -147,8 +147,11 @@ module Gergich
|
|
147
147
|
return
|
148
148
|
end
|
149
149
|
|
150
|
+
info = commit.info
|
151
|
+
puts "Project: #{info[:project]}"
|
152
|
+
puts "Branch: #{info[:branch]}"
|
153
|
+
puts "Revision: #{info[:revision_id]} (##{commit.revision_number})"
|
150
154
|
puts "ChangeId: #{commit.change_id}"
|
151
|
-
puts "Revision: #{commit.revision_id}"
|
152
155
|
puts "Files:"
|
153
156
|
puts " #{commit.files.join("\n ")}"
|
154
157
|
|
@@ -306,7 +309,7 @@ module Gergich
|
|
306
309
|
if ret.sub!(/\A\)\]\}'\n/, "") && ret =~ /\A("|\[|\{)/
|
307
310
|
JSON.parse("[#{ret}]")[0] # array hack so we can parse a string literal
|
308
311
|
elsif ret =~ /Not found: (?<change_id>.*)/i
|
309
|
-
raise("Cannot find Change-Id: #{Regexp.last_match[:change_id]}.\n"\
|
312
|
+
raise("Cannot find Change-Id: #{Regexp.last_match[:change_id]} at #{url}.\n"\
|
310
313
|
"This is most likely due to this"\
|
311
314
|
" Change-Id already being used"\
|
312
315
|
" by an ABANDONED change.\n"\
|
data/spec/gergich_spec.rb
CHANGED
@@ -65,7 +65,7 @@ RSpec.describe Gergich::Commit do
|
|
65
65
|
allow(ENV).to receive(:[]).with("GERRIT_CHANGE_ID").and_return("dummychangeset")
|
66
66
|
|
67
67
|
expect(described_class.new.change_id) # %2F = / and %7E = ~
|
68
|
-
.to match("spec-project%
|
68
|
+
.to match("spec-project~releases%2F2017.11.17~dummychangeset")
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|