gerricator 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/app.rb +1 -1
- data/gerricator.gemspec +1 -1
- data/lib/gerrit.rb +8 -0
- 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: 82cb01cc81eae73074c801d55789cc76166bc9cd
|
4
|
+
data.tar.gz: 75185c8ce34965b5516270f098c5961ea327291b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a714d8f047ba5f7d2ec6f9e24d39c1273982fd0b417bb6e89e03f133bcdcf5c6c8f6ca8dd9680289434de490ebbe801328c0c4e0a543373cbbe89ad9ddd91f3
|
7
|
+
data.tar.gz: de81ad7e0c6f3ee9e083c22075e8a9443c848f5a7d010b38e3ec458161772ba477af15e4b563f683fb4537fb5dde560e2b527e239b028754ad04057ddc210d05
|
data/config/app.rb
CHANGED
@@ -97,7 +97,7 @@ module App; class << self
|
|
97
97
|
change_url = File.join(config['gerrit']['base_url'], "#/c/#{number}")
|
98
98
|
message = "#{Git::message(work_dir)}\nGerrit URL: #{change_url}\n"
|
99
99
|
reviewers = [*config['projects'][project]['reviewers']].compact
|
100
|
-
reviewers = change.reviewers - gerrit_bots if reviewers.empty?
|
100
|
+
reviewers = change.reviewers - gerrit_bots - [change.owner] if reviewers.empty?
|
101
101
|
logger.info "Creating new diff, reviewers: #{reviewers}"
|
102
102
|
differential_id = arc.diff(work_dir, config['projects'][project]['phabricator_callsign'], message: message, reviewers: reviewers)
|
103
103
|
link = Link.create! differential_id: differential_id, change_number: number, patch_set_revisions: rev_no
|
data/gerricator.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'gerricator'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.2'
|
4
4
|
s.date = Date.civil(2015,1,25)
|
5
5
|
s.summary = 'Gerrit change to Phabricator diff'
|
6
6
|
s.description = 'Command-line tool to create or update Phabricator diff from Gerrit change'
|
data/lib/gerrit.rb
CHANGED
@@ -12,6 +12,10 @@ class Gerrit < Struct.new(:base_url, :username, :password)
|
|
12
12
|
request endpoint, method: 'post', body: body.to_s
|
13
13
|
end
|
14
14
|
|
15
|
+
def put endpoint, body = {}
|
16
|
+
request endpoint, method: 'put', body: JSON.dump(body)
|
17
|
+
end
|
18
|
+
|
15
19
|
class Change < Struct.new(:gerrit, :change_id)
|
16
20
|
def number
|
17
21
|
@number ||= get['_number']
|
@@ -29,6 +33,10 @@ class Gerrit < Struct.new(:base_url, :username, :password)
|
|
29
33
|
get('?o=ALL_REVISIONS')['revisions']
|
30
34
|
end
|
31
35
|
|
36
|
+
def owner
|
37
|
+
get('detail')['owner']['username']
|
38
|
+
end
|
39
|
+
|
32
40
|
def get subpath=''
|
33
41
|
path = File.join("changes/#{change_id}", subpath)
|
34
42
|
gerrit.get path
|