Commits

Anonymous committed 5d1084c

work around test-purge

Comments (0)

Files changed (5)

hg-mv-Af

-# HG changeset patch
-# User Nicolas Dumazet <nicdumz.commits@gmail.com>
-# Date 1260943570 -32400
-
-move committed files -Af?
-
-
-diff --git a/tests/test-inotify b/tests/test-inotify
---- a/tests/test-inotify
-+++ b/tests/test-inotify
-@@ -88,6 +88,11 @@
- HGMERGE=internal:local hg up
- hg st
- 
-+hg rev --no-backup -qa
-+echo % mv -Af committed1 committed2
-+hg mv -Af c d
-+hg st
-+
- # Test for 1844: "hg ci folder" will not commit all changes beneath "folder"
- mkdir 1844
- echo a > 1844/foo
+# HG changeset patch
+# User Nicolas Dumazet <nicdumz.commits@gmail.com>
+# Date 1260949337 -32400
+
+diff --git a/hgext/inotify/linuxserver.py b/hgext/inotify/linuxserver.py
+--- a/hgext/inotify/linuxserver.py
++++ b/hgext/inotify/linuxserver.py
+@@ -285,6 +285,7 @@
+ 
+         if evt.mask & inotify.IN_ISDIR:
+             self.scan(wpath)
++            d = self.tree.dir(wpath)
+         else:
+             self.created(wpath)
+ 
+@@ -298,6 +299,9 @@
+             todelete = [wfn for wfn, ignore in tree.walk('?')]
+             for fn in todelete:
+                 self.deletefile(fn, '?')
++
++            self.tree.delete(wpath)
++            self.statustrees['?'].delete(wpath)
+             self.scan(wpath)
+         else:
+             self.deleted(wpath)
+diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py
+--- a/hgext/inotify/server.py
++++ b/hgext/inotify/server.py
+@@ -92,6 +92,22 @@
+         self.files = {}
+         self.dirs = {}
+ 
++    def delete(self, relpath):
++        if not relpath:
++            return
++
++        paths = relpath.split('/')
++        last = paths.pop()
++
++        tree = self
++        try:
++            for dir in paths:
++                tree = tree.dirs[dir]
++            del tree.dirs[last]
++        except KeyError:
++            # path is not tracked
++            return
++
+     def dir(self, relpath):
+         """
+         Returns the directory contained at the relative path relpath.
+@@ -384,6 +400,7 @@
+                     for f in tree.lookup(states, fn, visited):
+                         yield f
+ 
++        list(genresult('', self.repowatcher.tree))
+         return ['\0'.join(r) for r in [
+             genresult('l', self.repowatcher.statustrees['l']),
+             genresult('m', self.repowatcher.statustrees['m']),

inotify-global-dir-visit

+diff --git a/hgext/inotify/client.py b/hgext/inotify/client.py
+--- a/hgext/inotify/client.py
++++ b/hgext/inotify/client.py
+@@ -153,12 +153,11 @@
+             return []
+         results = map(readnames, resphdr[:-1])
+ 
+-        if names:
+-            nbytes = resphdr[-1]
+-            vdirs = cs.read(nbytes)
+-            if vdirs:
+-                for vdir in vdirs.split('\0'):
+-                    match.dir(vdir)
++        nbytes = resphdr[-1]
++        vdirs = cs.read(nbytes)
++        if vdirs:
++            for vdir in vdirs.split('\0'):
++                match.dir(vdir)
+ 
+         return results
+ 
+diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py
+--- a/hgext/inotify/server.py
++++ b/hgext/inotify/server.py
+@@ -123,7 +123,7 @@
+         for dir in self.dirs.itervalues():
+             if visited is not None:
+                 visited.add(dir.path)
+-            for e in dir.walk(states):
++            for e in dir.walk(states, visited):
+                 yield e
+ 
+     def lookup(self, states, path, visited):
+@@ -375,8 +375,9 @@
+         visited = set()
+         if not names:
+             def genresult(states, tree):
+-                for fn, state in tree.walk(states):
++                for fn, state in tree.walk(states, visited):
+                     yield fn
++
+         else:
+             def genresult(states, tree):
+                 for fn in names:
+# HG changeset patch
+# User Nicolas Dumazet <nicdumz.commits@gmail.com>
+# Date 1260943570 -32400
+
+move committed files -Af?
+
+diff --git a/tests/test-inotify b/tests/test-inotify
+--- a/tests/test-inotify
++++ b/tests/test-inotify
+@@ -88,6 +88,14 @@
+ HGMERGE=internal:local hg up
+ hg st
+ 
++hg rev --no-backup -qa
++echo % cp -Af committed1 committed2
++hg cp -Af c e
++hg st
++echo % mv -Af committed1 committed2
++hg mv -Af c d
++hg st
++
+ # Test for 1844: "hg ci folder" will not commit all changes beneath "folder"
+ mkdir 1844
+ echo a > 1844/foo
-bisect
 graphlimit
+iterators
 loglimit
-iterators
-addbug
-subversionexception
 symlink-basic
 dirstate-stat
 inotify-test-permissions
 debug
-hg-mv-Af
+inotify-global-dir-visit
+inot-track-dirs
+mv-cp-Af
+bisect
+subversionexception
+addbug
 no-match-under
 matching
 inotify-moverepo