summaryrefslogtreecommitdiff
path: root/alembic/script.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-11-14 18:12:04 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-11-14 18:12:04 -0500
commitc8bcd152b8ac822a85f4e1539b3748c4461bdceb (patch)
tree8cd0267175a34ec1aed052afa8aefb20ef071643 /alembic/script.py
parentf576169d362694139193dc29e7d2ba9f57323809 (diff)
downloadalembic-c8bcd152b8ac822a85f4e1539b3748c4461bdceb.tar.gz
get env to have all the arguments before and after context is set up
Diffstat (limited to 'alembic/script.py')
-rw-r--r--alembic/script.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/alembic/script.py b/alembic/script.py
index 64bc226..4c4b365 100644
--- a/alembic/script.py
+++ b/alembic/script.py
@@ -49,15 +49,19 @@ class ScriptDirectory(object):
yield sc
def _get_rev(self, id_):
- if id_ == 'head':
- id_ = self._current_head()
- elif id_ == 'base':
- id_ = None
+ id_ = self._as_rev_number(id_)
try:
return self._revision_map[id_]
except KeyError:
raise util.CommandError("No such revision %s" % id_)
+ def _as_rev_number(self, id_):
+ if id_ == 'head':
+ id_ = self._current_head()
+ elif id_ == 'base':
+ id_ = None
+ return id_
+
def _revs(self, upper, lower):
lower = self._get_rev(lower)
upper = self._get_rev(upper)