*  @param ns a list of namespaces to filter by, empty = all namespaces.
     *  @return list of changes to watched pages and their talk pages
     *  @throws IOException if a network error occurs
     *  @throws CredentialNotFoundException if not logged in
     *  @since 0.27
     */
    public Wiki.Revision[] watchlist(boolean allrev, int... ns) throws IOException, CredentialNotFoundException
    {
        if (user == null)
            throw new CredentialNotFoundException("Not logged in");
        StringBuilder url = new StringBuilder(query);
        url.append("list=watchlist&wlprop=ids%7Ctitle%7Ctimestamp%7Cuser%7Ccomment%7Csizes&wllimit=max");
        if (allrev)
            url.append("&wlallrev=true");
        constructNamespaceString(url, "wl", ns);
        
        ArrayList<Wiki.Revision> wl = new ArrayList<Wiki.Revision>(667);
        String wlstart = "";
        do
        {
            String line = fetch(url.toString() + "&wlstart=" + wlstart, "watchlist");
            if (line.contains("wlstart"))
                wlstart = parseAttribute(line, "wlstart", 0);
            else
                wlstart = null;
            // xml form: <item pageid="16396" revid="176417" ns="0" title="API:Query - Lists" />
            for (int i = line.indexOf("<item "); i > 0; i = line.indexOf("<item ", ++i))
            {
                int j = line.indexOf("/>", i);
                wl.add(parseRevision(line.substring(i, j), ""));
            }
        }
        while(wlstart != null);
        int size = wl.size();
        log(Level.INFO, "Successfully retrieved watchlist (" + size + " items)", "watchlist");
        return wl.toArray(new Wiki.Revision[size]);
    }