Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hg.py @ 822:b678e6d4f92d
Attempt to yield names in sorted order when walking.
This is an improvement in behaviour, but the walk and changes code still
has some flaws that make sorted name presentation difficult:
- changes returns tuples of names, instead of a sorted list of (name,
status) pairs.
- walk yields deleted names after all others.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sun, 31 Jul 2005 18:03:46 -0800 |
parents | 72d9bd4841f3 |
children | 0932bc2fb2be |
comparison
equal
deleted
inserted
replaced
821:72d9bd4841f3 | 822:b678e6d4f92d |
---|---|
456 continue | 456 continue |
457 for sd in subdirs: | 457 for sd in subdirs: |
458 ds = os.path.join(nd, sd +'/') | 458 ds = os.path.join(nd, sd +'/') |
459 if self.ignore(ds) or not match(ds): | 459 if self.ignore(ds) or not match(ds): |
460 subdirs.remove(sd) | 460 subdirs.remove(sd) |
461 subdirs.sort() | |
462 fl.sort() | |
461 for fn in fl: | 463 for fn in fl: |
462 fn = util.pconvert(os.path.join(d, fn)) | 464 fn = util.pconvert(os.path.join(d, fn)) |
463 yield 'f', fn | 465 yield 'f', fn |
464 else: | 466 else: |
465 yield 'f', f[len(self.root) + 1:] | 467 yield 'f', f[len(self.root) + 1:] |
466 | 468 |
467 for k in dc.keys(): | 469 ks = dc.keys() |
470 ks.sort() | |
471 for k in ks: | |
468 yield 'm', k | 472 yield 'm', k |
469 | 473 |
470 # yield only files that match: all in dirstate, others only if | 474 # yield only files that match: all in dirstate, others only if |
471 # not in .hgignore | 475 # not in .hgignore |
472 | 476 |