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.
adding foo
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
pushing to ../2
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files