hooks: check reviewers case-independently (bug 1422487), r=gps
authorAxel Hecht <axel@pike.org>
Sat, 02 Dec 2017 12:04:48 +0100
changeset 5645 81e4d2af952018b4553d31cac5f89b8214697b58
parent 5644 ac135b39813b65d722035b1eaa238b102e63f8ac
child 5646 ef07a0b86c56188477151e68b3671b61d4e2726b
push id2601
push usergszorc@mozilla.com
push dateMon, 04 Dec 2017 19:46:17 +0000
treeherderversion-control-tools@81e4d2af9520 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1422487
hooks: check reviewers case-independently (bug 1422487), r=gps MozReview-Commit-ID: KCaPyXc0mGQ
hghooks/mozhghooks/check/prevent_ftl_changes.py
hghooks/tests/test-prevent-ftl-changes.t
--- a/hghooks/mozhghooks/check/prevent_ftl_changes.py
+++ b/hghooks/mozhghooks/check/prevent_ftl_changes.py
@@ -57,17 +57,19 @@ class FTLCheck(PreTxnChangegroupCheck):
             # Skip merge changesets
             return True
 
         if is_backout(ctx.description()):
             # Ignore backouts
             return True
 
         if any(f.endswith('.ftl') for f in ctx.files()):
-            requal = parse_requal_reviewers(ctx.description())
+            requal = [
+                r.lower() for r in parse_requal_reviewers(ctx.description())
+            ]
             reviewers = [nick for (name, nick) in FTL_DRIVERS]
             if any(nick in reviewers for nick in requal):
                 return True
 
             print_banner(self.ui, 'error', FTL_COMMIT_FOUND)
             return False
         return True
 
--- a/hghooks/tests/test-prevent-ftl-changes.t
+++ b/hghooks/tests/test-prevent-ftl-changes.t
@@ -51,8 +51,20 @@ Commit adding an FTL file with appropria
   $ hg -q commit -A -m 'add test2.ftl. r=someonelse,stas'
   $ hg push
   pushing to $TESTTMP/normal
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
+
+Commit adding an FTL file with appropriate reviewer works, case-independent
+
+  $ touch test3.ftl
+  $ hg -q commit -A -m 'add test3.ftl. r=Pike'
+  $ hg push
+  pushing to $TESTTMP/normal
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files