diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -568,7 +568,7 @@ class dirstate(object): nonexistent = False # XXX: what to do with file no longer present in the fs # who are not removed in the dirstate ? - if nonexistent and type_ in "nm": + if nonexistent and type_ in "nma": dadd(fn) continue # check the common case first diff --git a/tests/test-commit b/tests/test-commit --- a/tests/test-commit +++ b/tests/test-commit @@ -19,11 +19,12 @@ hg commit -d 'foo bar' -m commit-5 hg commit -d ' 1 4444' -m commit-6 hg commit -d '111111111111 0' -m commit-7 -echo % partial commit test +echo % commit added file that has been deleted echo bar > bar hg add bar rm bar hg commit -d "1000000 0" -m commit-8 2>&1 | cleanpath +hg commit -d "1000000 0" -m commit-8 bar 2>&1 | cleanpath hg -q revert -a --no-backup diff --git a/tests/test-commit.out b/tests/test-commit.out --- a/tests/test-commit.out +++ b/tests/test-commit.out @@ -12,9 +12,9 @@ transaction abort! rollback completed abort: invalid date: 'foo bar' nothing changed -% partial commit test -trouble committing bar! -abort: No such file or directory: .../test/bar +% commit added file that has been deleted +nothing changed +abort: file .../test/bar not found! adding dir/file dir/file adding dir.file diff --git a/tests/test-revert b/tests/test-revert --- a/tests/test-revert +++ b/tests/test-revert @@ -32,7 +32,7 @@ hg add b echo %% should show b added hg status b rm b -echo %% should show b added +echo %% should show b deleted hg status b hg revert -v b echo %% should not find b diff --git a/tests/test-revert.out b/tests/test-revert.out --- a/tests/test-revert.out +++ b/tests/test-revert.out @@ -20,8 +20,8 @@ M c ? b %% should show b added A b -%% should show b added -A b +%% should show b deleted +! b forgetting b %% should not find b b: No such file or directory