Patchwork D9259: py3: hggettext

login
register
mail settings
Submitter phabricator
Date Oct. 29, 2020, 12:56 p.m.
Message ID <differential-rev-PHID-DREV-v2uldylg2mjaad23mlfq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47530/
State Superseded
Headers show

Comments

phabricator - Oct. 29, 2020, 12:56 p.m.
danchr created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `itervalues()` is only available on Python 2. Since this script
  doesn't currently refer to the main Mercurial modules, and as a result
  doesn't have easy access to the `pycompat` module, I simply changed it
  to use `value()` instead. Although this allocates a list on Python 2,
  I'd consider that acceptable for a utility script; Mercurial doesn't
  have all _that_ many commands anyway.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  i18n/hggettext

CHANGE DETAILS




To: danchr, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/i18n/hggettext b/i18n/hggettext
--- a/i18n/hggettext
+++ b/i18n/hggettext
@@ -123,7 +123,7 @@ 
     if not cmdtable:
         # Maybe we are processing mercurial.commands?
         cmdtable = getattr(mod, 'table', {})
-    functions.extend((c[0], False) for c in cmdtable.itervalues())
+    functions.extend((c[0], False) for c in cmdtable.values())
 
     for func, rstrip in functions:
         if func.__doc__: