changeset 36817:98cbfbbe33bb

phabricator: print deprecation warning only once Differential Revision: https://phab.mercurial-scm.org/D2754
author Joerg Sonnenberger <joerg@bec.de>
date Fri, 09 Mar 2018 16:09:27 +0100
parents 9ab7eba99fe5
children f8b65ff02e3e
files contrib/phabricator.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/phabricator.py	Thu Mar 08 21:17:26 2018 -0800
+++ b/contrib/phabricator.py	Fri Mar 09 16:09:27 2018 +0100
@@ -99,13 +99,17 @@
     process('', params)
     return util.urlreq.urlencode(flatparams)
 
+printed_token_warning = False
+
 def readlegacytoken(repo):
     """Transitional support for old phabricator tokens.
 
     Remove before the 4.6 release.
     """
+    global printed_token_warning
     token = repo.ui.config('phabricator', 'token')
-    if token:
+    if token and not printed_token_warning:
+        printed_token_warning = True
         repo.ui.warn(_('phabricator.token is deprecated - please '
                        'migrate to the phabricator.auth section.\n'))
     return token