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