D7019: tests: use range() in generate-churning-module.py

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Mon Oct 7 16:08:23 EDT 2019


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is a test-only script. Performance on Python 2 for creating a
  full list instead of a generator doesn't matter.
  
  With this change, test-check-pyflakes.t passes on Python 3!

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/artifacts/scripts/generate-churning-bundle.py

CHANGE DETAILS

diff --git a/tests/artifacts/scripts/generate-churning-bundle.py b/tests/artifacts/scripts/generate-churning-bundle.py
--- a/tests/artifacts/scripts/generate-churning-bundle.py
+++ b/tests/artifacts/scripts/generate-churning-bundle.py
@@ -62,7 +62,7 @@
     else:
         current = str(iteridx)
 
-    for idx in xrange(NB_LINES):
+    for idx in range(NB_LINES):
         do_change_line = True
         if oldcontent is not None and ALWAYS_CHANGE_LINES < idx:
             do_change_line = not ((idx - iteridx) % OTHER_CHANGES)
@@ -113,7 +113,7 @@
         hg('init')
         updatefile(FILENAME, None)
         hg('commit', '--addremove', '--message', 'initial commit')
-        for idx in xrange(1, NB_CHANGESET + 1):
+        for idx in range(1, NB_CHANGESET + 1):
             if sys.stdout.isatty():
                 print("generating commit #%d/%d" % (idx, NB_CHANGESET))
             if (idx % PERIOD_BRANCHING) == 0:



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


More information about the Mercurial-devel mailing list