Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
a8dfdc52
Commit
a8dfdc52
authored
8 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Plain Diff
Merge pull request #925 from abbradar/master
Show both cycle ends
parents
75361b6d
c87a56f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libstore/misc.cc
+5
-5
5 additions, 5 deletions
src/libstore/misc.cc
with
5 additions
and
5 deletions
src/libstore/misc.cc
+
5
−
5
View file @
a8dfdc52
...
@@ -169,11 +169,11 @@ Paths Store::topoSortPaths(const PathSet & paths)
...
@@ -169,11 +169,11 @@ Paths Store::topoSortPaths(const PathSet & paths)
Paths
sorted
;
Paths
sorted
;
PathSet
visited
,
parents
;
PathSet
visited
,
parents
;
std
::
function
<
void
(
const
Path
&
path
)
>
dfsVisit
;
std
::
function
<
void
(
const
Path
&
path
,
const
Path
*
parent
)
>
dfsVisit
;
dfsVisit
=
[
&
](
const
Path
&
path
)
{
dfsVisit
=
[
&
](
const
Path
&
path
,
const
Path
*
parent
)
{
if
(
parents
.
find
(
path
)
!=
parents
.
end
())
if
(
parents
.
find
(
path
)
!=
parents
.
end
())
throw
BuildError
(
format
(
"cycle detected in the references of
‘
%1%
’"
)
%
path
);
throw
BuildError
(
format
(
"cycle detected in the references of
'
%1%
' from '%2%'"
)
%
path
%
*
parent
);
if
(
visited
.
find
(
path
)
!=
visited
.
end
())
return
;
if
(
visited
.
find
(
path
)
!=
visited
.
end
())
return
;
visited
.
insert
(
path
);
visited
.
insert
(
path
);
...
@@ -189,14 +189,14 @@ Paths Store::topoSortPaths(const PathSet & paths)
...
@@ -189,14 +189,14 @@ Paths Store::topoSortPaths(const PathSet & paths)
/* Don't traverse into paths that don't exist. That can
/* Don't traverse into paths that don't exist. That can
happen due to substitutes for non-existent paths. */
happen due to substitutes for non-existent paths. */
if
(
i
!=
path
&&
paths
.
find
(
i
)
!=
paths
.
end
())
if
(
i
!=
path
&&
paths
.
find
(
i
)
!=
paths
.
end
())
dfsVisit
(
i
);
dfsVisit
(
i
,
&
path
);
sorted
.
push_front
(
path
);
sorted
.
push_front
(
path
);
parents
.
erase
(
path
);
parents
.
erase
(
path
);
};
};
for
(
auto
&
i
:
paths
)
for
(
auto
&
i
:
paths
)
dfsVisit
(
i
);
dfsVisit
(
i
,
nullptr
);
return
sorted
;
return
sorted
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment