D2754: phabricator: print deprecation warning only once

2018-03-09 Thread joerg.sonnenberger (Joerg Sonnenberger)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6490b0915881: phabricator: print deprecation warning only 
once (authored by joerg.sonnenberger, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2754?vs=6764=6794

REVISION DETAIL
  https://phab.mercurial-scm.org/D2754

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -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



To: joerg.sonnenberger, #hg-reviewers, durin42
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2754: phabricator: print deprecation warning only once

2018-03-09 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2754

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -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



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel