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.
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
1 files, 1 changesets, 1 total revisions