sapling/tests/test-dirstate-rebuild.t
Jun Wu 16ae892817 debugrebuilddirstate: setparent early
Summary:
The old code was counting on `dirstate.rebuild` to setparent. However, that
could be too late.

Namely, the sparse extension would expect dirstate p1 to be available to load
the correct sparse profile. So let's set dirstate parent early before calling
dirstate rebuild.

Reviewed By: DurhamG

Differential Revision: D9375196

fbshipit-source-id: baed4a5ab329344ff3bb0b323046b05aece65f53
2018-08-17 11:38:26 -07:00

36 lines
596 B
Perl

$ shorttraceback
$ newrepo
$ drawdag << 'EOS'
> B
> |
> A
> EOS
$ hg up -q $B
Dirstate rebuild should work with a broken dirstate
Broken by having an incomplete p2
$ enable blackbox
>>> open('.hg/dirstate', 'a').truncate(25)
$ hg debugrebuilddirstate
$ hg log -r . -T '{desc}\n'
B
Broken by deleting the tree
$ rm -rf .hg/treestate
$ hg debugrebuilddirstate
$ hg log -r . -T '{desc}\n'
B
Dirstate rebuild should work with sparse
$ enable sparse
$ hg sparse -I A
$ rm .hg/dirstate
$ hg debugrebuilddirstate -r $B
$ hg log -r . -T '{desc}\n'
B