Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
e0910dcc
Kaydet (Commit)
e0910dcc
authored
Ara 31, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #25604 -- Removed makemigrations --exit option per deprecation timeline.
üst
ff419de2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
39 deletions
+4
-39
makemigrations.py
django/core/management/commands/makemigrations.py
+0
-17
django-admin.txt
docs/ref/django-admin.txt
+0
-6
1.8.txt
docs/releases/1.8.txt
+1
-1
2.0.txt
docs/releases/2.0.txt
+2
-0
test_commands.py
tests/migrations/test_commands.py
+1
-15
No files found.
django/core/management/commands/makemigrations.py
Dosyayı görüntüle @
e0910dcc
import
io
import
os
import
sys
import
warnings
from
itertools
import
takewhile
from
django.apps
import
apps
...
...
@@ -18,7 +17,6 @@ from django.db.migrations.questioner import (
from
django.db.migrations.state
import
ProjectState
from
django.db.migrations.utils
import
get_migration_name_timestamp
from
django.db.migrations.writer
import
MigrationWriter
from
django.utils.deprecation
import
RemovedInDjango20Warning
from
django.utils.six
import
iteritems
from
django.utils.six.moves
import
zip
...
...
@@ -52,11 +50,6 @@ class Command(BaseCommand):
'-n'
,
'--name'
,
action
=
'store'
,
dest
=
'name'
,
default
=
None
,
help
=
"Use this name for migration file(s)."
,
)
parser
.
add_argument
(
'-e'
,
'--exit'
,
action
=
'store_true'
,
dest
=
'exit_code'
,
default
=
False
,
help
=
'Exit with error code 1 if no changes needing migrations are found. '
'Deprecated, use the --check option instead.'
,
)
parser
.
add_argument
(
'--check'
,
action
=
'store_true'
,
dest
=
'check_changes'
,
help
=
'Exit with a non-zero status if model changes are missing migrations.'
,
...
...
@@ -69,15 +62,8 @@ class Command(BaseCommand):
self
.
merge
=
options
[
'merge'
]
self
.
empty
=
options
[
'empty'
]
self
.
migration_name
=
options
[
'name'
]
self
.
exit_code
=
options
[
'exit_code'
]
check_changes
=
options
[
'check_changes'
]
if
self
.
exit_code
:
warnings
.
warn
(
"The --exit option is deprecated in favor of the --check option."
,
RemovedInDjango20Warning
)
# Make sure the app they asked for exists
app_labels
=
set
(
app_labels
)
bad_app_labels
=
set
()
...
...
@@ -186,9 +172,6 @@ class Command(BaseCommand):
self
.
stdout
.
write
(
"No changes detected in apps '
%
s'"
%
(
"', '"
.
join
(
app_labels
)))
else
:
self
.
stdout
.
write
(
"No changes detected"
)
if
self
.
exit_code
:
sys
.
exit
(
1
)
else
:
self
.
write_migration_files
(
changes
)
if
check_changes
:
...
...
docs/ref/django-admin.txt
Dosyayı görüntüle @
e0910dcc
...
...
@@ -704,12 +704,6 @@ Enables fixing of migration conflicts.
Allows naming the generated migration(s) instead of using a generated name.
.. django-admin-option:: --exit, -e
.. deprecated:: 1.10
Use the ``--check`` option instead.
Makes ``makemigrations`` exit with error code 1 when no migrations are created
(or would have been created, if combined with ``--dry-run``).
...
...
docs/releases/1.8.txt
Dosyayı görüntüle @
e0910dcc
...
...
@@ -445,7 +445,7 @@ Management Commands
:setting:`FIXTURE_DIRS` contains duplicates or a default fixture directory
path (``app_name/fixtures``), an exception is raised.
* The new
:option:`makemigrations --exit
` option allows exiting with an error
* The new
``makemigrations --exit`
` option allows exiting with an error
code if no migrations are created.
* The new :djadmin:`showmigrations` command allows listing all migrations and
...
...
docs/releases/2.0.txt
Dosyayı görüntüle @
e0910dcc
...
...
@@ -319,3 +319,5 @@ these features.
* The ``django.template.loader.LoaderOrigin`` and
``django.template.base.StringOrigin`` aliases for
``django.template.base.Origin`` are removed.
* The ``makemigrations --exit`` option is removed.
tests/migrations/test_commands.py
Dosyayı görüntüle @
e0910dcc
...
...
@@ -17,9 +17,8 @@ from django.db.migrations.exceptions import (
InconsistentMigrationHistory
,
MigrationSchemaMissing
,
)
from
django.db.migrations.recorder
import
MigrationRecorder
from
django.test
import
ignore_warnings
,
mock
,
override_settings
from
django.test
import
mock
,
override_settings
from
django.utils
import
six
from
django.utils.deprecation
import
RemovedInDjango20Warning
from
django.utils.encoding
import
force_text
from
.models
import
UnicodeModel
,
UnserializableModel
...
...
@@ -1232,19 +1231,6 @@ class MakeMigrationsTests(MigrationTestBase):
self
.
assertIn
(
"dependencies=[
\n
('migrations','0001_
%
s'),
\n
]"
%
migration_name_0001
,
content
)
self
.
assertIn
(
"operations=[
\n
]"
,
content
)
@ignore_warnings
(
category
=
RemovedInDjango20Warning
)
def
test_makemigrations_exit
(
self
):
"""
makemigrations --exit should exit with sys.exit(1) when there are no
changes to an app.
"""
with
self
.
temporary_migration_module
():
call_command
(
"makemigrations"
,
"--exit"
,
"migrations"
,
verbosity
=
0
)
with
self
.
temporary_migration_module
(
module
=
"migrations.test_migrations_no_changes"
):
with
self
.
assertRaises
(
SystemExit
):
call_command
(
"makemigrations"
,
"--exit"
,
"migrations"
,
verbosity
=
0
)
def
test_makemigrations_check
(
self
):
"""
makemigrations --check should exit with a non-zero status when
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment