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 a
b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
a renamed from b:9a263dd772e0159ddfa70fb8a448bb6c7ec8c69f
% test with --rev
b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3