comparison mercurial/subrepo.py @ 40342:6f152067ba57

subrepo: access status members by name instead of by position Taking my first Mercurial project closer to completion. Differential Revision: https://phab.mercurial-scm.org/D5144
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 17 Oct 2018 11:43:39 -0700
parents c31ce080eb75
children 69d4c8c5c25e
comparison
equal deleted inserted replaced
40341:d916ed3ca951 40342:6f152067ba57
1581 @annotatesubrepoerror 1581 @annotatesubrepoerror
1582 def add(self, ui, match, prefix, explicitonly, **opts): 1582 def add(self, ui, match, prefix, explicitonly, **opts):
1583 if self._gitmissing(): 1583 if self._gitmissing():
1584 return [] 1584 return []
1585 1585
1586 (modified, added, removed, 1586 s = self.status(None, unknown=True, clean=True)
1587 deleted, unknown, ignored, clean) = self.status(None, unknown=True,
1588 clean=True)
1589 1587
1590 tracked = set() 1588 tracked = set()
1591 # dirstates 'amn' warn, 'r' is added again 1589 # dirstates 'amn' warn, 'r' is added again
1592 for l in (modified, added, deleted, clean): 1590 for l in (s.modified, s.added, s.deleted, s.clean):
1593 tracked.update(l) 1591 tracked.update(l)
1594 1592
1595 # Unknown files not of interest will be rejected by the matcher 1593 # Unknown files not of interest will be rejected by the matcher
1596 files = unknown 1594 files = s.unknown
1597 files.extend(match.files()) 1595 files.extend(match.files())
1598 1596
1599 rejected = [] 1597 rejected = []
1600 1598
1601 files = [f for f in sorted(set(files)) if match(f)] 1599 files = [f for f in sorted(set(files)) if match(f)]