Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 2022:a59da8cc35e4
New option -i/--ignored for 'hg status' to show ignored files.
localrepo.changes() now returns an additional list of ignored files if
it is called with show_ignored=True.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 29 Mar 2006 22:58:34 +0200 |
parents | fc22ed56afe3 |
children | d436b21b20dc |
comparison
equal
deleted
inserted
replaced
2021:fc22ed56afe3 | 2022:a59da8cc35e4 |
---|---|
496 else: | 496 else: |
497 for src, fn in self.dirstate.walk(files, match): | 497 for src, fn in self.dirstate.walk(files, match): |
498 yield src, fn | 498 yield src, fn |
499 | 499 |
500 def changes(self, node1=None, node2=None, files=[], match=util.always, | 500 def changes(self, node1=None, node2=None, files=[], match=util.always, |
501 wlock=None): | 501 wlock=None, show_ignored=None): |
502 """return changes between two nodes or node and working directory | 502 """return changes between two nodes or node and working directory |
503 | 503 |
504 If node1 is None, use the first dirstate parent instead. | 504 If node1 is None, use the first dirstate parent instead. |
505 If node2 is None, compare node1 with working directory. | 505 If node2 is None, compare node1 with working directory. |
506 """ | 506 """ |
529 if not wlock: | 529 if not wlock: |
530 try: | 530 try: |
531 wlock = self.wlock(wait=0) | 531 wlock = self.wlock(wait=0) |
532 except lock.LockException: | 532 except lock.LockException: |
533 wlock = None | 533 wlock = None |
534 lookup, modified, added, removed, deleted, unknown = ( | 534 lookup, modified, added, removed, deleted, unknown, ignored = ( |
535 self.dirstate.changes(files, match)) | 535 self.dirstate.changes(files, match, show_ignored)) |
536 | 536 |
537 # are we comparing working dir against its parent? | 537 # are we comparing working dir against its parent? |
538 if not node1: | 538 if not node1: |
539 if lookup: | 539 if lookup: |
540 # do a full compare of any files that might have changed | 540 # do a full compare of any files that might have changed |
553 for f in removed: | 553 for f in removed: |
554 if f in mf2: | 554 if f in mf2: |
555 del mf2[f] | 555 del mf2[f] |
556 else: | 556 else: |
557 # we are comparing two revisions | 557 # we are comparing two revisions |
558 deleted, unknown = [], [] | 558 deleted, unknown, ignored = [], [], [] |
559 mf2 = mfmatches(node2) | 559 mf2 = mfmatches(node2) |
560 | 560 |
561 if node1: | 561 if node1: |
562 # flush lists from dirstate before comparing manifests | 562 # flush lists from dirstate before comparing manifests |
563 modified, added = [], [] | 563 modified, added = [], [] |
571 added.append(fn) | 571 added.append(fn) |
572 | 572 |
573 removed = mf1.keys() | 573 removed = mf1.keys() |
574 | 574 |
575 # sort and return results: | 575 # sort and return results: |
576 for l in modified, added, removed, deleted, unknown: | 576 for l in modified, added, removed, deleted, unknown, ignored: |
577 l.sort() | 577 l.sort() |
578 return (modified, added, removed, deleted, unknown) | 578 if show_ignored is None: |
579 return (modified, added, removed, deleted, unknown) | |
580 else: | |
581 return (modified, added, removed, deleted, unknown, ignored) | |
579 | 582 |
580 def add(self, list, wlock=None): | 583 def add(self, list, wlock=None): |
581 if not wlock: | 584 if not wlock: |
582 wlock = self.wlock() | 585 wlock = self.wlock() |
583 for f in list: | 586 for f in list: |