# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits@gmail.com>
# Date 1251135138 -7200
# Node ID c5b873d2250ed9cea316b52fa9e52b2996dad2a7
# Parent  9482b68bcf002b0f9fcc8430ffd9680c63ad2c54
inotify: add tests for dirty dirstate issue

diff --git a/tests/test-inotify-dirty-dirstate b/tests/test-inotify-dirty-dirstate
new file mode 100755
--- /dev/null
+++ b/tests/test-inotify-dirty-dirstate
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+# issues when status queries are issued when dirstate is dirty
+
+"$TESTDIR/hghave" inotify || exit 80
+
+echo "[extensions]" >> $HGRCPATH
+echo "inotify=" >> $HGRCPATH
+echo "fetch=" >> $HGRCPATH
+
+echo % issue1801: inotify and fetch
+mkdir test; cd test
+hg init
+
+echo foo > foo
+hg add
+hg ci -m foo
+
+cd ..
+
+hg clone test test2
+cd test2
+echo bar > bar
+hg add
+hg ci -m bar
+cd ../test
+echo spam > spam
+hg add
+hg ci -m spam
+cd ../test2
+hg st
+
+# abort, outstanding changes
+hg fetch -q
+hg st
+cd ..
+
+
+echo % issue1719: inotify and mq
+
+echo "mq=" >> $HGRCPATH
+
+hg init test-1719
+cd test-1719
+
+echo % inserve
+hg inserve -d --pid-file=hg.pid
+cat hg.pid >> "$DAEMON_PIDS"
+
+echo content > file
+hg add file
+
+hg qnew -f test.patch
+
+hg status
+hg qpop
+
+echo % st should not output anything
+hg status
+
+hg qpush
+
+echo % st should not output anything
+hg status
+
+hg qrefresh
+hg status
diff --git a/tests/test-inotify-dirty-dirstate.out b/tests/test-inotify-dirty-dirstate.out
new file mode 100644
--- /dev/null
+++ b/tests/test-inotify-dirty-dirstate.out
@@ -0,0 +1,18 @@
+% issue1801: inotify and fetch
+adding foo
+updating working directory
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+adding bar
+adding spam
+% issue1719: inotify and mq
+% inserve
+? hg.pid
+popping test.patch
+patch queue now empty
+% st should not output anything
+? hg.pid
+applying test.patch
+now at: test.patch
+% st should not output anything
+? hg.pid
+? hg.pid

