Fix APPROVAL REQUIRED test - if/else clauses reversed
authorJohnathan Nightingale <johnath@mozilla.com>
Mon, 14 Dec 2009 11:17:44 -0500
changeset 359109 9d9d00fb627ac5421c14fbb444476215e546f8ba
parent 359108 82916def5de09bfb9df5fc434c177ef388ace4fa
child 359110 94fca0d621346aa272811d72b79d872e99b11c94
push id16998
push userrwood@mozilla.com
push dateMon, 02 May 2016 19:42:03 +0000
Fix APPROVAL REQUIRED test - if/else clauses reversed
hghooks/mozhghooks/treeclosure.py
--- a/hghooks/mozhghooks/treeclosure.py
+++ b/hghooks/mozhghooks/treeclosure.py
@@ -34,19 +34,19 @@ def hook(ui, repo, **kwargs):
                 print "To push despite the closed tree, include \"%s\" in your push comment" % magicwords
                 return 1
             else:
                 print "But you included the magic words.  Hope you had permission!"
                 return 0
         elif re.compile('<span id="treestatus".*APPROVAL REQUIRED.*<span id="extended-status">').search(text) :
             # Block the push unless they have approval
             if re.search('a\S*=', repo.changectx('tip').description().lower()) :
+                return 0
+            else:
                 print "Pushing to an APPROVAL REQUIRED tree requires your top changeset comment to include: a=... (or, more accurately, a\\S*=...)"
                 return 1
-            else:
-                return 0
             
     except IOError, (err):
         # fail open, I guess. no sense making hg unavailable
         # if the wiki is down
         print "IOError: %s" % err
         pass
     return 0