hghooks: move webidl hook to modern hook class (bug 1454296) r?gps draft
authorbyron jones <glob@mozilla.com>
Wed, 18 Apr 2018 12:28:04 +0800
changeset 12244 8a77ed2182d1fe450eb16d502d16f3a2a25a0b2d
parent 12243 9d798d6e06c29cfe6d87b6a6c7605d062518a431
child 12245 7a3ffaac2d6f965270dae63102d4772047a5c742
push id1919
push userbjones@mozilla.com
push dateWed, 02 May 2018 05:27:15 +0000
reviewersgps
bugs1454296
hghooks: move webidl hook to modern hook class (bug 1454296) r?gps move webidl hook to the modern hg hook framework, and remove the extraneous servo message. MozReview-Commit-ID: Jsn2PxL1Dys
hghooks/mozhghooks/check/prevent_webidl_changes.py
hghooks/mozhghooks/checks.py
hghooks/mozhghooks/extension.py
hghooks/mozhghooks/prevent_webidl_changes.py
hghooks/tests/test-prevent-sync-ipc-changes.t
hghooks/tests/test-prevent-webidl-changes.t
hghooks/tests/test-prevent-webidl.t
new file mode 100644
--- /dev/null
+++ b/hghooks/mozhghooks/check/prevent_webidl_changes.py
@@ -0,0 +1,146 @@
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+from __future__ import absolute_import
+
+import collections
+from mercurial import util
+from mercurial.node import short
+from mozautomation.commitparser import (
+    parse_requal_reviewers,
+    is_backout,
+)
+
+from ..checks import (
+    PreTxnChangegroupCheck,
+    print_banner,
+    print_notice,
+)
+
+DOM_PEERS = [
+    dict(name='Andrea Marchesini', nick=['baku'], email=['amarchesini@mozilla.com']),
+    dict(name='Andrew McCreight', nick=['mccr8'], email=['continuation@gmail.com']),
+    dict(name='Ben Kelly', nick=['bkelly'], email=['bkelly@mozilla.com', 'ben@wanderview.com']),
+    dict(name='Blake Kaplan', nick=['mrbkap'], email=['mrbkap@gmail.com']),
+    dict(name='Bobby Holley', nick=['bholley'], email=['bholley@mozilla.com']),
+    dict(name='Boris Zbarsky', nick=['bz', 'bzbarsky'], email=['bzbarsky@mit.edu']),
+    dict(name='Ehsan Akhgari', nick=['ehsan'], email=['ehsan@mozilla.com', 'ehsan.akhgari@gmail.com']),
+    dict(name='Henri Sivonen', nick=['hsivonen'], email=['hsivonen@hsivonen.fi']),
+    dict(name='Kyle Machulis', nick=['qdot', 'kmachulis'], email=['qdot@mozilla.com', 'kmachulis@mozilla.com', 'kyle@nonpolynomial.com']),
+    dict(name='Nika Layzell', nick=['mystor'], email=['nika@thelayzells.com']),
+    dict(name='Olli Pettay', nick=['smaug'], email=['olli.pettay@helsinki.fi', 'bugs@pettay.fi']),
+    dict(name='Peter Van der Beken', nick=['peterv'], email=['peterv@propagandism.org']),
+]
+
+# The root directory for WebIDL files which contain only ChromeOnly
+# interfaces, and do not require DOM peer review.
+CHROME_WEBIDL_ROOT = 'dom/chrome-webidl/'
+
+# Servo WebIDL files do not need DOM Peer review.
+SERVO_ROOT = 'servo/'
+
+MISSING_REVIEW = """
+Changeset %s alters WebIDL file(s) without DOM peer review:
+%s
+
+Please, request review from either:
+"""
+for p in DOM_PEERS:
+    MISSING_REVIEW += "  - {} (:{})\n".format(p['name'], p['nick'][0])
+
+CHROME_ONLY = """
+Not enforcing DOM peer review for WebIDL files within the chrome WebIDL root.
+Please make sure changes do not contain any web-visible binding definitions.
+"""
+
+SERVO_ONLY = """
+Not enforcing DOM peer review for WebIDL files within Servo.
+Please make sure changes do not contain any web-visible binding definitions.
+"""
+
+
+class WebIDLCheck(PreTxnChangegroupCheck):
+    """Prevents WebIDL file modifications without appropriate review."""
+    @property
+    def name(self):
+        return 'webidl_check'
+
+    def relevant(self):
+        return self.repo_metadata['firefox_releasing']
+
+    def pre(self, node):
+        # Accept the entire push for code uplifts
+        changesets = list(self.repo.changelog.revs(self.repo[node].rev()))
+        self.is_uplift = 'a=release' in self.repo.changectx(
+            changesets[-1]).description().lower()
+
+    def check(self, ctx):
+        if self.is_uplift:
+            return True
+
+        # Ignore merge changesets
+        if len(ctx.parents()) > 1:
+            return True
+
+        # Ignore backouts
+        if is_backout(ctx.description()):
+            return True
+
+        # Ignore changes that don't touch .webidl files
+        webidl_files = [f for f in ctx.files() if f.endswith('.webidl')]
+        if not webidl_files:
+            return True
+
+        # Allow patches authored by peers
+        if is_peer_email(util.email(ctx.user())):
+            return True
+
+        # Categorise files
+        file_counts = collections.Counter()
+        review_required_files = []
+        for f in webidl_files:
+            file_counts['total'] += 1
+            if f.startswith(CHROME_WEBIDL_ROOT):
+                file_counts['chrome'] += 1
+            elif f.startswith(SERVO_ROOT):
+                file_counts['servo'] += 1
+            else:
+                review_required_files.append(f)
+
+        # Allow chrome-only and servo-only changes
+        if file_counts['chrome'] + file_counts['servo'] == file_counts['total']:
+            if file_counts['chrome']:
+                print_notice(self.ui, CHROME_ONLY)
+            if file_counts['servo']:
+                print_notice(self.ui, SERVO_ONLY)
+            return True
+
+        # Allow if reviewed by any peer
+        requal = list(parse_requal_reviewers(ctx.description()))
+        if any(is_peer_nick(nick) for nick in requal):
+            return True
+
+        # Reject
+        print_banner(self.ui, 'error',
+                     MISSING_REVIEW % (short(ctx.node()),
+                                       '\n'.join(review_required_files)))
+        return False
+
+    def post_check(self):
+        return True
+
+
+def is_peer_email(email):
+    email = email.lower()
+    for peer in DOM_PEERS:
+        if email in peer['email']:
+            return True
+    return False
+
+
+def is_peer_nick(nick):
+    nick = nick.lower()
+    for peer in DOM_PEERS:
+        if nick in peer['nick']:
+            return True
+    return False
--- a/hghooks/mozhghooks/checks.py
+++ b/hghooks/mozhghooks/checks.py
@@ -15,16 +15,21 @@ def print_banner(ui, level, message):
     banner = [
         ' {} '.format(level.upper()).center(width, '*'),
         message.strip(),
         '*' * width,
     ]
     ui.write('\n' + '\n'.join(banner) + '\n\n')
 
 
