diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-11-14 18:12:04 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-11-14 18:12:04 -0500 |
commit | c8bcd152b8ac822a85f4e1539b3748c4461bdceb (patch) | |
tree | 8cd0267175a34ec1aed052afa8aefb20ef071643 /alembic/script.py | |
parent | f576169d362694139193dc29e7d2ba9f57323809 (diff) | |
download | alembic-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.py | 12 |
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) |