sapling/tests/test-inotify.out
Nicolas Dumazet 2645ee079e inotify: fix issue1375, add a test.
The biggest problem was the data structure, which did not allow changing
a file into a directory or vice versa. This problem is fixed by 47d29dcb7266.

The walk() method also had an issue in this case:
 - we know 'path' as a directory. inotify server sleeps.
 - 'path' is deleted
 - 'path' is recreated as a file
 - the server catches up here, and see the deletion. it instantiates a scan(),
   which in its turn calls for walk(repo, path).
 - walk() then assumes that 'path' is a directory and calls os.listdir on it,
   which raises an OSError(errno.ENOTDIR)

Catch the error, and yield the file instead of the directory contents.
2009-07-13 16:49:05 +02:00

47 lines
498 B
Plaintext

adding a
adding b
adding c
adding d
adding dir/bar/foo
adding dir/x
adding dir/y
adding e
% inserve
? hg.pid
% clean
C a
C b
C c
C d
C dir/bar/foo
C dir/x
C dir/y
C e
% all
? hg.pid
C a
C b
C c
C d
C dir/bar/foo
C dir/x
C dir/y
C e
% path patterns
M dir/x
? hg.pid
M dir/x
M x
% issue 1375
adding h/h
adding hg.pid
removing h/h
A h
R h/h
M a
merging a
1 files updated, 1 files merged, 2 files removed, 0 files unresolved
M a
3 files updated, 1 files merged, 0 files removed, 0 files unresolved
M a