Mercurial > hg
changeset 32278:7c3ef55dedbe
obsolete: use 2 argument form of enumerate()
The 2 argument form of enumerate was added in Python 2.6. This
change effectively reverts 10880c8aad85.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 13 May 2017 11:42:42 -0700 |
parents | 80e3002cd29e |
children | 68c43a416585 |
files | mercurial/obsolete.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/obsolete.py Sat May 13 11:31:36 2017 -0700 +++ b/mercurial/obsolete.py Sat May 13 11:42:42 2017 -0700 @@ -217,8 +217,8 @@ if not parents: # mark that we explicitly recorded no parents metadata['p0'] = '' - for i, p in enumerate(parents): - metadata['p%i' % (i + 1)] = node.hex(p) + for i, p in enumerate(parents, 1): + metadata['p%i' % i] = node.hex(p) metadata = _fm0encodemeta(metadata) numsuc = len(sucs) format = _fm0fixed + (_fm0node * numsuc)