Skip to content
Snippets Groups Projects
Martin von Zweigbergk's avatar
Martin von Zweigbergk authored
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
88a7c211
History

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install::

$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help

Running without installing::

$ make local # build for inplace usage
$ ./hg --version # should show the latest version

See https://mercurial-scm.org/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.