diff options
| author | Chris Bainbridge <chris.bainbridge@gmail.com> | 2015-05-29 16:32:57 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-07-07 12:23:04 -0400 |
| commit | e5cfa394d79b6ab1b412bd3b30c6a433b415d56b (patch) | |
| tree | f9f2ae532d77dc27bf3c082300afe0a664eeaec1 /django/utils | |
| parent | 13dca01af02e91f25ae1d96b09b857993714c96d (diff) | |
Refs #23882 -- Added detection for moved files when using inotify polling
Commit 15f82c7 ("used pyinotify as change detection system when
available") introduced a regression where editing a file in vim with
default settings (writebackup=auto) no longer causes the dev server
to be restarted. On a write, vim moves the monitored file to a backup
path and then creates a new file in the original. The new file is not
monitored as it has a different inode. Fixed this by also watching for
inotify events IN_DELETE_SELF and IN_MOVE_SELF.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/autoreload.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index f4ac4977f7..6efd6c4f58 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -175,7 +175,9 @@ def inotify_code_changed(): pyinotify.IN_ATTRIB | pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO | - pyinotify.IN_CREATE + pyinotify.IN_CREATE | + pyinotify.IN_DELETE_SELF | + pyinotify.IN_MOVE_SELF ) for path in gen_filenames(only_new=True): wm.add_watch(path, mask) |
