Preface
script_location may contain one or more connected dependency graphs but let us focus on just one of them for simplicity's sake.
- arguable situations:
From an admin point of view, (a) looks like just being ignored because iterating through all revisions (e.g., alembic branches) does not start in the first place. This is because "heads" must be empty after _revision_map discards all reachable revisions.
On the other hand, (b) raises revision.RangeNotAncestorError when an admin tries to do the same traversal because in this case "bases" must have been empty while "heads" is kept undiscarded.
Question
IMHO, such different behaviours for (a) and (b) are confusing. It would be better if
- exceptions are raised for all those cases
- error message for (a)-1 and (b)-1 should be like: "Revision %s is a self-loop. Set down_revision to a correct value or None"
- error message for (a)-2 and (b)-2 should be like: "Revision dependency graph is cyclic."
Any thoughts?
Preface
script_locationmay contain one or more connected dependency graphs but let us focus on just one of them for simplicity's sake.when it's a strongly-connected graph, (see Cases where a revision dependency graph contains a loop or cycle. #757 (comment))revisionanddown_revisionto the same value, which is notNone. Also let this contain the case where there is just one revision with a self-loop.when it's a unilaterally-connected graph, (see Cases where a revision dependency graph contains a loop or cycle. #757 (comment))From an admin point of view, (a) looks like just being ignored because iterating through all revisions (e.g.,
alembic branches) does not start in the first place. This is because "heads" must be empty after_revision_mapdiscards all reachable revisions.On the other hand, (b) raises
revision.RangeNotAncestorErrorwhen an admin tries to do the same traversal because in this case "bases" must have been empty while "heads" is kept undiscarded.Question
IMHO, such different behaviours for (a) and (b) are confusing. It would be better if
Any thoughts?