##// END OF EJS Templates
stabletailgraph: extract _parents util func
pacien -
r51420:dc372251 default
parent child Browse files
Show More
@@ -74,6 +74,14 b' def _nonoedipal_parent_revs(cl, rev):'
74 return p1, p2
74 return p1, p2
75
75
76
76
77 def _parents(cl, rev):
78 p1, p2 = _nonoedipal_parent_revs(cl, rev)
79 if p2 == nullrev:
80 return p1, p2
81
82 return _sorted_parents(cl, p1, p2)
83
84
77 def _stable_tail_sort_naive(cl, head_rev):
85 def _stable_tail_sort_naive(cl, head_rev):
78 """
86 """
79 Naive topological iterator of the ancestors given by the stable-tail sort.
87 Naive topological iterator of the ancestors given by the stable-tail sort.
@@ -91,14 +99,10 b' def _stable_tail_sort_naive(cl, head_rev'
91 while cursor_rev != nullrev:
99 while cursor_rev != nullrev:
92 yield cursor_rev
100 yield cursor_rev
93
101
94 p1, p2 = _nonoedipal_parent_revs(cl, cursor_rev)
102 px, pt = _parents(cl, cursor_rev)
95 if p1 == nullrev:
103 if pt == nullrev:
96 cursor_rev = p2
104 cursor_rev = px
97 elif p2 == nullrev:
98 cursor_rev = p1
99 else:
105 else:
100 px, pt = _sorted_parents(cl, p1, p2)
101
102 tail_ancestors = ancestor.lazyancestors(
106 tail_ancestors = ancestor.lazyancestors(
103 cl.parentrevs, (pt,), inclusive=True
107 cl.parentrevs, (pt,), inclusive=True
104 )
108 )
General Comments 0
You need to be logged in to leave comments. Login now