diff --git a/README.md b/README.md deleted file mode 100644 index d41e828..0000000 --- a/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Django migration linter - -> Detect backward incompatible migrations for your django project. It will save you time by making sure migrations will not break anything. - -badge of travis CI -PyPi version -badge of license -badge of pull request welcome -badge of hiring advertisement of 3yourmind -badge of github star - -## Dependencies - -

- Needed software (in PATH) - - * `python` - * `git` (if you specify a git identifier) -

- -The linter will try to detect if the project is a django project and is versioned with git. - -## Installation - -

Using pip -
pip install django-migration-linter
-

- -## Usage - -`django-migration-linter DJANGO_PROJECT_FOLDER [GIT_COMMIT_ID] [--ignore-name-contains=IGNORE_NAME_CONTAINS] [--include-apps INCLUDE_APPS [INCLUDE_APPS ...] | --exclude-apps EXCLUDE_APPS [EXCLUDE_APPS ...]]` - -| Parameter | Description | -| -- | -- | -| `DJANGO_PROJECT_FOLDER` | An absolute or relative path to the django project. | -| `GIT_COMMIT_ID` | If specified, only migrations since this commit will be taken into account. If not specified, the initial repo commit will be used. | -| `--ignore-name-contains IGNORE_NAME_CONTAINS` | Ignore migrations containing this name | -| `--ignore-name IGNORE_NAME [IGNORE_NAME ...]` | Ignore migrations with exactly one of these names | -| `--include-apps INCLUDE_APPS [INCLUDE_APPS ...]` | Check only migrations that are in the specified django apps | -| `--exclude-apps EXCLUDE_APPS [EXCLUDE_APPS ...]` | Ignore migrations that are in the specified django apps | -| `--verbose` or `-v` | print more information during execution | -| `--database DATABASE` | Specify the database for which to generate the SQL. Defaults to *default* | - -## Examples - -3YOURMIND is running this on [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) with every build getting triggered in this environment. - -![](https://i.imgur.com/ocLpQXP.png) - -## Tests - -The easiest way to run the tests is to invoke [tox](https://pypi.python.org/pypi/tox). - -## Contributing - -First, thank you very much if you want to contribute to the project. -Please base your work on the `dev` branch and also target this branch in your pull request. - -## License - -*django-migration-linter* is released under the [Apache 2.0 License](./LICENSE). diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..30875a0 --- /dev/null +++ b/README.rst @@ -0,0 +1,73 @@ +======================= +Django migration linter +======================= + +Detect backward incompatible migrations for your django project. It will save you time by making sure migrations will not break anything. + +.. image:: https://travis-ci.org/3YOURMIND/django-migration-linter.svg?branch=master + :target: https://travis-ci.org/3YOURMIND/django-migration-linter + +.. image:: https://img.shields.io/pypi/v/django-migration-linter.svg + :target: https://pypi.python.org/pypi/django-migration-linter/ + +.. image:: https://img.shields.io/github/license/3yourmind/django-migration-linter.svg + :target: ./LICENSE + +.. image:: https://img.shields.io/badge/PR-welcome-green.svg + :target: https://github.com/3YOURMIND/django-migration-linter/pulls + +.. image:: https://img.shields.io/badge/3YOURMIND-Hiring-brightgreen.svg + :target: https://www.3yourmind.com/career + +.. image:: https://img.shields.io/github/stars/3YOURMIND/django-migration-linter.svg?style=social&label=Stars + :target: https://github.com/3YOURMIND/django-migration-linter/stargazers + +Installation +------------ + +``pip install django-migration-linter`` + + +Usage +----- + +``django-migration-linter DJANGO_PROJECT_FOLDER [GIT_COMMIT_ID] [--ignore-name-contains=IGNORE_NAME_CONTAINS] [--include-apps INCLUDE_APPS [INCLUDE_APPS ...] | --exclude-apps EXCLUDE_APPS [EXCLUDE_APPS ...]]`` + +================================================== =========================================================================================================================== + Parameter Description +================================================== =========================================================================================================================== +``DJANGO_PROJECT_FOLDER`` An absolute or relative path to the django project. +``GIT_COMMIT_ID`` If specified, only migrations since this commit will be taken into account. If not specified, all migrations will be linted. +``--ignore-name-contains IGNORE_NAME_CONTAINS`` Ignore migrations containing this name. +``--ignore-name IGNORE_NAME [IGNORE_NAME ...]`` Ignore migrations with exactly one of these names. +``--include-apps INCLUDE_APPS [INCLUDE_APPS ...]`` Check only migrations that are in the specified django apps. +``--exclude-apps EXCLUDE_APPS [EXCLUDE_APPS ...]`` Ignore migrations that are in the specified django apps. +``--verbose or -v`` Print more information during execution. +``--database DATABASE`` Specify the database for which to generate the SQL. Defaults to *default*. +================================================== =========================================================================================================================== + +Examples +-------- + +3YOURMIND is running the linter on `Bitbucket Pipelines`_ on every build getting pushed. + +Tests +----- + +The easiest way to run the tests is to invoke `tox`_. + +Contributing +------------ + +First, thank you very much if you want to contribute to the project. +Please base your work on the ``dev`` branch and also target this branch in your pull request. + +License +------- + +*django-migration-linter* is released under the `Apache 2.0 License`_. + + +.. _`Bitbucket Pipelines`: https://bitbucket.org/product/features/pipelines +.. _`tox`: https://pypi.python.org/pypi/tox +.. _`Apache 2.0 License`: https://github.com/3YOURMIND/django-migration-linter/blob/master/LICENSE diff --git a/django_migration_linter/migration_linter.py b/django_migration_linter/migration_linter.py index 69158ff..00a44eb 100644 --- a/django_migration_linter/migration_linter.py +++ b/django_migration_linter/migration_linter.py @@ -125,16 +125,16 @@ class MigrationLinter(object): Even if calling a shell is slow and ugly, for now, it allows to seperate the instances correctly. """ - git_diff_command = ( + sqlmigrate_command = ( 'cd {0} && ' '{1} manage.py sqlmigrate {2} {3} ' '--database {4}').format( self.django_path, self.python_exe, app_name, migration_name, self.database) - log.info('Executing {0}'.format(git_diff_command)) + log.info('Executing {0}'.format(sqlmigrate_command)) sqlmigrate_process = Popen( - git_diff_command, shell=True, stdout=PIPE, stderr=PIPE) + sqlmigrate_command, shell=True, stdout=PIPE, stderr=PIPE) sql_statements = [] for line in map( @@ -152,14 +152,16 @@ class MigrationLinter(object): def _gather_migrations_git(self, git_commit_id): migrations = [] # Get changes since specified commit - git_diff_command = 'cd {0} && git diff --name-only {1}'.format( - self.django_path, git_commit_id) + git_diff_command = ( + 'cd {0} && ' + 'git diff --name-only --diff-filter=A {1}').format( + self.django_path, git_commit_id) log.info('Executing {0}'.format(git_diff_command)) diff_process = Popen( git_diff_command, shell=True, stdout=PIPE, stderr=PIPE) for line in map( utils.clean_bytes_to_str, diff_process.stdout.readlines()): - # Only gather lines that include migrations + # Only gather lines that include added migrations if re.search( '\/{0}\/.*\.py'.format(self.MIGRATION_FOLDER_NAME), line) and \ diff --git a/django_migration_linter/sql_analyser.py b/django_migration_linter/sql_analyser.py index d566072..636be21 100644 --- a/django_migration_linter/sql_analyser.py +++ b/django_migration_linter/sql_analyser.py @@ -50,6 +50,11 @@ migration_tests = ( 'fn': lambda sql, **kw: re.search('RENAME TABLE', sql) or re.search('ALTER TABLE .* RENAME TO', sql), 'err_msg': 'RENAMING tables' + }, { + 'code': 'ALTER_COLUMN', + 'fn': lambda sql, **kw: re.search('ALTER TABLE .* MODIFY', sql), + 'err_msg': ('ALTERING columns (Could be backward compatible. ' + 'You may ignore this migration.)') }, { 'code': '', 'fn': has_default, diff --git a/examples/example_test_integration.py b/examples/example_test_integration.py new file mode 100644 index 0000000..5cfd59f --- /dev/null +++ b/examples/example_test_integration.py @@ -0,0 +1,72 @@ +# Copyright 2018 3YOURMIND GmbH + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# You can use this file to integrate the migration-linter into your tests. +# In this example only the migrations after the latest version bump are +# considered. +# + +import os +from subprocess import Popen, PIPE +from unittest import TestCase + +from django.conf import settings + + +# Replace that function according to your needs +def read_version_file(): + with open('version', 'r') as f: + return '{0}'.format(f.read().replace('\n', '')) + + +class MigrationTest(TestCase): + ignored_migrations = ( + ) + excluded_apps = ( + ) + + @classmethod + def setUpClass(cls): + super(MigrationTest, cls).setUpClass() + cls.project_path = os.path.dirname(settings.PROJECT_PATH) + cls.latest_tag = '{0}'.format(read_version_file()) + + def test_latest_migrations(self): + ignored_migration_parameter = '--ignore-name ' + \ + ' '.join(self.ignored_migrations) \ + if self.ignored_migrations else '' + + excluded_apps_parameter = '--exclude-apps ' + \ + ' '.join(self.excluded_apps) \ + if self.excluded_apps else '' + + linter_cmd = 'django-migration-linter {0} {1} {2} {3}'.format( + self.project_path, + self.latest_tag, + ignored_migration_parameter, + excluded_apps_parameter) + + lint_process = Popen(linter_cmd, shell=True, stdout=PIPE, stderr=PIPE) + lint_process.wait() + + if lint_process.returncode != 0: + out, err = lint_process.communicate() + out = out.decode('ascii') + self.fail('The migration linter found errors\n' + 'migration command: {0}\n' + 'STDOUT: {1}\n' + 'STDERR: {2}\n'. + format(linter_cmd, out, err) + ) diff --git a/setup.py b/setup.py index c8b2499..0f78d53 100644 --- a/setup.py +++ b/setup.py @@ -12,26 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -from codecs import open from os import path from setuptools import setup, find_packages PROJECT_DIR = path.abspath(path.dirname(__file__)) -try: - import pypandoc - long_description = pypandoc.convert('README.md', 'rst') -except(IOError, ImportError): - long_description = open('README.md').read() +with open(path.join(PROJECT_DIR, 'README.rst')) as f: + long_description = f.read() install_requirements = [ + 'django>=1.10', ] test_requirements = [ 'pytest', 'tox', - 'django>=1.10', 'django-fake-database-backends', ] diff --git a/tests/fixtures.py b/tests/fixtures.py index 2502885..5d97a82 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -28,6 +28,8 @@ DROP_COLUMN_PROJECT = os.path.join( _FIXTURES_FOLDER, 'test_project_drop_column/') RENAME_COLUMN_PROJECT = os.path.join( _FIXTURES_FOLDER, 'test_project_rename_column/') +ALTER_COLUMN_PROJECT = os.path.join( + _FIXTURES_FOLDER, 'test_project_alter_column') RENAME_TABLE_PROJECT = os.path.join( _FIXTURES_FOLDER, 'test_project_rename_table/') ADD_NOT_NULL_COLUMN_FOLLOWED_BY_DEFAULT_PROJECT = os.path.join( @@ -36,6 +38,8 @@ MULTI_COMMIT_PROJECT = os.path.join( _FIXTURES_FOLDER, 'test_project_multi_commit/') CORRECT_PROJECT = os.path.join( _FIXTURES_FOLDER, 'test_correct_project/') +DELETED_MIGRATION_PROJECT = os.path.join( + _FIXTURES_FOLDER, 'test_deleted_migration_project/') NOT_DJANGO_GIT_PROJECT = os.path.join( _FIXTURES_FOLDER, 'test_git_project/') @@ -44,7 +48,8 @@ NOT_GIT_DJANGO_PROJECT = os.path.join( ALL_GIT_PROJECTS = ( NOT_DJANGO_GIT_PROJECT, - MULTI_COMMIT_PROJECT + MULTI_COMMIT_PROJECT, + DELETED_MIGRATION_PROJECT ) diff --git a/tests/functional/test_cmd_line_call.py b/tests/functional/test_cmd_line_call.py index bc34b15..a3afd33 100644 --- a/tests/functional/test_cmd_line_call.py +++ b/tests/functional/test_cmd_line_call.py @@ -129,3 +129,18 @@ class CallLinterFromCommandLineTest(unittest.TestCase): self.assertEqual(len(lines), 3) self.assertTrue(lines[0].endswith('OK')) self.assertTrue(lines[1].startswith('*** Summary')) + + def test_call_linter_with_deleted_migrations(self): + cmd = '{0} {1} 154ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba'.format( + self.linter_exec, + fixtures.DELETED_MIGRATION_PROJECT) + fixtures.prepare_git_project(fixtures.DELETED_MIGRATION_PROJECT) + + process = Popen( + cmd, shell=True, stdout=PIPE, stderr=PIPE) + process.wait() + self.assertEqual(process.returncode, 0) + lines = list(map(utils.clean_bytes_to_str, process.stdout.readlines())) + self.assertEqual(len(lines), 3) + self.assertTrue(lines[0].endswith('OK')) + self.assertTrue(lines[1].startswith('*** Summary')) diff --git a/tests/functional/test_migration_linter.py b/tests/functional/test_migration_linter.py index 17f6afc..6187613 100644 --- a/tests/functional/test_migration_linter.py +++ b/tests/functional/test_migration_linter.py @@ -25,6 +25,17 @@ class BackwardcompatibilityDetectionTest(unittest.TestCase): BackwardcompatibilityDetectionTest, self).tearDown(*args, **kwargs) + def _test_linter_finds_errors(self, path, commit_id=None): + linter = MigrationLinter(path) + linter.lint_all_migrations(git_commit_id=commit_id) + self.assertTrue(linter.has_errors) + + def _test_linter_finds_no_errors(self, path, commit_id=None): + linter = MigrationLinter(path) + linter.lint_all_migrations(git_commit_id=commit_id) + self.assertFalse(linter.has_errors) + + # *** Tests *** def test_create_table_with_not_null_column(self): test_project_path = fixtures.CREATE_TABLE_WITH_NOT_NULL_COLUMN_PROJECT self._test_linter_finds_no_errors(test_project_path) @@ -50,6 +61,10 @@ class BackwardcompatibilityDetectionTest(unittest.TestCase): fixtures.ADD_NOT_NULL_COLUMN_FOLLOWED_BY_DEFAULT_PROJECT self._test_linter_finds_no_errors(test_project_path) + def test_detect_alter_column(self): + test_project_path = fixtures.ALTER_COLUMN_PROJECT + self._test_linter_finds_errors(test_project_path) + def test_no_specify_git_hash(self): test_project_path = fixtures.MULTI_COMMIT_PROJECT fixtures.prepare_git_project(test_project_path) @@ -66,13 +81,3 @@ class BackwardcompatibilityDetectionTest(unittest.TestCase): # test_project_path = fixtures.MULTI_COMMIT_PROJECT # fixtures.prepare_git_project(test_project_path) # self._test_linter_finds_no_errors(test_project_path, commit_id='tag1') - - def _test_linter_finds_errors(self, path, commit_id=None): - linter = MigrationLinter(path) - linter.lint_all_migrations(git_commit_id=commit_id) - self.assertTrue(linter.has_errors) - - def _test_linter_finds_no_errors(self, path, commit_id=None): - linter = MigrationLinter(path) - linter.lint_all_migrations(git_commit_id=commit_id) - self.assertFalse(linter.has_errors) diff --git a/tests/test_project_fixtures/test_deleted_migration_project/.gitignore b/tests/test_project_fixtures/test_deleted_migration_project/.gitignore new file mode 100644 index 0000000..63973d0 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/.gitignore @@ -0,0 +1,3 @@ +*.pyc +__pycache__/ +*sqlite3 diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/COMMIT_EDITMSG b/tests/test_project_fixtures/test_deleted_migration_project/git/COMMIT_EDITMSG new file mode 100644 index 0000000..e513fa5 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/COMMIT_EDITMSG @@ -0,0 +1,16 @@ +Delete file and insert new + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Thu Jan 18 23:27:37 2018 +0100 +# +# On branch master +# Changes to be committed: +# deleted: test_app/migrations/0002_new_not_null_field.py +# new file: test_app/migrations/0003_new_nullable_field.py +# modified: test_app/models.py +# +# Untracked files: +# git/ +# diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/HEAD b/tests/test_project_fixtures/test_deleted_migration_project/git/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/ORIG_HEAD b/tests/test_project_fixtures/test_deleted_migration_project/git/ORIG_HEAD new file mode 100644 index 0000000..70acf6c --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/ORIG_HEAD @@ -0,0 +1 @@ +154ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/config b/tests/test_project_fixtures/test_deleted_migration_project/git/config new file mode 100644 index 0000000..eeb8dd7 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/config @@ -0,0 +1,5 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/description b/tests/test_project_fixtures/test_deleted_migration_project/git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/index b/tests/test_project_fixtures/test_deleted_migration_project/git/index new file mode 100644 index 0000000..a41e52a Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/index differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/info/exclude b/tests/test_project_fixtures/test_deleted_migration_project/git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/logs/HEAD b/tests/test_project_fixtures/test_deleted_migration_project/git/logs/HEAD new file mode 100644 index 0000000..5377828 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/logs/HEAD @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 0395cbee60f2ea1b97f42ebdd43991c8f5d8d76e David-Wobrock 1516314144 +0100 commit (initial): Project init +0395cbee60f2ea1b97f42ebdd43991c8f5d8d76e 154ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba David-Wobrock 1516314322 +0100 commit: Add backward incompatible migration +154ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba be2fae887ee7ecd2d1e6371af1a865c17414bde9 David-Wobrock 1516314457 +0100 commit: Delete file and insert new +be2fae887ee7ecd2d1e6371af1a865c17414bde9 4bdc4ba9e7695893423be1b54f3101d6ccbd11c7 David-Wobrock 1516459290 +0100 commit (amend): Delete file and insert new diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/logs/refs/heads/master b/tests/test_project_fixtures/test_deleted_migration_project/git/logs/refs/heads/master new file mode 100644 index 0000000..5377828 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/logs/refs/heads/master @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 0395cbee60f2ea1b97f42ebdd43991c8f5d8d76e David-Wobrock 1516314144 +0100 commit (initial): Project init +0395cbee60f2ea1b97f42ebdd43991c8f5d8d76e 154ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba David-Wobrock 1516314322 +0100 commit: Add backward incompatible migration +154ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba be2fae887ee7ecd2d1e6371af1a865c17414bde9 David-Wobrock 1516314457 +0100 commit: Delete file and insert new +be2fae887ee7ecd2d1e6371af1a865c17414bde9 4bdc4ba9e7695893423be1b54f3101d6ccbd11c7 David-Wobrock 1516459290 +0100 commit (amend): Delete file and insert new diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/03/95cbee60f2ea1b97f42ebdd43991c8f5d8d76e b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/03/95cbee60f2ea1b97f42ebdd43991c8f5d8d76e new file mode 100644 index 0000000..0054e0e --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/03/95cbee60f2ea1b97f42ebdd43991c8f5d8d76e @@ -0,0 +1,2 @@ +x¥�; +1@­sŠéÅ%gC"ÀÎ:ŸY�kQ¯ïŠG°|¯x/I­¥z\õÆ �s²dR´}ÐVóHqrÙzãÜ™ÉkRáÙ¯Òà^%oΛ¤vù‹Ãû‡‡K å>$©{Àí ‰`­QkµØeÜù�„:5¹qêP¥«J>ñ \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/09/d00ce23e0b42f2c18895ee5fa577f57f14b2ac b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/09/d00ce23e0b42f2c18895ee5fa577f57f14b2ac new file mode 100644 index 0000000..4d7d160 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/09/d00ce23e0b42f2c18895ee5fa577f57f14b2ac @@ -0,0 +1,3 @@ +x]PËjÃ0ìÙ_±�ƒ�;Ôm øRrÈ­·„m­�ZY2zÒ¯¯dåY„˜™�™UÃee™?Ì }L¡•”‰~Öté«G¢¼£@U¤ÐaóU‹^B‘Eö RÀ2/^Ò"O—%O«¼Œ:% ¤³Æ*$Ø0JeÀ +æÌ‘pfœ×QÒÉ/£ÍY7°Þ…1)ô7à•QËk­a¦’«(»€óU�;L0Ãj|(‹£8¢ (Z†ÚŸ“ð89úí|à…ñ67o +Ýú{_&™&=ï�¨¬âu¼¸C;†œê*„a¸“˜Ñø¼U¶¶Fn½4©Ý‹´S­|錊 µ:’o<ž�ÊmÅ~±Úºßs’T�ÔHB‰Ý&žÏï{øÐ$–s2UºFï„ÁUH÷‚)ãÿüájwr>Dqá£& \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/10/7654971c8d8cd4a209b0363d4604fc9ee7d494 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/10/7654971c8d8cd4a209b0363d4604fc9ee7d494 new file mode 100644 index 0000000..0d561f2 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/10/7654971c8d8cd4a209b0363d4604fc9ee7d494 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/15/4ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/15/4ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba new file mode 100644 index 0000000..15253fb --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/15/4ecf6119325cc3b1f3f5a4e709bfbd61a4a4ba @@ -0,0 +1 @@ +x¥ŽKJD1Eg5›ü^> ¢àWª*mèÎK¢½}Ÿ¸g÷ÜÁáÐè½-°Á>¬)Õn”8PŽ"¹ZD'…LJ^2»èÅbv5IT7œ²/Ð.oTD‚®VД«·R˜½ËÙPª'ŽA~­Ï1á¿?}Œ2]à™ñtÿÃ×sÇv=Ñè/`6œñÎZxÔFku¼Gè’(Ô3¤Ë'CÛå W+W�ÞÎó˜cW?hþVd \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/20/6a76068032bb321ca63f561a230675d2645182 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/20/6a76068032bb321ca63f561a230675d2645182 new file mode 100644 index 0000000..40a0fd7 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/20/6a76068032bb321ca63f561a230675d2645182 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/2b/df33777b398bff4fca0e0aad47e9a7c57a2f96 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/2b/df33777b398bff4fca0e0aad47e9a7c57a2f96 new file mode 100644 index 0000000..a150ce3 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/2b/df33777b398bff4fca0e0aad47e9a7c57a2f96 @@ -0,0 +1,2 @@ +x]OÁj„0ì9_ñ \QÙ‚,xXºlÙÃÞz+"Ѽ•´1‘D ö뛘ݵÛwafÞ̼F¨¶ÅËÓ3¼¡DMGdÐÌpø¤²S�'i’�’�§Y±I³MV@žïò-!­z`‹,a ð~Pz„žwÖƒ+ibèCa!­ ÆÀùF…«(¹ƒÑްÃ%9P»žÐc ” eËÑXâcVžSƒ+íùñªÑ^uveÂeÓñn$í± öAü€^8 +fJâ…þ ΂ÛUÉ~ÕÑICju»„°Ò•Žaм§z®¿p¾"µ½Šÿ`y¤ÂXÉ7êF¬}‰Ó!ˆ¢Ç.4 ä$D½TZ£OrĵOw‚%ãÿ~µÚ]�+ò ¢�m \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/39/0459eae1e9c3eecaac732d51867c8b8ed5102f b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/39/0459eae1e9c3eecaac732d51867c8b8ed5102f new file mode 100644 index 0000000..21bfffe Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/39/0459eae1e9c3eecaac732d51867c8b8ed5102f differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/3a/629de3fbf102d771b2a711bfe2f1ab3b830d14 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/3a/629de3fbf102d771b2a711bfe2f1ab3b830d14 new file mode 100644 index 0000000..6c07516 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/3a/629de3fbf102d771b2a711bfe2f1ab3b830d14 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/3c/dde4d6a3d85cb65c15446791e93c78ecac3ed5 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/3c/dde4d6a3d85cb65c15446791e93c78ecac3ed5 new file mode 100644 index 0000000..eee3f45 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/3c/dde4d6a3d85cb65c15446791e93c78ecac3ed5 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/43/52f2dfe637a766c7fe558cc85b961860efd50c b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/43/52f2dfe637a766c7fe558cc85b961860efd50c new file mode 100644 index 0000000..6140b56 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/43/52f2dfe637a766c7fe558cc85b961860efd50c differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/45/3c549087e331a41ecbed2a81c9b8e92e8693e9 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/45/3c549087e331a41ecbed2a81c9b8e92e8693e9 new file mode 100644 index 0000000..23a50d1 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/45/3c549087e331a41ecbed2a81c9b8e92e8693e9 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/49/ca6418f20f7dac5f12b1c1d66e99844d44fd12 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/49/ca6418f20f7dac5f12b1c1d66e99844d44fd12 new file mode 100644 index 0000000..a83c2f7 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/49/ca6418f20f7dac5f12b1c1d66e99844d44fd12 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/330bb1c7154afb23f170218d170dae079c437f b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/330bb1c7154afb23f170218d170dae079c437f new file mode 100644 index 0000000..d261e11 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/330bb1c7154afb23f170218d170dae079c437f @@ -0,0 +1,2 @@ +x�ޱ +Â0E]íW¼± RAÈ …‚ƒ›{Hš×´ò’H’¢ŸocÄÉñ^Îá^E^A]ïW}ðôU:ã™V0Ú› ¬×H±(:’1±\2;çº:k7‰~DÒÀß0;¹„C›Û2ü&¬fïÂù$þ“ZIñcuƒ /M*B‘0¦ßÑf&–E+‚Й4ðÝv_ž<4Si \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 new file mode 100644 index 0000000..adf6411 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/dc4ba9e7695893423be1b54f3101d6ccbd11c7 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/dc4ba9e7695893423be1b54f3101d6ccbd11c7 new file mode 100644 index 0000000..4b41432 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4b/dc4ba9e7695893423be1b54f3101d6ccbd11c7 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4c/e3b40413b7f8938d91828c437f33f66d57fcc9 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4c/e3b40413b7f8938d91828c437f33f66d57fcc9 new file mode 100644 index 0000000..24365e0 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/4c/e3b40413b7f8938d91828c437f33f66d57fcc9 @@ -0,0 +1 @@ +xU�Ak„0…{öW ìA·¨¨]l<JK½õVJˆf””8‘)ý÷Mâ®íæÞ¼yßK:¥;8ÕÅÍ²Û z-$� ¬vÈ¼à ·( û�§/N£†2/˼MPå}VYU»kswŠ£'`lXíj�1�Ó¬�…•¤ G¦¤uij‰6£y¹è.¾IŽ&5-)LnÁ;£^ñe�·Ë(ù3å»xl¢Ü8# ¤^â-|Ñ’ØâbŸç8…¸(ŠŠq!á7#m­J±A¢ñ1 KŸ[ žýó}£«¸…xö‹ÉÎò¼ÐžŸ°�y¼EzÝŸM h‡å�Â3úÚê´Û7ä¯dqD³‘|ÛöݬxîêC÷Ú¿ºÁ‹U \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/61/d7983b41623ed85d46c0212c66db9507948532 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/61/d7983b41623ed85d46c0212c66db9507948532 new file mode 100644 index 0000000..227f7f1 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/61/d7983b41623ed85d46c0212c66db9507948532 @@ -0,0 +1,3 @@ +x]�ÍjÃ0„{ÖS,ô !«LÀ‡BHé¡·ÞJ1R´1 +òÊX +¥oßHnÝŸ=ÎÎ~3k|0p×Ê›[xDÂY'´`>`Ö4PBŠ�’M»•ͶiA©�ºgì4‡l± kÀ�S˜Œn¸2\ XÃ,úÈ;z#<¯ª“XÅÍŽ1¸ŽÅ É"FèൈyQñ„1õzšx \JÙôŽ\rÚóM]\o !Lù�\áÏý¯Ðk½­Vx(u{Ò#v\ó™õ<‹JøÞÓÅ{m<ö§Løg+Z·ü-ž(á€ó’”Ϻ—ù‚_]3t­ý ¡¢o� \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/63/973d01988ba594743a8046c9c88c2aa527d307 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/63/973d01988ba594743a8046c9c88c2aa527d307 new file mode 100644 index 0000000..3f771d5 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/63/973d01988ba594743a8046c9c88c2aa527d307 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/73/47b0f2a9845fa268ad4a19967c706e5d7be38b b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/73/47b0f2a9845fa268ad4a19967c706e5d7be38b new file mode 100644 index 0000000..621f4fc Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/73/47b0f2a9845fa268ad4a19967c706e5d7be38b differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/73/5de5db8bc5e1ed29b3cb7ece62b5e7c8db06ee b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/73/5de5db8bc5e1ed29b3cb7ece62b5e7c8db06ee new file mode 100644 index 0000000..66ccc09 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/73/5de5db8bc5e1ed29b3cb7ece62b5e7c8db06ee differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/7c/e503c2dd97ba78597f6ff6e4393132753573f6 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/7c/e503c2dd97ba78597f6ff6e4393132753573f6 new file mode 100644 index 0000000..250bef6 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/7c/e503c2dd97ba78597f6ff6e4393132753573f6 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/86/deb0cf782231006446fd6194592c2243e74ffe b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/86/deb0cf782231006446fd6194592c2243e74ffe new file mode 100644 index 0000000..635c9d7 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/86/deb0cf782231006446fd6194592c2243e74ffe @@ -0,0 +1 @@ +x+)JMU04±`040031Qˆ�ÏÌË,‰�×+¨dx6÷ÑìM¯9{wk®+�ºqèIOðD¨²âÔ’’̼ôb�²)ûw—Ê`Ö4PBŠ�’M»•ͶiA©�ºgì4‡l± kÀ�S˜Œn¸2\ XÃ,úÈ;z#<¯ª“XÅÍŽ1¸ŽÅ É"FèൈyQñ„1õzšx \JÙôŽ\rÚóM]\o !Lù�\áÏý¯Ðk½­Vx(u{Ò#v\ó™õ<‹JøÞÓÅ{m<ö§Løg+Z·ü-ž(á€ó’”Ϻ—ù‚_]3t­ý ¢ðo‚ \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/be/2fae887ee7ecd2d1e6371af1a865c17414bde9 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/be/2fae887ee7ecd2d1e6371af1a865c17414bde9 new file mode 100644 index 0000000..5985521 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/be/2fae887ee7ecd2d1e6371af1a865c17414bde9 @@ -0,0 +1 @@ +x¥ŽAn1 EYçÞ£¢1N2Œ„*Ü¡kÇvÚˆ™ JÓrýâ]¾÷¥§/uYJ‡c ]of@¢j^#“ž‚¤ƒ÷qœÐ&’ñdÂB¦ÁݹÙÚa[MrDœèD(a¦ØÛ8L)'�Èž}bÇ?ý«6¸òoÑ·�šZ•œõ‰‡Ç /Ÿ —ù uyߺ ½#ì·Ùíh·$ÜÕfë¹Ì¼*”õÛZ‡Õî7zRY \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e0/00041da0b7dc84cb17be523882c118641b72b5 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e0/00041da0b7dc84cb17be523882c118641b72b5 new file mode 100644 index 0000000..0363066 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e0/00041da0b7dc84cb17be523882c118641b72b5 @@ -0,0 +1,2 @@ +xm�AkÃ0 …wö¯>µÐÅt ƒíJÇÖÚ±câÄJêb[ÁVÛíß/I[èa'!žô¾'•ŽJx|xº“RŠïÍb …Ú6PSgcÌçm¤=V —š ±dÀŸ–&àÂyY;§K‡ hðdïÑÁQG;HA{4Pºm�­4[ +EÑù½uDOÁ†î(tæ6AmN !Šs›ž•2T¥Ììuhèš©"¯0¨i6�ª�˜”ÁÖѯÇÀꔫD¦°¾¥È@Iˆ:’‡³KVuð¬ƒË@ƒœ÷}~UJ†£�²„l°ÖÇ#9{]-Öùf¾Ý.W‹Mþ¹ž}}Ìåäð?ƒMîm‡Ó®íM؆&ɱ7 x�ÿø£±ø°è™ž \ No newline at end of file diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e4/9014e99d282c96e97490f64f13dba56637acc3 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e4/9014e99d282c96e97490f64f13dba56637acc3 new file mode 100644 index 0000000..2b34cf3 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e4/9014e99d282c96e97490f64f13dba56637acc3 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 new file mode 100644 index 0000000..7112238 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/f2/5c8d6c97ee9f2aa3ebc1884e9d374e2a93f8e7 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/f2/5c8d6c97ee9f2aa3ebc1884e9d374e2a93f8e7 new file mode 100644 index 0000000..f7e0d74 Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/f2/5c8d6c97ee9f2aa3ebc1884e9d374e2a93f8e7 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/f7/9f238852ec7cd7b9a3cc7f6b9b5324d380ae8b b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/f7/9f238852ec7cd7b9a3cc7f6b9b5324d380ae8b new file mode 100644 index 0000000..2b45f0b Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/f7/9f238852ec7cd7b9a3cc7f6b9b5324d380ae8b differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/fb/cc4dab70fb36389f806bb72fd5056f5034f572 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/fb/cc4dab70fb36389f806bb72fd5056f5034f572 new file mode 100644 index 0000000..5807b0b Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/fb/cc4dab70fb36389f806bb72fd5056f5034f572 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/objects/fc/04070e8336f17e3b2402586653623e6bb51f67 b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/fc/04070e8336f17e3b2402586653623e6bb51f67 new file mode 100644 index 0000000..a0339be Binary files /dev/null and b/tests/test_project_fixtures/test_deleted_migration_project/git/objects/fc/04070e8336f17e3b2402586653623e6bb51f67 differ diff --git a/tests/test_project_fixtures/test_deleted_migration_project/git/refs/heads/master b/tests/test_project_fixtures/test_deleted_migration_project/git/refs/heads/master new file mode 100644 index 0000000..c422dbc --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/git/refs/heads/master @@ -0,0 +1 @@ +4bdc4ba9e7695893423be1b54f3101d6ccbd11c7 diff --git a/tests/test_project_fixtures/test_deleted_migration_project/manage.py b/tests/test_project_fixtures/test_deleted_migration_project/manage.py new file mode 100644 index 0000000..3a629de --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_deleted_migration_project.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/__init__.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/admin.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/apps.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/apps.py new file mode 100644 index 0000000..fc04070 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_app/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class TestAppConfig(AppConfig): + name = 'test_app' diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/0001_initial.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/0001_initial.py new file mode 100644 index 0000000..2bdf337 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/0001_initial.py @@ -0,0 +1,21 @@ +# Generated by Django 2.0.1 on 2018-01-18 22:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='A', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('null_field', models.IntegerField(null=True)), + ], + ), + ] diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/0003_new_nullable_field.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/0003_new_nullable_field.py new file mode 100644 index 0000000..fbcc4da --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/0003_new_nullable_field.py @@ -0,0 +1,15 @@ +from django.db import migrations +from django.db import models + + +class Migration(migrations.Migration): + + dependencies = [('test_app', '0001_initial'),] + + operations = [ + migrations.AddField( + model_name='a', + name='new_char_nullable_test_field', + field=models.CharField(max_length=30, null=True), + ), + ] diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/__init__.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/models.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/models.py new file mode 100644 index 0000000..4b330bb --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_app/models.py @@ -0,0 +1,6 @@ +from django.db import models + +class A(models.Model): + null_field = models.IntegerField(null=True) + new_not_null_field = models.IntegerField(null=False) + new_char_nullable_test_field = models.CharField(max_length=30, null=True) diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/tests.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_app/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_app/views.py b/tests/test_project_fixtures/test_deleted_migration_project/test_app/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_app/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/__init__.py b/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/settings.py b/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/settings.py new file mode 100644 index 0000000..94bfbb7 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/settings.py @@ -0,0 +1,120 @@ +""" +Django settings for test_deleted_migration_project project. + +Generated by 'django-admin startproject' using Django 1.11.6. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'gtb+mohs%gf0+#fr89vw7e&#edmv=q8!iv+n&j_soawk$tkj3^' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'test_app' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'test_deleted_migration_project.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'test_deleted_migration_project.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django_fake_database_backends.backends.mysql', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/urls.py b/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/urls.py new file mode 100644 index 0000000..735de5d --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/urls.py @@ -0,0 +1,21 @@ +"""linter_test_project URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.11/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url +from django.contrib import admin + +urlpatterns = [ + url(r'^admin/', admin.site.urls), +] diff --git a/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/wsgi.py b/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/wsgi.py new file mode 100644 index 0000000..e000041 --- /dev/null +++ b/tests/test_project_fixtures/test_deleted_migration_project/test_deleted_migration_project/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for linter_test_project project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_deleted_migration_project.settings") + +application = get_wsgi_application() diff --git a/tests/test_project_fixtures/test_project_alter_column/.gitignore b/tests/test_project_fixtures/test_project_alter_column/.gitignore new file mode 100644 index 0000000..63973d0 --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/.gitignore @@ -0,0 +1,3 @@ +*.pyc +__pycache__/ +*sqlite3 diff --git a/tests/test_project_fixtures/test_project_alter_column/manage.py b/tests/test_project_fixtures/test_project_alter_column/manage.py new file mode 100644 index 0000000..c1ee174 --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project_alter_column.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/__init__.py b/tests/test_project_fixtures/test_project_alter_column/test_app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/admin.py b/tests/test_project_fixtures/test_project_alter_column/test_app/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/apps.py b/tests/test_project_fixtures/test_project_alter_column/test_app/apps.py new file mode 100644 index 0000000..fc04070 --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_app/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class TestAppConfig(AppConfig): + name = 'test_app' diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/0001_initial.py b/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/0001_initial.py new file mode 100644 index 0000000..faf8b51 --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/0001_initial.py @@ -0,0 +1,21 @@ +# Generated by Django 2.0.1 on 2018-01-14 12:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='A', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('code', models.CharField(max_length=10, null=True)), + ], + ), + ] diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/0002_alter_column.py b/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/0002_alter_column.py new file mode 100644 index 0000000..4292dd0 --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/0002_alter_column.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.1 on 2018-01-14 12:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('test_app', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='a', + name='code', + field=models.IntegerField(null=True), + ), + ] diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/__init__.py b/tests/test_project_fixtures/test_project_alter_column/test_app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/models.py b/tests/test_project_fixtures/test_project_alter_column/test_app/models.py new file mode 100644 index 0000000..d4b75cf --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_app/models.py @@ -0,0 +1,4 @@ +from django.db import models + +class A(models.Model): + code = models.IntegerField(null=True) diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/tests.py b/tests/test_project_fixtures/test_project_alter_column/test_app/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_app/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/tests/test_project_fixtures/test_project_alter_column/test_app/views.py b/tests/test_project_fixtures/test_project_alter_column/test_app/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_app/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/__init__.py b/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/settings.py b/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/settings.py new file mode 100644 index 0000000..7d04288 --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/settings.py @@ -0,0 +1,120 @@ +""" +Django settings for test_project_alter_column project. + +Generated by 'django-admin startproject' using Django 1.11.6. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'gtb+mohs%gf0+#fr89vw7e&#edmv=q8!iv+n&j_soawk$tkj3^' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'test_app' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'test_project_alter_column.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'test_project_alter_column.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django_fake_database_backends.backends.mysql' + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/urls.py b/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/urls.py new file mode 100644 index 0000000..735de5d --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/urls.py @@ -0,0 +1,21 @@ +"""linter_test_project URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.11/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url +from django.contrib import admin + +urlpatterns = [ + url(r'^admin/', admin.site.urls), +] diff --git a/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/wsgi.py b/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/wsgi.py new file mode 100644 index 0000000..749e98c --- /dev/null +++ b/tests/test_project_fixtures/test_project_alter_column/test_project_alter_column/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for linter_test_project project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project_alter_column.settings") + +application = get_wsgi_application() diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/applypatch-msg.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/applypatch-msg.sample deleted file mode 100644 index 8b2a2fe..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -test -x "$GIT_DIR/hooks/commit-msg" && - exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} -: diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/commit-msg.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/commit-msg.sample deleted file mode 100644 index b58d118..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/post-update.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/post-update.sample deleted file mode 100644 index ec17ec1..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-applypatch.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-applypatch.sample deleted file mode 100644 index b1f187c..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} -: diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-commit.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-commit.sample deleted file mode 100644 index 68d62d5..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-push.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-push.sample deleted file mode 100644 index 1f3bceb..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-push.sample +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -z40=0000000000000000000000000000000000000000 - -IFS=' ' -while read local_ref local_sha remote_ref remote_sha -do - if [ "$local_sha" = $z40 ] - then - # Handle delete - : - else - if [ "$remote_sha" = $z40 ] - then - # New branch, examine all commits - range="$local_sha" - else - # Update to existing branch, examine new commits - range="$remote_sha..$local_sha" - fi - - # Check for WIP commit - commit=`git rev-list -n 1 --grep '^WIP' "$range"` - if [ -n "$commit" ] - then - echo "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-rebase.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-rebase.sample deleted file mode 100644 index 33730ca..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up-to-date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/prepare-commit-msg.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/prepare-commit-msg.sample deleted file mode 100644 index f093a02..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/prepare-commit-msg.sample +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first comments out the -# "Conflicts:" part of a merge commit. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -case "$2,$3" in - merge,) - /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; - -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$1" ;; - - *) ;; -esac - -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/update.sample b/tests/test_project_fixtures/test_project_multi_commit/git/hooks/update.sample deleted file mode 100644 index d847583..0000000 --- a/tests/test_project_fixtures/test_project_multi_commit/git/hooks/update.sample +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -# -# An example hook script to blocks unannotated tags from entering. -# Called by "git receive-pack" with arguments: refname sha1-old sha1-new -# -# To enable this hook, rename this file to "update". -# -# Config -# ------ -# hooks.allowunannotated -# This boolean sets whether unannotated tags will be allowed into the -# repository. By default they won't be. -# hooks.allowdeletetag -# This boolean sets whether deleting tags will be allowed in the -# repository. By default they won't be. -# hooks.allowmodifytag -# This boolean sets whether a tag may be modified after creation. By default -# it won't be. -# hooks.allowdeletebranch -# This boolean sets whether deleting branches will be allowed in the -# repository. By default they won't be. -# hooks.denycreatebranch -# This boolean sets whether remotely creating branches will be denied -# in the repository. By default this is allowed. -# - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --bool hooks.allowunannotated) -allowdeletebranch=$(git config --bool hooks.allowdeletebranch) -denycreatebranch=$(git config --bool hooks.denycreatebranch) -allowdeletetag=$(git config --bool hooks.allowdeletetag) -allowmodifytag=$(git config --bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" -if [ "$newrev" = "$zero" ]; then - newrev_type=delete -else - newrev_type=$(git cat-file -t $newrev) -fi - -case "$refname","$newrev_type" in - refs/tags/*,commit) - # un-annotated tag - short_refname=${refname##refs/tags/} - if [ "$allowunannotated" != "true" ]; then - echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/tests/test_project_fixtures/test_project_rename_table/test_project_rename_table/wsgi.py b/tests/test_project_fixtures/test_project_rename_table/test_project_rename_table/wsgi.py index 6741b31..96d3e60 100644 --- a/tests/test_project_fixtures/test_project_rename_table/test_project_rename_table/wsgi.py +++ b/tests/test_project_fixtures/test_project_rename_table/test_project_rename_table/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project_add_not_null_column.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project_rename_table.settings") application = get_wsgi_application()