Merge "neutron-db-manage: sync HEADS file with 'current' output"
This commit is contained in:
commit
a230b73e3f
|
@ -1,3 +1,2 @@
|
|||
2e5352a0ad4d
|
||||
9859ac9c136
|
||||
kilo
|
||||
|
|
|
@ -21,8 +21,7 @@ Create Date: 2015-06-22 00:00:00.000000
|
|||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '30018084ec99'
|
||||
down_revision = None
|
||||
depends_on = ('kilo',)
|
||||
down_revision = 'kilo'
|
||||
branch_labels = ('liberty_contract',)
|
||||
|
||||
|
||||
|
|
|
@ -23,9 +23,8 @@ Create Date: 2015-04-19 14:59:15.102609
|
|||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '354db87e3225'
|
||||
down_revision = None
|
||||
down_revision = 'kilo'
|
||||
branch_labels = ('liberty_expand',)
|
||||
depends_on = ('kilo',)
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
|
|
@ -255,12 +255,7 @@ def validate_labels(config):
|
|||
|
||||
def _get_sorted_heads(script):
|
||||
'''Get the list of heads for all branches, sorted.'''
|
||||
heads = script.get_heads()
|
||||
# +1 stands for the core 'kilo' branch, the one that didn't have branches
|
||||
if len(heads) > len(MIGRATION_BRANCHES) + 1:
|
||||
alembic_util.err(_('No new branches are allowed except: %s') %
|
||||
' '.join(MIGRATION_BRANCHES))
|
||||
return sorted(heads)
|
||||
return sorted(script.get_heads())
|
||||
|
||||
|
||||
def validate_heads_file(config):
|
||||
|
|
|
@ -324,17 +324,6 @@ class TestCli(base.BaseTestCase):
|
|||
mock_open.return_value.write.assert_called_once_with(
|
||||
'\n'.join(sorted(heads)))
|
||||
|
||||
def test_update_heads_file_excessive_heads_negative(self):
|
||||
with mock.patch('alembic.script.ScriptDirectory.from_config') as fc:
|
||||
heads = ('b', 'a', 'c', 'kilo')
|
||||
fc.return_value.get_heads.return_value = heads
|
||||
self.assertRaises(
|
||||
SystemExit,
|
||||
cli.update_heads_file,
|
||||
mock.sentinel.config
|
||||
)
|
||||
self.mock_alembic_err.assert_called_once_with(mock.ANY)
|
||||
|
||||
@mock.patch('os.path.exists')
|
||||
@mock.patch('os.remove')
|
||||
def test_update_heads_file_success(self, *os_mocks):
|
||||
|
|
Loading…
Reference in New Issue