diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-08 19:27:42 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-08 19:28:59 -0500 |
commit | e8a0c740b17100e6e366a7484d58d5b26f68c094 (patch) | |
tree | ddcec52b8ea04eeb7c083977dc24a81fd640155e | |
parent | 0955d44f4b93ff520d07253373bb6cb9b25220b5 (diff) | |
download | alembic-e8a0c740b17100e6e366a7484d58d5b26f68c094.tar.gz |
- additional fix which impacts #267. fix filtered_heads() to accommodate
being given "heads" as the target so that it will in fact match when all heads
are given. fixes #267
-rw-r--r-- | alembic/revision.py | 4 | ||||
-rw-r--r-- | tests/test_revision.py | 9 | ||||
-rw-r--r-- | tests/test_version_traversal.py | 5 |
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): |