lib/git_fogbugz.rb in git-fogbugz-0.1.2 vs lib/git_fogbugz.rb in git-fogbugz-0.1.3
- old
+ new
@@ -91,11 +91,11 @@
Example: git-fogbugz https://example.fogbugz.com 9 < file_with_old_new_ref_lines
Options are:
BANNER
opts.separator ""
- opts.on_tail('-r', '--repo=REPO', "FogBugz repo id") {|repo| @options.repo = repo }
+ opts.on_tail('-r', '--repo=REPO', "Location of repository default is current dir") {|repo| @options.repo = repo }
opts.on_tail('-v', '--version') { output_version ; exit 0 }
opts.on_tail('-V', '--verbose') { @options.verbose = true }
opts.on_tail('-q', '--quiet') { @options.quiet = true }
opts.on('-p', '--passthrough', "Output stdin"){ @options.passthrough = true }
@@ -157,10 +157,11 @@
# TO DO - process input
# [Optional]
@stdin.each do |line|
old, new, ref = line.split
repo.commits_between(old, new).each do |commit|
+ $stderr.puts commit.id if @options.verbose
process_commit(commit)
end
$stdout.puts line if @options.passthrough
# TO DO - process each line
end
@@ -174,12 +175,22 @@
fogbugz.use_ssl=true
fogbugz.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
if commit.message =~ /(bugzid|case|issue)[:\s]+(\d+)/i
id = commit.id[0,7]
- files = commit.diffs.each do |d|
- resp = fogbugz.get(make_url($2, '00000', id, d.a_path))
- stderr.puts resp.body if @options.verbose
+ bugzid = $2
+ files = commit.diffs.each do |d|
+ url = make_url(bugzid, '00000', id, d.a_path)
+ resp = fogbugz.get(url)
+ unless resp.body =~ /OK/
+ $stderr.puts 'FAILED: ' + url
+ $stderr.puts resp.body
+ else
+ if @options.verbose
+ $stderr.puts 'OK: ' + url
+ $stderr.puts resp.body
+ end
+ end
end
end
return
end