##// END OF EJS Templates
localrepo: don't add deleted files to list of modified/added files (issue2761)...
Idan Kamara -
r13929:cff56a0e default
parent child Browse files
Show More
@@ -0,0 +1,23 b''
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
@@ -1225,14 +1225,15 b' class localrepository(repo.repository):'
1225 modified, added, clean = [], [], []
1225 modified, added, clean = [], [], []
1226 for fn in mf2:
1226 for fn in mf2:
1227 if fn in mf1:
1227 if fn in mf1:
1228 if (mf1.flags(fn) != mf2.flags(fn) or
1228 if (fn not in deleted and
1229 (mf1.flags(fn) != mf2.flags(fn) or
1229 (mf1[fn] != mf2[fn] and
1230 (mf1[fn] != mf2[fn] and
1230 (mf2[fn] or ctx1[fn].cmp(ctx2[fn])))):
1231 (mf2[fn] or ctx1[fn].cmp(ctx2[fn]))))):
1231 modified.append(fn)
1232 modified.append(fn)
1232 elif listclean:
1233 elif listclean:
1233 clean.append(fn)
1234 clean.append(fn)
1234 del mf1[fn]
1235 del mf1[fn]
1235 else:
1236 elif fn not in deleted:
1236 added.append(fn)
1237 added.append(fn)
1237 removed = mf1.keys()
1238 removed = mf1.keys()
1238
1239
@@ -163,4 +163,13 b' qdiff preserve existing git flag:'
163 $ hg qdiff --stat
163 $ hg qdiff --stat
164 lines | 7 +++++--
164 lines | 7 +++++--
165 1 files changed, 5 insertions(+), 2 deletions(-)
165 1 files changed, 5 insertions(+), 2 deletions(-)
166 $ hg qrefresh
166
167
168 qdiff when file deleted (but not removed) in working dir:
169
170 $ hg qnew deleted-file
171 $ echo a > newfile
172 $ hg add newfile
173 $ hg qrefresh
174 $ rm newfile
175 $ hg qdiff
General Comments 0
You need to be logged in to leave comments. Login now