##// END OF EJS Templates
py3: source-transform only call-sites of iteritems(), not definitions...
Martin von Zweigbergk -
r42809:3018749a default
parent child Browse files
Show More
@@ -167,6 +167,8 b' class lazyremotenamedict(mutablemapping)'
167 for k, vtup in self.potentialentries.iteritems():
167 for k, vtup in self.potentialentries.iteritems():
168 yield (k, [bin(vtup[0])])
168 yield (k, [bin(vtup[0])])
169
169
170 items = iteritems
171
170 class remotenames(object):
172 class remotenames(object):
171 """
173 """
172 This class encapsulates all the remotenames state. It also contains
174 This class encapsulates all the remotenames state. It also contains
@@ -225,7 +225,9 b' if sys.version_info[0] >= 3:'
225
225
226 # It changes iteritems/values to items/values as they are not
226 # It changes iteritems/values to items/values as they are not
227 # present in Python 3 world.
227 # present in Python 3 world.
228 elif fn in ('iteritems', 'itervalues'):
228 elif (fn in ('iteritems', 'itervalues') and
229 not (tokens[i - 1].type == token.NAME and
230 tokens[i - 1].string == 'def')):
229 yield t._replace(string=fn[4:])
231 yield t._replace(string=fn[4:])
230 continue
232 continue
231
233
@@ -236,7 +238,7 b' if sys.version_info[0] >= 3:'
236 # ``replacetoken`` or any mechanism that changes semantics of module
238 # ``replacetoken`` or any mechanism that changes semantics of module
237 # loading is changed. Otherwise cached bytecode may get loaded without
239 # loading is changed. Otherwise cached bytecode may get loaded without
238 # the new transformation mechanisms applied.
240 # the new transformation mechanisms applied.
239 BYTECODEHEADER = b'HG\x00\x0b'
241 BYTECODEHEADER = b'HG\x00\x0c'
240
242
241 class hgloader(importlib.machinery.SourceFileLoader):
243 class hgloader(importlib.machinery.SourceFileLoader):
242 """Custom module loader that transforms source code.
244 """Custom module loader that transforms source code.
@@ -218,6 +218,8 b' class branchcache(object):'
218 self._verifybranch(k)
218 self._verifybranch(k)
219 yield k, v
219 yield k, v
220
220
221 items = iteritems
222
221 def hasbranch(self, label):
223 def hasbranch(self, label):
222 """ checks whether a branch of this name exists or not """
224 """ checks whether a branch of this name exists or not """
223 self._verifybranch(label)
225 self._verifybranch(label)
General Comments 0
You need to be logged in to leave comments. Login now