##// END OF EJS Templates
groubranchhiter: indent most of the inner code...
Pierre-Yves David -
r23566:fee7a30c default
parent child Browse files
Show More
@@ -110,29 +110,31 def groupbranchiter(revs, parentsfunc):
110 110 # parts of the initial set should be emitted.
111 111 groups = [([], unblocked)]
112 112 for current in revs:
113 # Look for a subgroup blocked, waiting for the current revision.
113 if True:
114 # Seek for a subgroup blocked, waiting for the current revision.
114 115 matching = [i for i, g in enumerate(groups) if current in g[1]]
115 116
116 117 if matching:
117 # The main idea is to gather together all sets that await on the
118 # same revision.
118 # The main idea is to gather together all sets that await on
119 # the same revision.
119 120 #
120 # This merging is done at the time we are about to add this common
121 # awaited to the subgroup for simplicity purpose. Such merge could
122 # happen sooner when we update the "blocked" set of revision.
121 # This merging is done at the time we are about to add this
122 # common awaited to the subgroup for simplicity purpose. Such
123 # merge could happen sooner when we update the "blocked" set of
124 # revision.
123 125 #
124 # We also always keep the oldest subgroup first. We can probably
125 # improve the behavior by having the longuest set first. That way,
126 # graph algorythms could minimise the length of parallele lines
127 # their draw. This is currently not done.
126 # We also always keep the oldest subgroup first. We can
127 # probably improve the behavior by having the longuest set
128 # first. That way, graph algorythms could minimise the length
129 # of parallele lines their draw. This is currently not done.
128 130 targetidx = matching.pop(0)
129 131 trevs, tparents = groups[targetidx]
130 132 for i in matching:
131 133 gr = groups[i]
132 134 trevs.extend(gr[0])
133 135 tparents |= gr[1]
134 # delete all merged subgroups (but the one we keep)
135 # (starting from the last subgroup for performance and sanity reason)
136 # delete all merged subgroups (but the one we keep) (starting
137 # from the last subgroup for performance and sanity reason)
136 138 for i in reversed(matching):
137 139 del groups[i]
138 140 else:
@@ -142,9 +144,9 def groupbranchiter(revs, parentsfunc):
142 144
143 145 gr = groups[targetidx]
144 146
145 # We now adds the current nodes to this subgroups. This is done after
146 # the subgroup merging because all elements from a subgroup that relied
147 # on this rev must preceed it.
147 # We now adds the current nodes to this subgroups. This is done
148 # after the subgroup merging because all elements from a subgroup
149 # that relied on this rev must preceed it.
148 150 #
149 151 # we also update the <parents> set to includes the parents on the
150 152 # new nodes.
@@ -155,14 +157,14 def groupbranchiter(revs, parentsfunc):
155 157 # Look for a subgroup to display
156 158 #
157 159 # When unblocked is empty (if clause), We are not waiting over any
158 # revision during the first iteration (if no priority was given) or if
159 # we outputed a whole disconnected sets of the graph (reached a root).
160 # In that case we arbitrarily takes the oldest known subgroup. The
161 # heuristique could probably be better.
160 # revision during the first iteration (if no priority was given) or
161 # if we outputed a whole disconnected sets of the graph (reached a
162 # root). In that case we arbitrarily takes the oldest known
163 # subgroup. The heuristique could probably be better.
162 164 #
163 # Otherwise (elif clause) this mean we have some emitted revision. if
164 # the subgroup awaits on the same revision that the outputed ones, we
165 # can safely output it.
165 # Otherwise (elif clause) this mean we have some emitted revision.
166 # if the subgroup awaits on the same revision that the outputed
167 # ones, we can safely output it.
166 168 if not unblocked:
167 169 if len(groups) > 1: # display other subset
168 170 targetidx = 1
General Comments 0
You need to be logged in to leave comments. Login now