Mercurial > public > mercurial-scm > hg
comparison mercurial/dagutil.py @ 14206:2bf60f158ecb
setdiscovery: limit lines to 80 characters
author | Steven Brown <StevenGBrown@gmail.com> |
---|---|
date | Thu, 05 May 2011 23:21:37 +0800 |
parents | cb98fed52495 |
children | a3b9f1bddab1 |
comparison
equal
deleted
inserted
replaced
14204:5fa21960b2f4 | 14206:2bf60f158ecb |
---|---|
38 def inverse(self): | 38 def inverse(self): |
39 '''inverse DAG, where parents becomes children, etc.''' | 39 '''inverse DAG, where parents becomes children, etc.''' |
40 raise NotImplementedError() | 40 raise NotImplementedError() |
41 | 41 |
42 def ancestorset(self, starts, stops=None): | 42 def ancestorset(self, starts, stops=None): |
43 '''set of all ancestors of starts (incl), but stop walk at stops (excl)''' | 43 ''' |
44 set of all ancestors of starts (incl), but stop walk at stops (excl) | |
45 ''' | |
44 raise NotImplementedError() | 46 raise NotImplementedError() |
45 | 47 |
46 def descendantset(self, starts, stops=None): | 48 def descendantset(self, starts, stops=None): |
47 '''set of all descendants of starts (incl), but stop walk at stops (excl)''' | 49 ''' |
50 set of all descendants of starts (incl), but stop walk at stops (excl) | |
51 ''' | |
48 return self.inverse().ancestorset(starts, stops) | 52 return self.inverse().ancestorset(starts, stops) |
49 | 53 |
50 def headsetofconnecteds(self, ixs): | 54 def headsetofconnecteds(self, ixs): |
51 '''subset of connected list of ixs so that no node has a descendant in it | 55 ''' |
56 subset of connected list of ixs so that no node has a descendant in it | |
52 | 57 |
53 By "connected list" we mean that if an ancestor and a descendant are in | 58 By "connected list" we mean that if an ancestor and a descendant are in |
54 the list, then so is at least one path connecting them.''' | 59 the list, then so is at least one path connecting them. |
60 ''' | |
55 raise NotImplementedError() | 61 raise NotImplementedError() |
56 | 62 |
57 def externalize(self, ix): | 63 def externalize(self, ix): |
58 '''return a list of (or set if given a set) of node ids''' | 64 '''return a list of (or set if given a set) of node ids''' |
59 return self._externalize(ix) | 65 return self._externalize(ix) |