git-maintain 0.2.2.pre.5.g8e0f945 → 0.2.2.pre.13.gd8c159e

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -4
  3. data/lib/branch.rb +31 -17
  4. data/lib/repo.rb +30 -28
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f57ed0d8c6ebb69d17e821f8ff90b327e7845c1fa436c505a7932e346eca0aa
4
- data.tar.gz: 5402564d86247ed0bc0c186a934accc69b3df0b6278131b61f025d4afc2c86a1
3
+ metadata.gz: 7378594cddd98d880305ebeaffb40ab8e035d858902475e3338b3496023ce5e6
4
+ data.tar.gz: ee2afb10e4deb3288f7051d892e225bb9a70d96a232712945d48b799b209110c
5
5
  SHA512:
6
- metadata.gz: 4037fb9fadef07fff3ab3a66f14b805300565899c1c77f5d1dafb8b9848bd5df64223d6913bb017c24b4f0de139e5105681b41b44982a504765e6729268bf13e
7
- data.tar.gz: 8226b4cfe8eb7f2b6885327eb34b4cb516ea495b905aa2b7609c80e67560b16ac7b88b2e67b7ddaa2458a4b50e14fb5779d2fe630eadff4586d545e8f65f6431
6
+ metadata.gz: b917954dc36f6e9996c6b54753642e9cc6fbf62622b2998f4cb8e521d3e5c7f59abc6b9226846fd13b5bf024a55272ce4a9eb135b1b54a8cf106f5cf84491fae
7
+ data.tar.gz: a15089ca11769891cc645415af31f7ac0e41dbd13e8d908bbf7fc3d39a83b012a8f07e28a0afadb2552f105665bbf23f66feabc14007d145c2415a92e63f7876
data/CHANGELOG CHANGED
@@ -1,11 +1,11 @@
1
- ------------------
2
- 0.2.3
3
- ------------------
4
-
5
1
  * Fix support for commit messages containing double quotes
6
2
  * Fix --base-version and --branch-suffix
7
3
  * Add completion support for --version
8
4
  * Fix --no-travis
5
+ * Customizable behaviour for travis/emails in Addons
6
+ * Allow branch action to be run on user-specified branches (instead of the stable pattern)
7
+ * Add hpc-testing addon
8
+ * Add git-maintain addon
9
9
 
10
10
  ------------------
11
11
  0.2.2 (2018-07-13)
data/lib/branch.rb CHANGED
@@ -51,7 +51,8 @@ module GitMaintain
51
51
  |val| opts[:base_ver] = val}
52
52
  optsParser.on("-V", "--version [regexp]", Regexp, "Regexp to filter versions.") {
53
53
  |val| opts[:version] = val}
54
-
54
+ optsParser.on("-B", "--manual-branch <branch name>", "Work on a specific (non-stable) branch.") {
55
+ |val| opts[:manual_branch] = val}
55
56
  case action
56
57
  when :cp
57
58
  optsParser.banner += "-c <sha1> [-c <sha1> ...]"
@@ -89,17 +90,24 @@ module GitMaintain
89
90
  repo.stableUpdate()
90
91
  end
91
92
 
