Mercurial > hg
diff tests/test-empty-manifest-index.t @ 48199:9d0e5629cfbf
rhg: do not fail when the repo is empty
Differential Revision: https://phab.mercurial-scm.org/D11651
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Wed, 13 Oct 2021 10:17:27 -0700 |
parents | 61ce70fd420e |
children |
line wrap: on
line diff
--- a/tests/test-empty-manifest-index.t Tue Oct 12 19:43:51 2021 +0100 +++ b/tests/test-empty-manifest-index.t Wed Oct 13 10:17:27 2021 -0700 @@ -1,23 +1,27 @@ -Create a repo such that the changelog entry refers to a null manifest node: +Test null revisions (node 0000000000000000000000000000000000000000, aka rev -1) +in various circumstances. + +Make an empty repo: $ hg init a $ cd a - $ hg log - $ touch x - $ hg add x - $ hg commit -m "init" - $ hg rm x - $ hg commit -q --amend - $ wc -c < .hg/store/00manifest.i - 0 - -Make sure that the manifest can be read (and is empty): - - $ hg --config rhg.on-unsupported=abort files -r . + $ hg files -r 0000000000000000000000000000000000000000 + [1] + $ hg files -r . [1] -Test a null changelog rev, too: +Add an empty commit (this makes the changelog refer to a null manifest node): + + + $ hg commit -m "init" --config ui.allowemptycommit=true - $ hg --config rhg.on-unsupported=abort files -r 0000000000000000000000000000000000000000 + $ hg files -r . [1] + +Strip that empty commit (this makes the changelog file empty, as opposed to missing): + + $ hg --config 'extensions.strip=' strip . > /dev/null + + $ hg files -r . + [1]