)
if not total_space:
- raise RangeNotAncestorError(lower, upper)
+ # no nodes. determine if this is an invalid range
+ # or not.
+ start_from = set(requested_lowers)
+ start_from.update(
+ self._get_ancestor_nodes(
+ list(start_from), include_dependencies=True)
+ )
+
+ # determine all the current branch points represented
+ # by requested_lowers
+ start_from = self._filter_into_branch_heads(start_from)
+
+ # if the requested start is one of those branch points,
+ # then just return empty set
+ if start_from.intersection(upper_ancestors):
+ raise StopIteration()
+ else:
+ # otherwise, they requested nodes out of
+ # order
+ raise RangeNotAncestorError(lower, upper)
# organize branch points to be consumed separately from
# member nodes
.. changelog::
:version: 0.8.7
+ .. change::
+ :tags: bug, versioning
+ :tickets: 336
+
+ Fixed bug where upgrading to the head of a branch which is already
+ present would fail, only if that head were also the dependency
+ of a different branch that is also upgraded, as the revision system
+ would see this as trying to go in the wrong direction. The check
+ here has been refined to distinguish between same-branch revisions
+ out of order vs. movement along sibling branches.
+
.. change::
:tags: bug, versioning
:tickets: 379
select_for_downgrade=True
)
+ def test_same_branch_wrong_direction(self):
+ assert_raises_message(
+ RevisionError,
+ r"Revision d2 is not an ancestor of revision b2",
+ list,
+ self.map._iterate_revisions('b2', 'd2')
+ )
+
+ def test_different_branch_not_wrong_direction(self):
+ self._assert_iteration(
+ "b3", "d2",
+ []
+ )
+
def test_we_need_head2_upgrade(self):
# the 2 branch relies on the 3 branch
self._assert_iteration(