dirstate: fix rebuild; add a test
If rebuild calls invalidate, it will just queue a (re)read of the dirstate
file, while what we really want is to empty the current state.
#header#
<title>Mercurial repositories index</title>
</head>
<body>
<h2>Mercurial Repositories</h2>
The specified repository "#repo|escape#" is unknown, sorry.
Please go back to the main repository list page.
#footer#