sapling/eden/scm/tests/test-dirstate-rebuild.t
Jun Wu 368d59e436 revset: attempt to pull the revset expression as a single name
Summary:
For names like `a-b-c`, it can be parsed in multiple ways:

- `"a-b-c"`
- `"a-b" - "c"`
- `"a" - "b-c"`

Mercurial uses `repo.lookup` in the parser to accept names like `"a-b-c"`.
Do it for the whole revset expression too.

But do not do it for every lookup (ex. testing `"a-b"` or `"b-c"` in the above
case), because that can be exceedingly expensive.

Reviewed By: DurhamG

Differential Revision: D20831014

fbshipit-source-id: f507e04ce24c953b096ccd836c356f50f11d2006
2020-04-24 11:16:22 -07:00

42 lines
824 B
Perl

#chg-compatible
$ 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
# Assign to 'x' to hide the return value output in Python 3
>>> x = 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
warning: failed to inspect working copy parent
warning: failed to inspect working copy parent
warning: failed to inspect working copy parent
$ 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