If the user explicitly mentioned that they don't need backup, then let's not
create it.
Details
- Reviewers
mharbison72 - Group Reviewers
hg-reviewers - Commits
- rHG2e8a844d0ae0: upgrade: don't create store backup if `--no-backup` is passed
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
mercurial/upgrade_utils/engine.py | ||
---|---|---|
417 | This change makes the repository inconsistent for longer than before. With the old code, we performed 2 atomic directory renames, which likely completely ~instantaneously, leaving the repository inconsistent for a short window. With this new code path, we perform the equivalent of rm -rf on store/ then perform an atomic rename of the new store to the proper path. The problem with the new code path is that the recursive delete can take seconds to perform, leaving the repository inconsistent for that duration. A better solution would be to rename the old store directory, swap in the new store (the old code path), then perform the rmtree() after the new store is installed. |
mercurial/upgrade_utils/engine.py | ||
---|---|---|
417 | TBH, I am on edge that whether having store inconsistent for less time is helping us or preventing faster upgrades. Not talking about this specific patch but an attempt at a different thing that received a similar objection: https://phab.mercurial-scm.org/D9677 As far as this patch is concerned, actually, we used the better solution before and I undid it in this patch. Feel free to revert it as I don't feel strongly about it. |
This change makes the repository inconsistent for longer than before.
With the old code, we performed 2 atomic directory renames, which likely completely ~instantaneously, leaving the repository inconsistent for a short window.
With this new code path, we perform the equivalent of rm -rf on store/ then perform an atomic rename of the new store to the proper path.
The problem with the new code path is that the recursive delete can take seconds to perform, leaving the repository inconsistent for that duration.
A better solution would be to rename the old store directory, swap in the new store (the old code path), then perform the rmtree() after the new store is installed.