Mercurial > hg
diff tests/test-narrow-share.t @ 41298:88a7c211b21e stable
narrow: fix crash when restoring backup in legacy repo
Using --addremove when committing in an old repo (before we started
keeping .hg/narrowspec.dirstate) results in a crash. The test
case modified in this patch would crash like this:
abort: $ENOENT$
The issue is that when the dirstateguard is aborted, it tries to
restore the backup of .hg/narrowspec.dirstate. However, since we were
in an old repo, that file did not get created when the dirstateguard
was created. Note that the dirstateguard is not used unless
--addremove is passed.
This patch fixes the bug by making restorewcbackup() not fail if the
backup doesn't exist. I also made clearwcbackup() safe, just in case.
Differential Revision: https://phab.mercurial-scm.org/D5634
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 18 Jan 2019 23:32:26 -0800 |
parents | 3227923979a1 |
children | 84bd6ae2d1f6 |
line wrap: on
line diff
--- a/tests/test-narrow-share.t Fri Jan 18 14:21:47 2019 +0100 +++ b/tests/test-narrow-share.t Fri Jan 18 23:32:26 2019 -0800 @@ -166,7 +166,7 @@ R d7/f Make it look like a repo from before narrow+share was supported $ rm .hg/narrowspec.dirstate - $ hg st + $ hg ci -Am test abort: working copy's narrowspec is stale (run 'hg tracked --update-working-copy') [255]