diff --git a/docs/index.rst b/docs/index.rst index 309e288..8c12989 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -98,6 +98,9 @@ The application will now have a ``db`` command line option with several sub-comm - ``manage.py db history [--rev-range REV_RANGE]`` Shows the list of migrations. If a range isn't given then the entire history is shown. +- ``manage.py db branches`` + Lists revisions that have broken the source tree into two versions representing two independent sets of changes. + Notes: - All options also take a ``--directory DIRECTORY`` option that points to the directory containing the migration scripts. If this argument is omitted the directory used is `migrations`. diff --git a/flask_migrate/__init__.py b/flask_migrate/__init__.py index af6d991..a8a9f87 100644 --- a/flask_migrate/__init__.py +++ b/flask_migrate/__init__.py @@ -105,3 +105,9 @@ def downgrade(directory = None, revision = '-1', sql = False, tag = None): "Revert to a previous version" config = _get_config(directory) command.downgrade(config, revision, sql = sql, tag = tag) + +@MigrateCommand.option('-d', '--directory', dest = 'directory', default = None, help = "Migration script directory (default is 'migrations')") +def branches(directory = None): + "Lists revisions that have broken the source tree into two versions representing two independent sets of changes" + config = _get_config(directory) + command.branches(config) diff --git a/setup.py b/setup.py index 4feafc6..eb526d7 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from setuptools import setup setup( name='Flask-Migrate', - version='1.1.1', + version='1.2.0', url='http://github.com/miguelgrinberg/flask-migrate/', license='MIT', author='Miguel Grinberg',