##// END OF EJS Templates
use xrange instead of range
Benoit Boissinot -
r3473:0e68608b default
parent child Browse files
Show More
@@ -177,7 +177,7 b' def revtree(args, repo, full="tree", max'
177 177 if len(ar) == 0:
178 178 return 1
179 179 mask = 0
180 for i in range(len(ar)):
180 for i in xrange(len(ar)):
181 181 if sha in reachable[i]:
182 182 mask |= 1 << i
183 183
@@ -190,7 +190,7 b' def revtree(args, repo, full="tree", max'
190 190
191 191 # figure out which commits they are asking for and which ones they
192 192 # want us to stop on
193 for i in range(len(args)):
193 for i in xrange(len(args)):
194 194 if args[i].startswith('^'):
195 195 s = repo.lookup(args[i][1:])
196 196 stop_sha1.append(s)
@@ -199,7 +199,7 b' def revtree(args, repo, full="tree", max'
199 199 want_sha1.append(repo.lookup(args[i]))
200 200
201 201 # calculate the graph for the supplied commits
202 for i in range(len(want_sha1)):
202 for i in xrange(len(want_sha1)):
203 203 reachable.append({});
204 204 n = want_sha1[i];
205 205 visit = [n];
@@ -593,7 +593,7 b' class queue:'
593 593 if stop in chlog.nodemap:
594 594 stoprev = chlog.rev(stop)
595 595
596 for r in range(chlog.count() - 1, -1, -1):
596 for r in xrange(chlog.count() - 1, -1, -1):
597 597 n = chlog.node(r)
598 598 if n not in p:
599 599 h.append(n)
@@ -955,7 +955,7 b' class queue:'
955 955 if comments:
956 956 # Remove existing message.
957 957 ci = 0
958 for mi in range(len(message)):
958 for mi in xrange(len(message)):
959 959 while message[mi] != comments[ci]:
960 960 ci += 1
961 961 del comments[ci]
@@ -1036,7 +1036,7 b' class queue:'
1036 1036 # if the patch excludes a modified file, mark that file with mtime=0
1037 1037 # so status can see it.
1038 1038 mm = []
1039 for i in range(len(m)-1, -1, -1):
1039 for i in xrange(len(m)-1, -1, -1):
1040 1040 if not matchfn(m[i]):
1041 1041 mm.append(m[i])
1042 1042 del m[i]
@@ -1104,7 +1104,7 b' class queue:'
1104 1104 if not length:
1105 1105 length = len(self.series) - start
1106 1106 if not missing:
1107 for i in range(start, start+length):
1107 for i in xrange(start, start+length):
1108 1108 pfx = ''
1109 1109 patch = pname(i)
1110 1110 if self.ui.verbose:
@@ -195,7 +195,7 b' def patchbomb(ui, repo, *revs, **opts):'
195 195
196 196 ui.write(_('This patch series consists of %d patches.\n\n') % len(patches))
197 197
198 for p, i in zip(patches, range(len(patches))):
198 for p, i in zip(patches, xrange(len(patches))):
199 199 jumbo.extend(p)
200 200 msgs.append(makepatch(p, i + 1, len(patches)))
201 201
@@ -191,7 +191,7 b' class hgweb(object):'
191 191 parity = (start - end) & 1
192 192 cl = self.repo.changelog
193 193 l = [] # build a list in forward order for efficiency
194 for i in range(start, end):
194 for i in xrange(start, end):
195 195 ctx = self.repo.changectx(i)
196 196 n = ctx.node()
197 197
@@ -234,9 +234,9 b' class hgweb(object):'
234 234 qw = query.lower().split()
235 235
236 236 def revgen():
237 for i in range(cl.count() - 1, 0, -100):
237 for i in xrange(cl.count() - 1, 0, -100):
238 238 l = []
239 for j in range(max(0, i - 100), i):
239 for j in xrange(max(0, i - 100), i):
240 240 ctx = self.repo.changectx(j)
241 241 l.append(ctx)
242 242 l.reverse()
@@ -322,7 +322,7 b' class hgweb(object):'
322 322 l = []
323 323 parity = (count - 1) & 1
324 324
325 for i in range(start, end):
325 for i in xrange(start, end):
326 326 ctx = fctx.filectx(i)
327 327 n = fl.node(i)
328 328
@@ -531,7 +531,7 b' class hgweb(object):'
531 531 parity = 0
532 532 cl = self.repo.changelog
533 533 l = [] # build a list in forward order for efficiency
534 for i in range(start, end):
534 for i in xrange(start, end):
535 535 n = cl.node(i)
536 536 changes = cl.read(n)
537 537 hn = hex(n)
@@ -1132,7 +1132,7 b' class localrepository(repo.repository):'
1132 1132 reqcnt += 1
1133 1133 self.ui.debug(_("request %d: %s\n") %
1134 1134 (reqcnt, " ".join(map(short, r))))
1135 for p in range(0, len(r), 10):
1135 for p in xrange(0, len(r), 10):
1136 1136 for b in remote.branches(r[p:p+10]):
1137 1137 self.ui.debug(_("received %s:%s\n") %
1138 1138 (short(b[0]), short(b[1])))
@@ -1750,7 +1750,7 b' class localrepository(repo.repository):'
1750 1750 self.hook("changegroup", node=hex(self.changelog.node(cor+1)),
1751 1751 source=srctype, url=url)
1752 1752
1753 for i in range(cor + 1, cnr + 1):
1753 for i in xrange(cor + 1, cnr + 1):
1754 1754 self.hook("incoming", node=hex(self.changelog.node(i)),
1755 1755 source=srctype, url=url)
1756 1756
@@ -220,7 +220,7 b' def dogitpatch(patchname, gitpatches, cw'
220 220 tmpfp = os.fdopen(fd, 'w')
221 221
222 222 try:
223 for i in range(len(gitpatches)):
223 for i in xrange(len(gitpatches)):
224 224 p = gitpatches[i]
225 225 if not p.copymod and not p.binary:
226 226 continue
@@ -48,7 +48,7 b' def verify(repo):'
48 48 repo.ui.status(_("checking changesets\n"))
49 49 checksize(repo.changelog, "changelog")
50 50
51 for i in range(repo.changelog.count()):
51 for i in xrange(repo.changelog.count()):
52 52 changesets += 1
53 53 n = repo.changelog.node(i)
54 54 l = repo.changelog.linkrev(n)
@@ -81,7 +81,7 b' def verify(repo):'
81 81 checkversion(repo.manifest, "manifest")
82 82 checksize(repo.manifest, "manifest")
83 83
84 for i in range(repo.manifest.count()):
84 for i in xrange(repo.manifest.count()):
85 85 n = repo.manifest.node(i)
86 86 l = repo.manifest.linkrev(n)
87 87
@@ -142,7 +142,7 b' def verify(repo):'
142 142
143 143 nodes = {nullid: 1}
144 144 seen = {}
145 for i in range(fl.count()):
145 for i in xrange(fl.count()):
146 146 revisions += 1
147 147 n = fl.node(i)
148 148
General Comments 0
You need to be logged in to leave comments. Login now