def iterator self An iterator over the changes from repo if self _rang

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def iterator(self):
"""
An iterator over the changes from repo.
"""
if self._range:
rev = ['%s:%s' % (-1 - self._range.start, 0 - self._range.stop)]
else:
rev = []
print rev
def getrenamed(ctx):
for f in ctx.files():
if not f in ctx.manifest():
continue
cp = ctx.filectx(f).renamed()
if cp:
# to, from
yield (f, cp[0])
opts = {'follow': True, 'rev': rev}
get = util.cachefunc(lambda r: self.repo.changectx(r).changeset())
changeiter, matchfn = cmdutil.walkchangerevs(hgui, self.repo, self.pats, get, opts)
for st, rev, fns in changeiter:
if st == 'iter':
ctx = self.repo.changectx(rev)
ctx = humanize_ctx(ctx, changestat(ctx), list(getrenamed(ctx)))
yield ctx