rev = script.get_revision(rev)
if head_only:
- config.print_stdout(str(rev.revision))
+ config.print_stdout("%s%s" % (
+ rev.revision,
+ " (head)" if rev.is_head else ""))
else:
config.print_stdout("Current revision for %s: %s",
if 'head_only' in kwargs:
parser.add_argument("--head-only",
action="store_true",
- help="Only show head version")
+ help="Only show current version and "
+ "wheter or not this is the head revision.")
positional_help = {
'directory': "location of scripts directory",
INFO [alembic.context] Will assume transactional DDL.
Current revision for postgresql://scott:XXXXX@localhost/test: 1975ea83b712 -> ae1027a6acf (head), Add a column
+``head`` is deplayed if the revision identifier for this database matches the head revision.
+
We can also view history::
$ alembic history