+def print_notice(ui, message):
+    for l in message.strip().splitlines():
+        ui.write('-- %s\n' % l)
+
+
 class PreTxnChangegroupCheck(object):
     """A check that operates as a pretxnchangegroup hook.
 
     A method is called for every changeset as part of the transaction.
 
     A method is also called once all changesets have been examined. This allows
     each changeset invocation to set state which is examined once all changesets
     have been examined.
--- a/hghooks/mozhghooks/extension.py
+++ b/hghooks/mozhghooks/extension.py
@@ -46,28 +46,30 @@ def get_check_classes(hook):
     # TODO come up with a mechanism for automatically discovering checks
     # so we don't have to enumerate them all.
     from mozhghooks.check import (
         advertise_upgrade,
         prevent_cross_channel_messages,
         prevent_ftl_changes,
         prevent_subrepos,
         prevent_symlinks,
+        prevent_webidl_changes,
         prevent_wptsync_changes,
         single_root,
         try_task_config_file,
     )
 
     # TODO check to hook mapping should also be automatically discovered.
     if hook == 'pretxnchangegroup':
         return (
             prevent_cross_channel_messages.XChannelMessageCheck,
             prevent_ftl_changes.FTLCheck,
             prevent_subrepos.PreventSubReposCheck,
             prevent_symlinks.PreventSymlinksCheck,
+            prevent_webidl_changes.WebIDLCheck,
             prevent_wptsync_changes.WPTSyncCheck,
             single_root.SingleRootCheck,
             try_task_config_file.TryConfigCheck,
         )
 
     elif hook == 'changegroup':
         return (
             advertise_upgrade.AdvertiseUpgradeCheck,
--- a/hghooks/mozhghooks/prevent_webidl_changes.py
+++ b/hghooks/mozhghooks/prevent_webidl_changes.py
@@ -33,48 +33,16 @@ def isBackout(message):
         if r.search(message):
             return True
     return False
 
 def hook(ui, repo, hooktype, node, source=None, **kwargs):
     if source in ('pull', 'strip'):
         return 0
 
-    DOM_peers = [
-        'peterv',             # Peter Van der Beken
-        'bz', 'bzbarsky',     # Boris Zbarsky
-        'smaug',              # Olli Pettay
-        'hsivonen',           # Henri Sivonen
-        'mrbkap',             # Blake Kaplan
-        'bholley',            # Bobby Holley
-        'baku',               # Andrea Marchesini
-        'ehsan',              # Ehsan Akhgari
-        'bkelly',             # Ben Kelly
-        'qdot', 'kmachulis',  # Kyle Machulis
-        'mccr8',              # Andrew McCreight
-        'mystor',             # Nika Layzell
-    ]
-    DOM_authors = [
-        'peterv@propagandism.org',  # Peter Van der Beken
-        'bzbarsky@mit.edu',         # Boris Zbarsky
-        'olli.pettay@helsinki.fi',  # Olli Pettay
-        'bugs@pettay.fi',           # Olli Pettay
-        'hsivonen@hsivonen.fi',     # Henri Sivonen
-        'mrbkap@gmail.com',         # Blake Kaplan
-        'amarchesini@mozilla.com',  # Andrea Marchesini
-        'ehsan@mozilla.com',        # Ehsan Akhgari
-        'ehsan.akhgari@gmail.com',  # Ehsan Akhgari
-        'bkelly@mozilla.com',       # Ben Kelly
-        'ben@wanderview.com',       # Ben Kelly
-        'qdot@mozilla.com',         # Kyle Machulis
-        'kmachulis@mozilla.com',    # Kyle Machulis
-        'kyle@nonpolynomial.com',   # Kyle Machulis
-        'continuation@gmail.com',   # Andrew McCreight
-        'nika@thelayzells.com',     # Nika Layzell
-    ]
     IPC_peers = [
         'billm',             # Bill McCloskey
         'dvander',           # David Anderson
         'jld',               # Jed Davis
         'kanru',             # Kan-Ru Chen
         'bkelly',            # Ben Kelly
         'froydnj',           # Nathan Froyd
         'mccr8',             # Andrew McCreight
@@ -87,35 +55,30 @@ def hook(ui, repo, hooktype, node, sourc
         'kchen@mozilla.com',       # Kan-Ru Chen
         'kanru@kanru.info',        # Kan-Ru Chen
         'bkelly@mozilla.com',      # Ben Kelly
         'ben@wanderview.com',      # Ben Kelly
         'nfroyd@mozilla.com',      # Nathan Froyd
         'continuation@gmail.com',  # Andrew McCreight
     ]
 
-    # The root directory for WebIDL files which contain only ChromeOnly
-    # interfaces, and do not require DOM peer review.
-    chrome_webidl_root = 'dom/chrome-webidl/'
-
     error = ""
     note = ""
     changesets = list(repo.changelog.revs(repo[node].rev()))
     if 'a=release' in repo.changectx(changesets[-1]).description().lower():
         # Accept the entire push for code uplifts.
         return 0
     # Loop through each changeset being added to the repository
     for i in reversed(changesets):
         c = repo.changectx(i)
 
         if len(c.parents()) > 1:
             # Skip merge changesets
             continue
 
-        webidlReviewed = None
         syncIPCReviewed = None
 
         # Loop through each file for the current changeset
         for file in c.files():
             if file.startswith('servo/'):
                 ui.write('(%s modifies %s from Servo; not enforcing peer '
                          'review)\n' % (short(c.node()), file))
                 continue
@@ -135,42 +98,24 @@ def hook(ui, repo, hooktype, node, sourc
               # We allow peers to commit changes without any review
               # requirements assuming that they have looked at the changes
               # they're committing.
               if any(peer == email for peer in authors):
                   return True
 
               return False
 
-            # Only check WebIDL files here.
-            if file.endswith('.webidl'):
-                if file.startswith(chrome_webidl_root):
-                    print ("Not enforcing DOM peer review for WebIDL file %s "
-                           "in changeset %s since it is in the chrome WebIDL "
-                           "root. Please make sure that it does not contain "
-                           "any web-visible binding definitions."
-                           % (file, short(c.node())))
-                else:
-                    if webidlReviewed is None:
-                        webidlReviewed = search(DOM_authors, DOM_peers)
-                    if not webidlReviewed:
-                        error += "WebIDL file %s altered in changeset %s without DOM peer review\n" % (file, short(c.node()))
-                        note = "\nChanges to WebIDL files in this repo require review from a DOM peer in the form of r=...\nThis is to ensure that we behave responsibly with exposing new Web APIs. We appreciate your understanding..\n"
             # Only check the IPDL sync-messages.ini here.
-            elif file.endswith('ipc/ipdl/sync-messages.ini'):
+            if file.endswith('ipc/ipdl/sync-messages.ini'):
                 if syncIPCReviewed is None:
                     syncIPCReviewed = search(IPC_authors, IPC_peers)
                 if not syncIPCReviewed:
                     error += "sync-messages.ini altered in changeset %s without IPC peer review\n" % (short(c.node()))
                     note = "\nChanges to sync-messages.ini in this repo require review from a IPC peer in the form of r=...\nThis is to ensure that we behave responsibly by not adding sync IPC messages that cause performance issues needlessly. We appreciate your understanding..\n"
 
-        if webidlReviewed:
-            print ("You've received proper review from a DOM peer on the "
-                   "WebIDL change(s) in changeset %s, thanks for paying "
-                   "enough attention." % short(c.node()))
         if syncIPCReviewed:
             print ("You've received proper review from an IPC peer on the "
                    "sync-messages.ini change(s) in commit %s, thanks for "
                    "paying enough attention." % short(c.node()))
     # Check if an error occured in any of the files that were changed
     if error != "":
         print "\n\n************************** ERROR ****************************"
         ui.warn("\n" + error + "\n")
new file mode 100644
--- /dev/null
+++ b/hghooks/tests/test-prevent-sync-ipc-changes.t
@@ -0,0 +1,95 @@
+  $ . $TESTDIR/hghooks/tests/common.sh
+
+  $ hg init server
+  $ cd server
+  $ cat >> .hg/hgrc << EOF
+  > [hooks]
+  > pretxnchangegroup.prevent_webidl = python:mozhghooks.prevent_webidl_changes.hook
+  > EOF
+
+  $ echo "foo" > dummy
+  $ hg commit -A -m 'original repo commit; r=baku'
+  adding dummy
+
+  $ cd ..
+  $ hg clone server client
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd client
+mq provides `hg strip` for older Mercurial versions and supplies it even
+in modern versions
+  $ cat >> .hg/hgrc << EOF
+  > [extensions]
+  > mq=
+  > EOF
+
+Editing the sync-messages.ini file without any review should fail
+
+  $ mkdir -p ipc/ipdl
+  $ echo "foo" > ipc/ipdl/sync-messages.ini
+  $ hg add ipc/ipdl/sync-messages.ini
+  $ hg commit -m 'Bug 123 - Add sync-messages.ini'
+  $ hg push
+  pushing to $TESTTMP/server
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  
+  
+  ************************** ERROR ****************************
+  
+  sync-messages.ini altered in changeset 8fb3e82ba334 without IPC peer review
+  
+  
+  Changes to sync-messages.ini in this repo require review from a IPC peer in the form of r=...
+  This is to ensure that we behave responsibly by not adding sync IPC messages that cause performance issues needlessly. We appreciate your understanding..
+  
+  *************************************************************
+  
+  
+  transaction abort!
+  rollback completed
+  abort: pretxnchangegroup.prevent_webidl hook failed
+  [255]
+
+Editing the sync-messages.ini file without /IPC/ peer review should fail
+
+  $ hg -q commit --amend -m 'Bug 123 - Add Bar; r=foobar'
+  $ hg push
+  pushing to $TESTTMP/server
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  
+  
+  ************************** ERROR ****************************
+  
+  sync-messages.ini altered in changeset d970a5c85d15 without IPC peer review
+  
+  
+  Changes to sync-messages.ini in this repo require review from a IPC peer in the form of r=...
+  This is to ensure that we behave responsibly by not adding sync IPC messages that cause performance issues needlessly. We appreciate your understanding..
+  
+  *************************************************************
+  
+  
+  transaction abort!
+  rollback completed
+  abort: pretxnchangegroup.prevent_webidl hook failed
+  [255]
+
+Editing the sync-messages.ini file with /IPC/ peer review should pass
+
+  $ hg -q commit --amend -m 'Bug 123 - Add Bar; r=billm'
+  $ hg push
+  pushing to $TESTTMP/server
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  You've received proper review from an IPC peer on the sync-messages.ini change(s) in commit 62716423067e, thanks for paying enough attention.
rename from hghooks/tests/test-prevent-webidl.t
rename to hghooks/tests/test-prevent-webidl-changes.t
--- a/hghooks/tests/test-prevent-webidl.t
+++ b/hghooks/tests/test-prevent-webidl-changes.t
@@ -1,14 +1,15 @@
+
+  $ . $TESTDIR/hghooks/tests/common.sh
+
   $ hg init server
+  $ configurehooks server
+  $ touch server/.hg/IS_FIREFOX_REPO
   $ cd server
-  $ cat >> .hg/hgrc << EOF
-  > [hooks]
-  > pretxnchangegroup.prevent_webidl = python:mozhghooks.prevent_webidl_changes.hook
-  > EOF
 
   $ echo "interface Foo{};" > original.webidl
   $ echo "foo" > dummy
   $ hg commit -A -m 'original repo commit; r=baku'
   adding dummy
   adding original.webidl
 
   $ cd ..
@@ -30,103 +31,122 @@ Editing a .webidl file without any revie
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
   
-  
-  ************************** ERROR ****************************
-  
-  WebIDL file original.webidl altered in changeset 743ef64f8a38 without DOM peer review
-  
+  ******************************* ERROR *******************************
+  Changeset 743ef64f8a38 alters WebIDL file(s) without DOM peer review:
+  original.webidl
   
-  Changes to WebIDL files in this repo require review from a DOM peer in the form of r=...
-  This is to ensure that we behave responsibly with exposing new Web APIs. We appreciate your understanding..
-  
-  *************************************************************
-  
+  Please, request review from either:
+    - Andrea Marchesini (:baku)
+    - Andrew McCreight (:mccr8)
+    - Ben Kelly (:bkelly)
+    - Blake Kaplan (:mrbkap)
+    - Bobby Holley (:bholley)
+    - Boris Zbarsky (:bz)
+    - Ehsan Akhgari (:ehsan)
+    - Henri Sivonen (:hsivonen)
+    - Kyle Machulis (:qdot)
+    - Nika Layzell (:mystor)
+    - Olli Pettay (:smaug)
+    - Peter Van der Beken (:peterv)
+  *********************************************************************
   
   transaction abort!
   rollback completed
-  abort: pretxnchangegroup.prevent_webidl hook failed
+  abort: pretxnchangegroup.mozhooks hook failed
   [255]
 
 Editing a .webidl file without /DOM/ peer review should fail
 
   $ hg -q commit --amend -m 'Bug 123 - Add Bar; r=foobar'
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
   
-  
-  ************************** ERROR ****************************
-  
-  WebIDL file original.webidl altered in changeset 0cfb912b8138 without DOM peer review
-  
+  ******************************* ERROR *******************************
+  Changeset 0cfb912b8138 alters WebIDL file(s) without DOM peer review:
+  original.webidl
   
-  Changes to WebIDL files in this repo require review from a DOM peer in the form of r=...
-  This is to ensure that we behave responsibly with exposing new Web APIs. We appreciate your understanding..
-  
-  *************************************************************
-  
+  Please, request review from either:
+    - Andrea Marchesini (:baku)
+    - Andrew McCreight (:mccr8)
+    - Ben Kelly (:bkelly)
+    - Blake Kaplan (:mrbkap)
+    - Bobby Holley (:bholley)
+    - Boris Zbarsky (:bz)
+    - Ehsan Akhgari (:ehsan)
+    - Henri Sivonen (:hsivonen)
+    - Kyle Machulis (:qdot)
+    - Nika Layzell (:mystor)
+    - Olli Pettay (:smaug)
+    - Peter Van der Beken (:peterv)
+  *********************************************************************
   
   transaction abort!
   rollback completed
-  abort: pretxnchangegroup.prevent_webidl hook failed
+  abort: pretxnchangegroup.mozhooks hook failed
   [255]
 
 Editing a .webidl file by DOM peers without review should pass
 
   $ hg -q commit --amend -u 'Andrea Marchesini <amarchesini@mozilla.com>' -m 'Bug 123 - Add Bar'
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset 4d1f9038e38b, thanks for paying enough attention.
 
 Editing a .webidl file without /DOM/ peer review in the same push as a commit with review should fail
 
   $ echo "interface Update1{};" >> original.webidl
   $ hg -q commit -m 'Bug 123; r=baku'
   $ echo "interface Update2{};" >> original.webidl
   $ hg -q commit -m 'Bug 123'
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 2 changesets with 2 changes to 1 files
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset 7d680ea3e6a8, thanks for paying enough attention.
   
-  
-  ************************** ERROR ****************************
-  
-  WebIDL file original.webidl altered in changeset a9b3d7778cda without DOM peer review
+  ******************************* ERROR *******************************
+  Changeset a9b3d7778cda alters WebIDL file(s) without DOM peer review:
+  original.webidl
   
-  
-  Changes to WebIDL files in this repo require review from a DOM peer in the form of r=...
-  This is to ensure that we behave responsibly with exposing new Web APIs. We appreciate your understanding..
-  
-  *************************************************************
-  
+  Please, request review from either:
+    - Andrea Marchesini (:baku)
+    - Andrew McCreight (:mccr8)
+    - Ben Kelly (:bkelly)
+    - Blake Kaplan (:mrbkap)
+    - Bobby Holley (:bholley)
+    - Boris Zbarsky (:bz)
+    - Ehsan Akhgari (:ehsan)
+    - Henri Sivonen (:hsivonen)
+    - Kyle Machulis (:qdot)
+    - Nika Layzell (:mystor)
+    - Olli Pettay (:smaug)
+    - Peter Van der Beken (:peterv)
+  *********************************************************************
   
   transaction abort!
   rollback completed
-  abort: pretxnchangegroup.prevent_webidl hook failed
+  abort: pretxnchangegroup.mozhooks hook failed
   [255]
 
   $ hg -q strip '.^'
 
 Editing a .webidl file without proper DOM peer review when doing code uplift should pass
 
   $ echo "interface Uplift1{};" >> original.webidl
   $ hg commit -m 'Bug 123; r=foobar'
@@ -149,62 +169,57 @@ WebIDL change after release uplift fails
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 2 changesets with 2 changes to 2 files
   
-  
-  ************************** ERROR ****************************
-  
-  WebIDL file original.webidl altered in changeset 3043c2c5e650 without DOM peer review
-  
+  ******************************* ERROR *******************************
+  Changeset 3043c2c5e650 alters WebIDL file(s) without DOM peer review:
+  original.webidl
   
-  Changes to WebIDL files in this repo require review from a DOM peer in the form of r=...
-  This is to ensure that we behave responsibly with exposing new Web APIs. We appreciate your understanding..
-  
-  *************************************************************
-  
+  Please, request review from either:
+    - Andrea Marchesini (:baku)
+    - Andrew McCreight (:mccr8)
+    - Ben Kelly (:bkelly)
+    - Blake Kaplan (:mrbkap)
+    - Bobby Holley (:bholley)
+    - Boris Zbarsky (:bz)
+    - Ehsan Akhgari (:ehsan)
+    - Henri Sivonen (:hsivonen)
+    - Kyle Machulis (:qdot)
+    - Nika Layzell (:mystor)
+    - Olli Pettay (:smaug)
+    - Peter Van der Beken (:peterv)
+  *********************************************************************
   
   transaction abort!
   rollback completed
-  abort: pretxnchangegroup.prevent_webidl hook failed
+  abort: pretxnchangegroup.mozhooks hook failed
   [255]
 
   $ hg strip -r 'draft()' > /dev/null
 
 Multiple reviewers, one of which is a DOM peer, should be allowed
 
   $ echo "interface MultipleReviewers1{};" >> original.webidl
   $ hg commit -m 'Bug 123; r=foobar,baku'
   $ echo "interface MultipleReviewers2{};" >> original.webidl
   $ hg commit -m 'Bug 123; r=foobar r=baku'
   $ echo "interface MultipleReviewers3{};" >> original.webidl
   $ hg commit -m 'Bug 123; r=foobar r=lumpy,baku'
-  $ echo "interface MultipleReviewers4{};" >> original.webidl
-  $ hg commit -m 'Bug 123; sr=foobar,baku'
-  $ echo "interface MultipleReviewers5{};" >> original.webidl
-  $ hg commit -m 'Bug 123; sr=foobar sr=baku'
-  $ echo "interface MultipleReviewers6{};" >> original.webidl
-  $ hg commit -m 'Bug 123; sr=foobar sr=lumpy,baku'
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
-  added 6 changesets with 6 changes to 1 files
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset dad5c7baef94, thanks for paying enough attention.
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset b1646a4a9618, thanks for paying enough attention.
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset 38a76e7d36bc, thanks for paying enough attention.
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset 036d459fcf08, thanks for paying enough attention.
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset c51ae3035d1a, thanks for paying enough attention.
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset 5d988e01757f, thanks for paying enough attention.
+  added 3 changesets with 3 changes to 1 files
 
 A merge commit touching a .webidl file with proper DOM peer review is allowed
 
   $ echo "interface Merge{};" >> original.webidl
   $ hg commit -m 'Bug 123; r=foobar,baku'
   $ mergerev=`hg log --template {rev} -r .`
   $ hg up -r 'last(public())'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -217,17 +232,16 @@ A merge commit touching a .webidl file w
   $ hg commit -m 'merge'
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 3 changesets with 2 changes to 2 files
-  You've received proper review from a DOM peer on the WebIDL change(s) in changeset 06ad41d11f80, thanks for paying enough attention.
 
 Editing a .webidl file in a backout without proper DOM peer review is allowed
 
   $ echo "interface Test{};" > backout1.webidl
   $ hg commit -A -m 'Backed out changeset 593d94e9492e'
   adding backout1.webidl
   $ hg push
   pushing to $TESTTMP/server
@@ -265,27 +279,16 @@ Editing a .webidl file in a backout with
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
 
-  $ echo "interface Test{};" > backout5.webidl
-  $ hg commit -A -m 'Revert to changeset a87ee7550f6a due to incomplete backout'
-  adding backout5.webidl
-  $ hg push
-  pushing to $TESTTMP/server
-  searching for changes
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 1 changes to 1 files
-
   $ echo "interface Test{};" > backout6.webidl
   $ hg commit -A -m 'Backed out 7 changesets (bug 824717) for bustage.'
   adding backout6.webidl
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
@@ -330,95 +333,65 @@ Hook should not run when stripping
   adding servo/interface.webidl
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  (79921ab00c00 modifies servo/interface.webidl from Servo; not enforcing peer review)
+  -- Not enforcing DOM peer review for WebIDL files within Servo.
+  -- Please make sure changes do not contain any web-visible binding definitions.
 
 Editing a .webidl file that isn't in a web root should pass
 
   $ mkdir -p dom/chrome-webidl
   $ echo "[ChromeOnly] interface MozFoo{};" > dom/chrome-webidl/MozFoo.webidl
   $ hg add dom/chrome-webidl/MozFoo.webidl
   $ hg commit -m 'Bug 123 - Add MozFoo'
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  Not enforcing DOM peer review for WebIDL file dom/chrome-webidl/MozFoo.webidl in changeset e4bbe117b4fe since it is in the chrome WebIDL root. Please make sure that it does not contain any web-visible binding definitions.
-
-Editing the sync-messages.ini file without any review should fail
+  -- Not enforcing DOM peer review for WebIDL files within the chrome WebIDL root.
+  -- Please make sure changes do not contain any web-visible binding definitions.
 
-  $ mkdir -p ipc/ipdl
-  $ echo "foo" > ipc/ipdl/sync-messages.ini
-  $ hg add ipc/ipdl/sync-messages.ini
-  $ hg commit -m 'Bug 123 - Add sync-messages.ini'
+Editing multiple .webidl files without review should fail
+
+  $ echo "interface Foo{};" >> dom/file1.webidl
+  $ echo "interface Bar{};" >> dom/file2.webidl
+  $ hg commit -q -A -m 'Bug 123 - Add Foo and Bar'
   $ hg push
   pushing to $TESTTMP/server
   searching for changes
   adding changesets
   adding manifests
   adding file changes
-  added 1 changesets with 1 changes to 1 files
-  
+  added 1 changesets with 2 changes to 2 files
   
-  ************************** ERROR ****************************
-  
-  sync-messages.ini altered in changeset d6b9948481a3 without IPC peer review
+  ******************************* ERROR *******************************
+  Changeset 4cc0a6ce2e87 alters WebIDL file(s) without DOM peer review:
+  dom/file1.webidl
+  dom/file2.webidl
   
-  
-  Changes to sync-messages.ini in this repo require review from a IPC peer in the form of r=...
-  This is to ensure that we behave responsibly by not adding sync IPC messages that cause performance issues needlessly. We appreciate your understanding..
-  
-  *************************************************************
-  
+  Please, request review from either:
+    - Andrea Marchesini (:baku)
+    - Andrew McCreight (:mccr8)
+    - Ben Kelly (:bkelly)
+    - Blake Kaplan (:mrbkap)
+    - Bobby Holley (:bholley)
+    - Boris Zbarsky (:bz)
+    - Ehsan Akhgari (:ehsan)
+    - Henri Sivonen (:hsivonen)
+    - Kyle Machulis (:qdot)
+    - Nika Layzell (:mystor)
+    - Olli Pettay (:smaug)
+    - Peter Van der Beken (:peterv)
+  *********************************************************************
   
   transaction abort!
   rollback completed
-  abort: pretxnchangegroup.prevent_webidl hook failed
+  abort: pretxnchangegroup.mozhooks hook failed
   [255]
-
-Editing the sync-messages.ini file without /IPC/ peer review should fail
-
-  $ hg -q commit --amend -m 'Bug 123 - Add Bar; r=foobar'
-  $ hg push
-  pushing to $TESTTMP/server
-  searching for changes
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 1 changes to 1 files
-  
-  
-  ************************** ERROR ****************************
-  
-  sync-messages.ini altered in changeset e5a374f9bf9b without IPC peer review
-  
-  
-  Changes to sync-messages.ini in this repo require review from a IPC peer in the form of r=...
-  This is to ensure that we behave responsibly by not adding sync IPC messages that cause performance issues needlessly. We appreciate your understanding..
-  
-  *************************************************************
-  
-  
-  transaction abort!
-  rollback completed
-  abort: pretxnchangegroup.prevent_webidl hook failed
-  [255]
-
-Editing the sync-messages.ini file with /IPC/ peer review should pass
-
-  $ hg -q commit --amend -m 'Bug 123 - Add Bar; r=billm'
-  $ hg push
-  pushing to $TESTTMP/server
-  searching for changes
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 1 changes to 1 files
-  You've received proper review from an IPC peer on the sync-messages.ini change(s) in commit b571eaaf6a18, thanks for paying enough attention.
+