Cannot Require Reworked Change #103

theory opened this Issue Jul 12, 2013 · 1 comment

1 participant


If a change is reworked, and a change after that (perhaps in another project?) requires it, Sqitch will hurl an error:

Key "foo" matches multiple changes

This is because change_id_for() chokes if it finds more than one. Of course, there will be more than one instance of a reworked change.

The fix is to change change_id_for() (and any other methods that do this) to allow duplicate change names if they are reworked. It may be sufficient simply to require that they be in the same project, though some more specific way of identifying a change as reworked would be preferable.

@theory theory was assigned Jul 12, 2013
@theory theory added a commit that closed this issue Jul 17, 2013
@theory Allow change_id_for() to find multiple IDs.
Reworked changes will have the same name, of course, so that name can occur
multiple times in the `changes` table. So just get the ID of the last instance
committed. Resolves #103.
@theory theory closed this in 12527f7 Jul 17, 2013
@theory theory added a commit that referenced this issue Jul 17, 2013
@theory Find the earliest change, rather than the latest.
This is to make it consistent with `$plan->find()`. It also makes sense
because, if one declares a dependency on a named change with no tag
specification, it should mean *any* instance of that change. That *does* make
it a bit harder to declare the latest instane of a change if there has been no
tag in the interrim, but one can use `@HEAD` for that. (Issue #103).

Wrote a blog post about this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment