Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 6829:fec1da46006e
dirstate.walk: build a dict rather than yield
Since we're already building a seen dict, we might as well put our
results in it to go slightly faster.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 22 Jul 2008 13:03:21 -0500 |
parents | c978d6752dbb |
children | 835a01a0cdb3 |
comparison
equal
deleted
inserted
replaced
6828:55d65a33da52 | 6829:fec1da46006e |
---|---|
596 def ancestor(self, c2): | 596 def ancestor(self, c2): |
597 """return the ancestor context of self and c2""" | 597 """return the ancestor context of self and c2""" |
598 return self._parents[0].ancestor(c2) # punt on two parents for now | 598 return self._parents[0].ancestor(c2) # punt on two parents for now |
599 | 599 |
600 def walk(self, match): | 600 def walk(self, match): |
601 for fn, st in util.sort(self._repo.dirstate.walk(match, True, False)): | 601 return util.sort(self._repo.dirstate.walk(match, True, False).keys()) |
602 yield fn | |
603 | 602 |
604 class workingfilectx(filectx): | 603 class workingfilectx(filectx): |
605 """A workingfilectx object makes access to data related to a particular | 604 """A workingfilectx object makes access to data related to a particular |
606 file in the working directory convenient.""" | 605 file in the working directory convenient.""" |
607 def __init__(self, repo, path, filelog=None, workingctx=None): | 606 def __init__(self, repo, path, filelog=None, workingctx=None): |