mercurial/commands.py
changeset 1749 d457fec76ab0
parent 1747 91c56c427171
child 1754 fdfe89a3962d
equal deleted inserted replaced
1748:2428e6d66f06 1749:d457fec76ab0
   113                 revs.reverse()
   113                 revs.reverse()
   114                 for rev in revs:
   114                 for rev in revs:
   115                     yield rev
   115                     yield rev
   116 
   116 
   117         minrev, maxrev = min(revs), max(revs)
   117         minrev, maxrev = min(revs), max(revs)
   118         for file in files:
   118         for file_ in files:
   119             filelog = repo.file(file)
   119             filelog = repo.file(file_)
   120             # A zero count may be a directory or deleted file, so
   120             # A zero count may be a directory or deleted file, so
   121             # try to find matching entries on the slow path.
   121             # try to find matching entries on the slow path.
   122             if filelog.count() == 0:
   122             if filelog.count() == 0:
   123                 slowpath = True
   123                 slowpath = True
   124                 break
   124                 break
   125             for rev in filerevgen(filelog):
   125             for rev in filerevgen(filelog):
   126                 if rev <= maxrev:
   126                 if rev <= maxrev:
   127                     if rev < minrev:
   127                     if rev < minrev:
   128                         break
   128                         break
   129                     fncache.setdefault(rev, [])
   129                     fncache.setdefault(rev, [])
   130                     fncache[rev].append(file)
   130                     fncache[rev].append(file_)
   131                     wanted[rev] = 1
   131                     wanted[rev] = 1
   132     if slowpath:
   132     if slowpath:
   133         # The slow path checks files modified in every changeset.
   133         # The slow path checks files modified in every changeset.
   134         def changerevgen():
   134         def changerevgen():
   135             for i in xrange(repo.changelog.count() - 1, -1, -window):
   135             for i in xrange(repo.changelog.count() - 1, -1, -window):
   445             if cmd == "shortlist" and not f.startswith("^"):
   445             if cmd == "shortlist" and not f.startswith("^"):
   446                 continue
   446                 continue
   447             f = f.lstrip("^")
   447             f = f.lstrip("^")
   448             if not ui.debugflag and f.startswith("debug"):
   448             if not ui.debugflag and f.startswith("debug"):
   449                 continue
   449                 continue
   450             d = ""
       
   451             doc = e[0].__doc__
   450             doc = e[0].__doc__
   452             if not doc:
   451             if not doc:
   453                 doc = _("(No help text available)")
   452                 doc = _("(No help text available)")
   454             h[f] = doc.splitlines(0)[0].rstrip()
   453             h[f] = doc.splitlines(0)[0].rstrip()
   455             cmds[f] = c.lstrip("^")
   454             cmds[f] = c.lstrip("^")
  1288         m = matches[rev][fn]
  1287         m = matches[rev][fn]
  1289         for lnum, cstart, cend, line in matchlines(body):
  1288         for lnum, cstart, cend, line in matchlines(body):
  1290             s = linestate(line, lnum, cstart, cend)
  1289             s = linestate(line, lnum, cstart, cend)
  1291             m[s] = s
  1290             m[s] = s
  1292 
  1291 
       
  1292     # FIXME: prev isn't used, why ?
  1293     prev = {}
  1293     prev = {}
  1294     ucache = {}
  1294     ucache = {}
  1295     def display(fn, rev, states, prevstates):
  1295     def display(fn, rev, states, prevstates):
  1296         diff = list(sets.Set(states).symmetric_difference(sets.Set(prevstates)))
  1296         diff = list(sets.Set(states).symmetric_difference(sets.Set(prevstates)))
  1297         diff.sort(lambda x, y: cmp(x.linenum, y.linenum))
  1297         diff.sort(lambda x, y: cmp(x.linenum, y.linenum))