From: Mike Bayer Date: Thu, 4 Apr 2013 19:30:42 +0000 (-0400) Subject: fix head only when there's no rev... X-Git-Tag: rel_0_5_0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cacfb1407d6458661d9d0e5e00c0253e30bb23e;p=thirdparty%2Fsqlalchemy%2Falembic.git fix head only when there's no rev... --- diff --git a/alembic/command.py b/alembic/command.py index 35a4eae3..aad96911 100644 --- a/alembic/command.py +++ b/alembic/command.py @@ -178,8 +178,8 @@ def current(config, head_only=False): if head_only: config.print_stdout("%s%s" % ( - rev.revision, - " (head)" if rev.is_head else "")) + rev.revision if rev else None, + " (head)" if rev and rev.is_head else "")) else: config.print_stdout("Current revision for %s: %s",