Skip to content

Cases where a revision dependency graph contains a loop or cycle. #757

@lkpdn

Description

@lkpdn

Preface

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions