crossroads_capistrano 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "crossroads_capistrano"
6
- s.version = "1.2.4"
6
+ s.version = "1.2.5"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Steve Kenworthy", "Ben Tillman", "Nathan Broadbent"]
9
9
  s.email = ["it_dept@crossroads.org.hk"]
@@ -6,14 +6,20 @@ task :revisions, :roles => :app do
6
6
  puts "===== [ \033[1;36m#{application.capitalize} - #{stage.capitalize}\033[0m ]"
7
7
  puts "=== Deployed Revision: \033[1;32m#{current}\033[0m"
8
8
  puts "=== Previous Revision: \033[1;32m#{previous}\033[0m\n\n"
9
+
10
+ # If deployed and master are the same, show the difference between the last 2 deployments.
11
+ base_label, new_label, base_rev, new_rev = latest != current ? \
12
+ ["deployed", "master", current, latest] : \
13
+ ["previous", "deployed", previous, current]
14
+
9
15
  # Show difference between master and deployed revisions.
10
- if (diff = `git log #{current}..#{latest} --oneline`) != ""
16
+ if (diff = `git log #{base_rev}..#{new_rev} --oneline`) != ""
11
17
  # Colorize refs
12
18
  diff.gsub!(/^([a-f0-9]+) /, "\033[1;32m\\1\033[0m - ")
13
19
  diff = " " << diff.gsub("\n", "\n ") << "\n"
14
20
  # Indent commit messages nicely, max 80 chars per line, line has to end with space.
15
21
  diff = diff.split("\n").map{|l|l.scan(/.{1,120}/).join("\n"<<" "*14).gsub(/([^ ]*)\n {14}/m,"\n"<<" "*14<<"\\1")}.join("\n")
16
- puts "=== Difference between master revision and deployed revision:\n\n"
22
+ puts "=== Difference between #{base_label} revision and #{new_label} revision:\n\n"
17
23
  puts diff
18
24
  end
19
25
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: crossroads_capistrano
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.4
5
+ version: 1.2.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Steve Kenworthy