92
- repo.getStableList(opts[:br_suff]).each(){|br|
93
- branch = Branch::load(repo, br, travis, opts[:br_suff])
94
- case branch.is_targetted?(opts)
95
- when :too_old
96
- puts "# Skipping older v#{branch.version}"
97
- next
98
- when :no_match
99
- puts "# Skipping v#{branch.version} not matching #{opts[:version].to_s()}"
100
- next
101
- end
102
-
93
+ branchList=[]
94
+ if opts[:manual_branch] == nil then
95
+ branchList = repo.getStableList(opts[:br_suff]).map(){|br|
96
+ branch = Branch::load(repo, br, travis, opts[:br_suff])
97
+ case branch.is_targetted?(opts)
98
+ when :too_old
99
+ puts "# Skipping older v#{branch.version}"
100
+ next
101
+ when :no_match
102
+ puts "# Skipping v#{branch.version} not matching #{opts[:version].to_s()}"
103
+ next
104
+ end
105
+ branch
106
+ }.compact()
107
+ else
108
+ branchList = [ Branch::load(repo, opts[:manual_branch], travis, opts[:br_suff]) ]
109
+ end
110
+ branchList.each(){|branch|
103
111
  puts "###############################"
104
112
  puts "# Working on v#{branch.version}"
105
113
  puts "###############################"
@@ -115,21 +123,27 @@ module GitMaintain
115
123
  GitMaintain::checkDirectConstructor(self.class)
116
124
 
117
125
  @repo = repo
118
- @version = version
119
126
  @travis = travis
127
+ @version = version
120
128
  @branch_suff = branch_suff
121
129
 
122
- @local_branch = "dev/stable-v#{@version}/#{@branch_suff}"
123
- @head = @repo.runGit("rev-parse #{@local_branch}")
130
+ if version =~ /^[0-9]$/
131
+ @local_branch = "dev/stable-v#{@version}/#{@branch_suff}"
132
+ @remote_branch ="stable-v#{@version}"
133
+ else
134
+ @remote_branch = @local_branch = version
135
+ end
124
136
 
125
- @remote_branch ="stable-v#{@version}"
137
+ @head = @repo.runGit("rev-parse #{@local_branch}")
126
138
  @remote_ref = "#{Repo::STABLE_REPO}/#{@remote_branch}"
127
139
  @stable_head = @repo.runGit("rev-parse #{@remote_ref}")
128
140
  @stable_base = @repo.findStableBase(@local_branch)
141
+
129
142
  end
130
143
  attr_reader :version, :local_branch, :head, :remote_branch, :remote_ref, :stable_head
131
144
 
132
145
  def is_targetted?(opts)
146
+ return true if @version !~ /^[0-9]$/
133
147
  if @version.to_i < opts[:base_ver] then
134
148
  return :too_old
135
149
  end
@@ -216,7 +230,7 @@ module GitMaintain
216
230
 
217
231
  # Push branch to the stable repo
218
232
  def push_stable(opts)
219
- if opts[:no_travis] != true &&
233
+ if (opts[:no_travis] != true && @NO_TRAVIS != true) &&
220
234
  @travis.checkValidState(@head) != true then
221
235
  puts "Build is not passed on travis. Skipping push to stable"
222
236
  return
data/lib/repo.rb CHANGED
@@ -110,7 +110,7 @@ module GitMaintain
110
110
  return @suffix_list
111
111
  end
112
112
 
113
- def submitReleases()
113
+ def submitReleases(opts)
114
114
  remote_tags=runGit("ls-remote --tags #{STABLE_REPO} |
115
115
  egrep 'refs/tags/v[0-9.]*$'").split("\n").map(){
116
116
  |x| x.gsub(/.*refs\/tags\//, '')
@@ -124,39 +124,41 @@ module GitMaintain
124
124
  end
125
125
 
126
126
  puts "This will officially release these tags: #{new_tags.join(", ")}"
127
- rep = GitMaintain::confirm("release them")
127
+ rep = GitMaintain::confirm(opts, "release them")
128
128
  if rep != 'y' then
129
129
  raise "Aborting.."
130
130
  end
131
131
 
132
- mail_path=`mktemp`.chomp()
133
- mail = File.open(mail_path, "w+")
134
- mail.puts "From " + runGit("rev-parse HEAD") + " " + `date`.chomp()
135
- mail.puts "From: " + runGit("config user.name") +
136
- " <" + runGit("config user.email") +">"
137
- mail.puts "To: " + runGit("config patch.target")
138
- mail.puts "Date: " + `date -R`.chomp()
139
- mail.puts "Subject: [ANNOUNCE] " + File.basename(@path) + " " +
140
- (new_tags.length > 1 ?
141
- (new_tags[0 .. -2].join(", ") + " and " + new_tags[-1]) :
142
- new_tags.join(" ")) +
143
- " has been tagged/released"
144
- mail.puts ""
145
- mail.puts "Here's the information from the tags:"
146
- new_tags.sort().each(){|tag|
147
- mail.puts `git show #{tag} --no-decorate -q | awk '!p;/^-----END PGP SIGNATURE-----/{p=1}'`
132
+ if @NOTIFY_RELEASE != false
133
+ mail_path=`mktemp`.chomp()
134
+ mail = File.open(mail_path, "w+")
135
+ mail.puts "From " + runGit("rev-parse HEAD") + " " + `date`.chomp()
136
+ mail.puts "From: " + runGit("config user.name") +
137
+ " <" + runGit("config user.email") +">"
138
+ mail.puts "To: " + runGit("config patch.target")
139
+ mail.puts "Date: " + `date -R`.chomp()
140
+ mail.puts "Subject: [ANNOUNCE] " + File.basename(@path) + " " +
141
+ (new_tags.length > 1 ?
142
+ (new_tags[0 .. -2].join(", ") + " and " + new_tags[-1]) :
143
+ new_tags.join(" ")) +
144
+ " has been tagged/released"
148
145
  mail.puts ""
149
- }
150
- mail.puts "It's available at the normal places:"
151
- mail.puts ""
152
- mail.puts "git://github.com/#{@remote_stable}"
153
- mail.puts "https://github.com/#{@remote_stable}/releases"
154
- mail.close()
146
+ mail.puts "Here's the information from the tags:"
147
+ new_tags.sort().each(){|tag|
148
+ mail.puts `git show #{tag} --no-decorate -q | awk '!p;/^-----END PGP SIGNATURE-----/{p=1}'`
149
+ mail.puts ""
150
+ }
151
+ mail.puts "It's available at the normal places:"
152
+ mail.puts ""
153
+ mail.puts "git://github.com/#{@remote_stable}"
154
+ mail.puts "https://github.com/#{@remote_stable}/releases"
155
+ mail.close()
155
156
 
156
- puts runGitImap("< #{mail_path}; rm -f #{mail_path}")
157
+ puts runGitImap("< #{mail_path}; rm -f #{mail_path}")
158
+ end
157
159
 
158
160
  puts "Last chance to cancel before submitting"
159
- rep= GitMaintain::confirm("submit these releases")
161
+ rep= GitMaintain::confirm(opts, "submit these releases")
160
162
  if rep != 'y' then
161
163
  raise "Aborting.."
162
164
  end
@@ -164,7 +166,7 @@ module GitMaintain
164
166
  end
165
167
  def findStableBase(branch)
166
168
  @stable_base_patterns.each(){|pattern, base|
167
- return base if branch =~ /#{pattern}\//
169
+ return base if branch =~ /#{pattern}\// || branch =~ /#{pattern}$/
168
170
  }
169
171
  raise("Could not a find a stable base for branch #{branch}")
170
172
  end
@@ -176,7 +178,7 @@ module GitMaintain
176
178
  puts getSuffixList()
177
179
  end
178
180
  def submit_release(opts)
179
- submitReleases()
181
+ submitReleases(opts)
180
182
  end
181
183
  end
182
184
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-maintain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.pre.5.g8e0f945
4
+ version: 0.2.2.pre.13.gd8c159e
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Morey-Chaisemartin