sapling/eden/scm/tests/test-debugrebuilddirstate-corrupt.t
Durham Goode 9d09b429f0 py3: migrate treedirstate to use utf8 for state and files
Summary:
treedirstate was using bytes for state and for file paths. This does
the appropriate conversions. Note, I don't use strings for all state in rust,
because it's a pain in the butt in some places. We're going to delete
treedirstate eventually anyone, so just I'm getting the test to pass for now.

Reviewed By: quark-zju

Differential Revision: D19715102

fbshipit-source-id: 4f9eac372bee7884d36aa19e3a3ed253392fa7dd
2020-02-17 14:52:29 -08:00

27 lines
493 B
Perl

#chg-compatible
#chg-compatible
#testcases treestate-on treestate-off
#if treestate-on
$ setconfig format.dirstate=2
#else
$ setconfig format.dirstate=1
#endif
Setup
$ hg init repo
$ cd repo
$ echo base > base
$ hg add base
$ hg commit -m "base"
Deliberately corrupt the dirstate.
$ dd if=/dev/zero bs=4096 count=1 of=.hg/dirstate 2> /dev/null
$ hg debugrebuilddirstate
warning: failed to inspect working copy parent
warning: failed to inspect working copy parent