summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alembic/revision.py4
-rw-r--r--tests/test_revision.py9
-rw-r--r--tests/test_version_traversal.py5
3 files changed, 15 insertions, 3 deletions
diff --git a/alembic/revision.py b/alembic/revision.py
index a1149ea..4eea514 100644
--- a/alembic/revision.py
+++ b/alembic/revision.py
@@ -353,9 +353,7 @@ class RevisionMap(object):
if branch_label:
shares.append(branch_label)
if id_:
- shares.append(id_[0])
-
- #shares = branch_label or (id_[0] if id_ else None)
+ shares.extend(id_)
return [
tg for tg in targets
diff --git a/tests/test_revision.py b/tests/test_revision.py
index cc91322..d73316d 100644
--- a/tests/test_revision.py
+++ b/tests/test_revision.py
@@ -181,6 +181,15 @@ class LabeledBranchTest(DownIterateTest):
[c1, c2, d]
)
+ def test_filter_for_lineage_heads(self):
+ eq_(
+ self.map.filter_for_lineage(
+ [self.map.get_revision("f")],
+ "heads"
+ ),
+ [self.map.get_revision("f")]
+ )
+
def setUp(self):
self.map = RevisionMap(lambda: [
Revision('a', (), branch_labels='abranch'),
diff --git a/tests/test_version_traversal.py b/tests/test_version_traversal.py
index 4d9926d..410995e 100644
--- a/tests/test_version_traversal.py
+++ b/tests/test_version_traversal.py
@@ -576,6 +576,11 @@ class ForestTest(MigrationTest):
set([(self.b1.revision,), (self.b2.revision,)])
)
+ def test_stamp_to_heads_no_moves_needed(self):
+ revs = self.env._stamp_revs(
+ "heads", (self.b1.revision, self.b2.revision))
+ eq_(len(revs), 0)
+
class MergedPathTest(MigrationTest):