Mercurial > public > mercurial-scm > hg
diff tests/artifacts/scripts/generate-churning-bundle.py @ 43110:1fcf79e9943a
tests: use range() in generate-churning-module.py
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!
Differential Revision: https://phab.mercurial-scm.org/D7019
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 07 Oct 2019 10:34:21 -0400 |
parents | 2372284d9457 |
children | c102b704edb5 |
line wrap: on
line diff
--- a/tests/artifacts/scripts/generate-churning-bundle.py Mon Oct 07 10:31:11 2019 -0400 +++ b/tests/artifacts/scripts/generate-churning-bundle.py Mon Oct 07 10:34:21 2019 -0400 @@ -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: