hghooks: don't advertise upgrade notice during mozbackout (
bug 1288845); r?glob
Without this, the hook prints a warning on the server when running
`hg mozbackout` because we're not using bundle2.
MozReview-Commit-ID: 1s6BwZZohwa
--- a/hghooks/mozhghooks/advertise_upgrade.py
+++ b/hghooks/mozhghooks/advertise_upgrade.py
@@ -1,14 +1,14 @@
# 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
def hook(ui, repo, **kwargs):
- if 'bundle2' not in kwargs:
+ if 'bundle2' not in kwargs and kwargs.get('source') != 'mozbackout':
ui.write('\n')
ui.write('YOU ARE PUSHING WITH AN OUT OF DATE MERCURIAL CLIENT!\n')
ui.write('newer versions are faster and have numerous bug fixes\n')
ui.write('upgrade instructions are at the following URL:\n')
ui.write('https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/installing.html\n')
return 0