[Updated] D11839: rhg: Add Repo::write_dirstate

SimonSapin phabricator at mercurial-scm.org
Tue Dec 7 09:06:13 UTC 2021


SimonSapin added inline comments.

INLINE COMMENTS

> Alphare wrote in repo.rs:445
> This should support `HGTEST_UUIDFILE` (see `mercurial/revlogutils/docket.py`) otherwise some tests will end up failing. Possibly this chould just be a TODO, but I'd rather at least detect the env variable and print a warning to stderr that its support isn't implemented, so that it's more obvious down the line.

https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/271544 shows that no test fail because of this.

As far as I understand, this point of `HGTEST_UUIDFILE` is to have deterministic data filenames for nodemap dockets so it’s less annoying to add glob patterns everywhere in expected test ouptput what it includes these names. But this new Rust code is only used to generate dirstate data filenames which are not printed in tests.

To port the current exact behavior of `docket.py` we’d need to have the same PRNG algorithm as Python’s `random.Random()`. Instead we could probably change `docket.py` to use a known, fixed PRNG algorithm.

I’ll probably stick with the warning for now. By stderr do you mean literally using `std::eprintln!`, or should we start passing around a `&Ui` value everywhere?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11839/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11839

To: SimonSapin, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211207/171a99f7/attachment-0002.html>


More information about the Mercurial-patches mailing list