[PATCH] inotify: make inotifydirstate.status() returns a tuple of lists

Greg Ward greg-hg at gerg.ca
Tue Jul 20 13:01:53 CDT 2010


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1279648847 14400
# Branch stable
# Node ID 68a30daead3f1c40a6ce10ebb860e8572f0776aa
# Parent  0e789549271d52581c1b37e55d63e5196ad29d7e
inotify: make inotifydirstate.status() returns a tuple of lists.

This makes it consistent with dirstate.status(), which is important if
there are other extensions messing with the output of status().  Those
extensions can safely assume that dirstate.status() returns a tuple of
lists, because its docstring says it does.  But
inotifystatus.dirstate() returns a list of lists, which can break
those other extensions.

diff --git a/hgext/inotify/client.py b/hgext/inotify/client.py
--- a/hgext/inotify/client.py
+++ b/hgext/inotify/client.py
@@ -154,7 +154,7 @@
                 if names:
                     return filter(match, names.split('\0'))
             return []
-        results = map(readnames, resphdr[:-1])
+        results = tuple(map(readnames, resphdr[:-1]))
 
         if names:
             nbytes = resphdr[-1]


More information about the Mercurial-devel mailing list