Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • anlambert/swh-model
  • lunar/swh-model
  • franckbret/swh-model
  • douardda/swh-model
  • olasd/swh-model
  • swh/devel/swh-model
  • Alphare/swh-model
  • samplet/swh-model
  • marmoute/swh-model
  • rboyer/swh-model
10 results
Show changes
...@@ -25,8 +25,8 @@ def toposort(revision_log): ...@@ -25,8 +25,8 @@ def toposort(revision_log):
# Add the roots to the processing queue. # Add the roots to the processing queue.
queue = collections.deque() queue = collections.deque()
for rev in revision_log: for rev in revision_log:
parents = rev['parents'] parents = rev["parents"]
in_degree[rev['id']] = len(parents) in_degree[rev["id"]] = len(parents)
if not parents: if not parents:
queue.append(rev) queue.append(rev)
for parent in parents: for parent in parents:
...@@ -37,7 +37,7 @@ def toposort(revision_log): ...@@ -37,7 +37,7 @@ def toposort(revision_log):
while queue: while queue:
rev = queue.popleft() rev = queue.popleft()
yield rev yield rev
for child in children[rev['id']]: for child in children[rev["id"]]:
in_degree[child['id']] -= 1 in_degree[child["id"]] -= 1
if in_degree[child['id']] == 0: if in_degree[child["id"]] == 0:
queue.append(child) queue.append(child)
This diff is collapsed.
This diff is collapsed.