Patchwork D7468: phases: make `allphases` a list on py3 also

login
register
mail settings
Submitter phabricator
Date Nov. 21, 2019, 11:23 p.m.
Message ID <differential-rev-PHID-DREV-qyi2xoecjzzbae32hm6t-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43392/
State Superseded
Headers show

Comments

phabricator - Nov. 21, 2019, 11:23 p.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Pytype complained that `range` doesn't support slicing, so make this a list like
  it was on py2.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/phases.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -134,7 +134,7 @@ 
 public, draft, secret = range(3)
 internal = INTERNAL_FLAG | HIDEABLE_FLAG
 archived = HIDEABLE_FLAG
-allphases = range(internal + 1)
+allphases = list(range(internal + 1))
 trackedphases = allphases[1:]
 # record phase names
 cmdphasenames = [b'public', b'draft', b'secret']  # known to `hg phase` command