Issue1719

Title inotify: hg qpush reports local changes if patch contains new or deleted file
Priority bug Status resolved
Superseder inotify uses dirstate data when it's dirty
View: 1811
Nosy List a7x, djc, nicdumz
Assigned To Topics inotify

Created on 2009-07-01.21:40:06 by a7x, last changed 2009-08-24.18:07:40 by nicdumz.

Files
File name Uploaded Type Edit Remove
test-inotify-issue1719 nicdumz, 2009-07-02.07:09:57 text/plain
test-inotify-issue1719.out nicdumz, 2009-07-02.07:13:04 text/plain
Messages
msg10420 (view) Author: nicdumz Date: 2009-08-24.18:07:40
closing this to use the superseding issue1811
msg9899 (view) Author: nicdumz Date: 2009-07-04.10:16:33
In fact the behavior of inotify for the last status call is correct, but the
dirstate is corrupted and feeding inotify wrong information:

$ hg init t
$ cd t
$ echo content > file
$ hg add file
$ hg qnew -f test.patch
$ hg status
$ hg qapplied
test.patch
$ hg qpop
patch queue now empty
$ hg status
$ hg qpush
applying test.patch
now at: test.patch
$ hg debugstate
a   0         -1 unset               file

Without inotify, debugstate outputs a "n" status for file instead of "a"

Most likely, this dirstate corruption is caused in the first place by a status()
call emanating from mq, getting wrongly answered by inotify. and mq then
restores wrong dirstate information when qpushing?

nose-ing djc: can you help me understanding _when_ mq would modify the dirstate
to add a file, and using which information?
msg9866 (view) Author: a7x Date: 2009-07-02.10:32:27
Removing a file is also a problem:

$ hg init t
$ cd t
$ echo content > file
$ hg add file
$ hg commit -m "added file"
$ hg rm file
$ hg status
R file
$ hg qnew -f remove_file.patch
$ hg status
$ hg qpop
patch queue now empty
$ hg status
$ hg qpush
applying remove_file.patch
now at: remove_file.patch
$ hg status
R file
msg9851 (view) Author: nicdumz Date: 2009-07-02.07:13:04
adding the corresponding (passing) test output :)
msg9850 (view) Author: nicdumz Date: 2009-07-02.07:09:57
confirmed. Uploading a test file. 

The problem is quite simple:

* inotify listens for changes.
* after a qpush, it sees that a file is created in the repository
* inotify then checks the dirstate, and notices that the file is registered in
the dirstate.
* inotify then infers that the file was created by the user, and added to the
dirstate. Hence the 'A file' output on hg status.
msg9844 (view) Author: a7x Date: 2009-07-01.21:59:28
Looks like this is actually an inotify bug -- I turned off inotify and it seems
to work OK.
msg9843 (view) Author: a7x Date: 2009-07-01.21:46:57
I forgot to mention:  I'm running a snapshot from the main development
repository, changeset 8979:09c6735e3880 (installed via the Ubuntu snapshot PPA).
msg9841 (view) Author: a7x Date: 2009-07-01.21:40:06
$ hg init t
$ cd t
$ echo content > file
$ hg add file
$ hg qnew -f test.patch
$ hg status
$ cat .hg/patches/test.patch
diff --git a/file b/file
new file mode 100644
--- /dev/null
+++ b/file
@@ -0,0 +1,1 @@
+content
$ hg qapplied
test.patch
$ hg qpop
patch queue now empty
$ hg status
$ hg qpush
applying test.patch
now at: test.patch
$ hg status
A file
$ cat .hg/patches/test.patch
diff --git a/file b/file
new file mode 100644
--- /dev/null
+++ b/file
@@ -0,0 +1,1 @@
+content
$ hg qrefresh
$ hg status
$ cat .hg/patches/test.patch
diff --git a/file b/file
new file mode 100644
--- /dev/null
+++ b/file
@@ -0,0 +1,1 @@
+content
History
Date User Action Args
2009-10-14 05:32:10nicdumzlinkissue1865 superseder
2009-08-24 18:07:40nicdumzsetstatus: chatting -> resolved
nosy: djc, nicdumz, a7x
superseder: + inotify uses dirstate data when it's dirty
messages: + msg10420
2009-08-14 07:36:43simohelinkissue1795 superseder
2009-07-04 10:16:33nicdumzsetnosy: + djc
messages: + msg9899
2009-07-02 10:32:27a7xsetnosy: nicdumz, a7x
messages: + msg9866
2009-07-02 07:13:04nicdumzsetfiles: + test-inotify-issue1719.out
nosy: nicdumz, a7x
messages: + msg9851
2009-07-02 07:09:57nicdumzsetfiles: + test-inotify-issue1719
nosy: + nicdumz
messages: + msg9850
2009-07-01 21:59:29a7xsettopic: + inotify, - mq
messages: + msg9844
title: mq: qpush leaves local changes if patch contains new or deleted file -> inotify: hg qpush reports local changes if patch contains new or deleted file
2009-07-01 21:46:57a7xsetstatus: unread -> chatting
messages: + msg9843
2009-07-01 21:40:06a7xcreate