whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Rename 'local' variables that have different meanings
Date Thu, 01 Jun 2017 11:46:00 GMT
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  855a317   Rename 'local' variables that have different meanings
855a317 is described below

commit 855a317322bc49a30a435475a33701e9c7e45f8e
Author: Sebb <sebb@apache.org>
AuthorDate: Thu Jun 1 12:45:58 2017 +0100

    Rename 'local' variables that have different meanings
    
    It's confusing if local means different things in
    different contexts
---
 www/status/svn.cgi | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/www/status/svn.cgi b/www/status/svn.cgi
index 02c0962..991910e 100755
--- a/www/status/svn.cgi
+++ b/www/status/svn.cgi
@@ -26,6 +26,7 @@ _html do
     }
   }
 
+  # remains true if all local checkouts are writable
   writable = true
   svnroot = (svnrepos.length == 1 && svnrepos.first =~ /^(\/\w[-.\w]*)+\/\*$/ &&
     File.writable?(svnrepos.first.chomp('*').untaint))
@@ -75,7 +76,7 @@ _html do
   end
 
   _script %{
-    var local = #{writable};
+    var writable = #{writable};
     var svnroot = #{!!svnroot};
 
     // update status of a row based on a sever response
@@ -92,19 +93,19 @@ _html do
       if (tds[2].textContent != tds[3].textContent) {
         tr.setAttribute('class', 'bg-warning');
 
-        if (local) {
+        if (writable) {
           $(tds[4]).html('<button class="btn btn-info">update</button>');
           $('button', tr).on('click', sendRequest);
         }
       } else {
         tr.setAttribute('class', 'bg-success');
-        if (local) $(tds[4]).empty();
+        if (writable) $(tds[4]).empty();
       }
     };
 
     // when running locally, add a fourth column, and create a function
     // used to send requests to the server
-    if (local) {
+    if (writable) {
       $('thead tr').append('<th>action</th');
       $('tbody tr').append('<td></td');
 
@@ -177,13 +178,13 @@ _json do
     end
   end
 
-  local, lerr = ASF::SVN.getRevision(local_path.untaint)
-  server, serr = ASF::SVN.getRevision(repository_url.untaint)
+  localrev, lerr = ASF::SVN.getRevision(local_path.untaint)
+  serverrev, serr = ASF::SVN.getRevision(repository_url.untaint)
   {
     log: log.to_s.split("\n"),
     path: local_path,
-    local: local || lerr.split("\n").last, # generally the last SVN error line is the cause
-    server: server || serr.split("\n").last
+    local: localrev || lerr.split("\n").last, # generally the last SVN error line is the
cause
+    server: serverrev || serr.split("\n").last
   }
 end
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message