comparison tests/test-diff-issue2761.t @ 14500:e880433a2e00 stable

localrepo: don't add deleted files to list of modified/added files (issue2761) If a file is deleted (rm, not 'hg rm') from the working dir an attempt to run 'hg diff -r X', with the file being present in X will cause an abort. We didn't check if the file has been deleted from the working dir and later on tried to open it to compare with the one from X, causing the abort. This fix adds that check. Consequently, no output will be returned.
author Idan Kamara <idankk86@gmail.com>
date Mon, 11 Apr 2011 21:44:22 +0300
parents
children 73e3e368bd42
comparison
equal deleted inserted replaced
14499:a281981e2033 14500:e880433a2e00
1 Test issue2761
2
3 $ hg init
4
5 $ touch to-be-deleted
6 $ hg add
7 adding to-be-deleted
8 $ hg ci -m first
9 $ echo a > to-be-deleted
10 $ hg ci -m second
11 $ rm to-be-deleted
12 $ hg diff -r 0
13
14 Same issue, different code path
15
16 $ hg up -C
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 $ touch doesnt-exist-in-1
19 $ hg add
20 adding doesnt-exist-in-1
21 $ hg ci -m third
22 $ rm doesnt-exist-in-1
23 $ hg diff -r 1