This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  d029ae5   Use constant for consistent revision message matching
d029ae5 is described below

commit d029ae555e7089818107912985d33519aba975f1
Author: Sebb <[email protected]>
AuthorDate: Sat Jun 3 12:21:44 2017 +0100

    Use constant for consistent revision message matching
---
 www/status/monitors/svn.rb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/www/status/monitors/svn.rb b/www/status/monitors/svn.rb
index ef6a06e..bb4c7ed 100644
--- a/www/status/monitors/svn.rb
+++ b/www/status/monitors/svn.rb
@@ -44,6 +44,9 @@ Danger - unexpected text in log file
 
 require 'fileutils'
 
+# Match revision messages
+REV_RE = %r{^(Checked out|Updated to|At) revision \d+\.$}
+
 def Monitor.svn(previous_status)
   logdir = File.expand_path('../../../logs', __FILE__)
   archive = File.join(logdir,'archive')
@@ -61,7 +64,7 @@ def Monitor.svn(previous_status)
   updates.each do |update|
     level = 'success'
     title = nil
-    data = revision = update[/^(Updated to|At) revision \d+\.$/]
+    data = revision = update[REV_RE]
 
     lines = update.split("\n")
     repository = lines.shift.to_sym
@@ -70,7 +73,7 @@ def Monitor.svn(previous_status)
       line == "Updating '.':" or
       # must agree with Rakefile/PREFIX
       line.start_with?('#!: ') or
-      line =~ /^(Checked out|Updated to|At) revision \d+\.$/
+      line =~ REV_RE
     end
 
     unless lines.empty?

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to