summaryrefslogtreecommitdiff
path: root/alembic/script
diff options
context:
space:
mode:
authorJohn Passaro <john.a.passaro@gmail.com>2017-06-27 14:36:11 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-07-03 14:56:39 -0400
commit6a043d10d87c69ffc7449148677e17a4b94a74db (patch)
tree3ec8610a81b5030e8634301c382ea03fc80119f3 /alembic/script
parent54c5abb15caeb14ddfc70d54424a59dbf8ef3132 (diff)
downloadalembic-6a043d10d87c69ffc7449148677e17a4b94a74db.tar.gz
expose on_version_apply callback to context users
Change-Id: I694e26f7d161dcaf4f035277c8317ff6ffe41680 Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/67
Diffstat (limited to 'alembic/script')
-rw-r--r--alembic/script/base.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/alembic/script/base.py b/alembic/script/base.py
index 17cb3de..6448685 100644
--- a/alembic/script/base.py
+++ b/alembic/script/base.py
@@ -370,7 +370,8 @@ class ScriptDirectory(object):
# dest is 'base'. Return a "delete branch" migration
# for all applicable heads.
steps.extend([
- migration.StampStep(head.revision, None, False, True)
+ migration.StampStep(head.revision, None, False, True,
+ self.revision_map)
for head in filtered_heads
])
continue
@@ -390,7 +391,8 @@ class ScriptDirectory(object):
assert not ancestors.intersection(filtered_heads)
todo_heads = [head.revision for head in filtered_heads]
step = migration.StampStep(
- todo_heads, dest.revision, False, False)
+ todo_heads, dest.revision, False, False,
+ self.revision_map)
steps.append(step)
continue
elif ancestors.intersection(filtered_heads):
@@ -398,13 +400,15 @@ class ScriptDirectory(object):
# we can treat them as a "merge", single step.
todo_heads = [head.revision for head in filtered_heads]
step = migration.StampStep(
- todo_heads, dest.revision, True, False)
+ todo_heads, dest.revision, True, False,
+ self.revision_map)
steps.append(step)
continue
else:
# destination is in a branch not represented,
# treat it as new branch
- step = migration.StampStep((), dest.revision, True, True)
+ step = migration.StampStep((), dest.revision, True, True,
+ self.revision_map)
steps.append(step)
continue
return steps