Changed the APPROVAL REQUIRED portion to allow regex a[0-9\.]*= instead of just a=
authorJohnathan Nightingale <johnath@mozilla.com>
Fri, 20 Nov 2009 11:33:15 -0500
changeset 359108 82916def5de09bfb9df5fc434c177ef388ace4fa
parent 359107 db95bd16d634700d7e81d6fa05b7b0eeb36cc866
child 359109 9d9d00fb627ac5421c14fbb444476215e546f8ba
push id16998
push userrwood@mozilla.com
push dateMon, 02 May 2016 19:42:03 +0000
Changed the APPROVAL REQUIRED portion to allow regex a[0-9\.]*= instead of just a=
hghooks/mozhghooks/treeclosure.py
--- a/hghooks/mozhghooks/treeclosure.py
+++ b/hghooks/mozhghooks/treeclosure.py
@@ -33,18 +33,18 @@ def hook(ui, repo, **kwargs):
             if repo.changectx('tip').description().find(magicwords) == -1:
                 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 repo.changectx('tip').description().lower().find('a=') == -1:
-                print "Pushing to an APPROVAL REQUIRED tree requires your top changeset comment to include: a=..."
+            if re.search('a\S*=', repo.changectx('tip').description().lower()) :
+                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