[PATCH 10 of 10] repair: clean up stale lock file from store backup
raf at durin42.com
Mon Nov 21 17:10:17 EST 2016
On Sat, Nov 05, 2016 at 09:40:26PM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1478392394 25200
> # Sat Nov 05 17:33:14 2016 -0700
> # Node ID 0e130e8d2156d9f2523c711ef4fefe4ba33e6818
> # Parent 3d4dd237b705479f8c7475b821ae719893381fa8
> repair: clean up stale lock file from store backup
I've sent some nits on this series, but overall it looks good to
me. Please get an ack from Pierre-yves that he's had a chance to scan
things before doing a resend though, as I suspect he'll catch
important things I'll miss.
> So inline comment for reasons.
> diff --git a/mercurial/repair.py b/mercurial/repair.py
> --- a/mercurial/repair.py
> +++ b/mercurial/repair.py
> @@ -716,6 +716,12 @@ def _upgraderepo(ui, srcrepo, dstrepo, r
> ui.write(_('store replacement complete; repository was inconsistent for '
> '%0.1fs\n') % elapsed)
> + # The lock file from the old store won't be removed because nothing has a
> + # reference to its new location. So clean it up manually. Alternatively, we
> + # could update srcrepo.svfs and other variables to point to the new
> + # location. This is simpler.
> + backupvfs.unlink('store/lock')
> def upgraderepo(ui, repo, dryrun=False):
> """Upgrade a repository in place."""
> # Avoid cycle: cmdutil -> repair -> localrepo -> cmdutil
> diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
> --- a/tests/test-upgrade-repo.t
> +++ b/tests/test-upgrade-repo.t
> @@ -209,7 +209,6 @@ old store should be backed up
> - lock
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
More information about the Mercurial-devel