Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepoutil.py @ 43106:d783f945a701
py3: finish porting iteritems() to pycompat and remove source transformer
This commit finishes porting .iteritems() to pycompat.iteritems()
for the mercurial package.
The translation of .iteritems() to .items() was the last conversion
performed by the source transformer. With the porting to pycompat
complete, we no longer have a need for the source transformer. So
the source transformer has been removed. Good riddance! The code
base is now compatible with Python 2 and Python 3.
For the record, as the person who introduced the source transformer,
it brings me joy to delete it. It accomplished its goal to facilitate
a port to Python 3 without overly burdening people on some painful
low-level differences between Python 2 and 3. It is unfortunate we
still have to wallpaper over many differences with the pycompat
shim. But it is what it is.
Differential Revision: https://phab.mercurial-scm.org/D7015
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 07 Oct 2019 00:04:04 -0400 |
parents | c59eb1560c44 |
children | f7f142d74df3 |
comparison
equal
deleted
inserted
replaced
43105:649d3ac37a12 | 43106:d783f945a701 |
---|---|
18 config, | 18 config, |
19 error, | 19 error, |
20 filemerge, | 20 filemerge, |
21 pathutil, | 21 pathutil, |
22 phases, | 22 phases, |
23 pycompat, | |
23 util, | 24 util, |
24 ) | 25 ) |
25 from .utils import stringutil | 26 from .utils import stringutil |
26 | 27 |
27 nullstate = (b'', b'', b'empty') | 28 nullstate = (b'', b'', b'empty') |
160 if r: | 161 if r: |
161 r = b"%s:%s:%s" % r | 162 r = b"%s:%s:%s" % r |
162 repo.ui.debug(b" subrepo %s: %s %s\n" % (s, msg, r)) | 163 repo.ui.debug(b" subrepo %s: %s %s\n" % (s, msg, r)) |
163 | 164 |
164 promptssrc = filemerge.partextras(labels) | 165 promptssrc = filemerge.partextras(labels) |
165 for s, l in sorted(s1.iteritems()): | 166 for s, l in sorted(pycompat.iteritems(s1)): |
166 a = sa.get(s, nullstate) | 167 a = sa.get(s, nullstate) |
167 ld = l # local state with possible dirty flag for compares | 168 ld = l # local state with possible dirty flag for compares |
168 if wctx.sub(s).dirty(): | 169 if wctx.sub(s).dirty(): |
169 ld = (l[0], l[1] + b"+") | 170 ld = (l[0], l[1] + b"+") |
170 if wctx == actx: # overwrite | 171 if wctx == actx: # overwrite |