##// END OF EJS Templates
narrow: also warn when not deleting untracked or ignored files...
Martin von Zweigbergk -
r42347:aa8f8392 default draft
parent child Browse files
Show More
@@ -293,8 +293,8 b' def updateworkingcopy(repo, assumeclean='
293 removedmatch = matchmod.differencematcher(oldmatch, newmatch)
293 removedmatch = matchmod.differencematcher(oldmatch, newmatch)
294
294
295 ds = repo.dirstate
295 ds = repo.dirstate
296 lookup, status = ds.status(removedmatch, subrepos=[], ignored=False,
296 lookup, status = ds.status(removedmatch, subrepos=[], ignored=True,
297 clean=True, unknown=False)
297 clean=True, unknown=True)
298 trackeddirty = status.modified + status.added
298 trackeddirty = status.modified + status.added
299 clean = status.clean
299 clean = status.clean
300 if assumeclean:
300 if assumeclean:
@@ -306,6 +306,10 b' def updateworkingcopy(repo, assumeclean='
306 uipathfn = scmutil.getuipathfn(repo)
306 uipathfn = scmutil.getuipathfn(repo)
307 for f in sorted(trackeddirty):
307 for f in sorted(trackeddirty):
308 repo.ui.status(_('not deleting possibly dirty file %s\n') % uipathfn(f))
308 repo.ui.status(_('not deleting possibly dirty file %s\n') % uipathfn(f))
309 for f in sorted(status.unknown):
310 repo.ui.status(_('not deleting unknown file %s\n') % uipathfn(f))
311 for f in sorted(status.ignored):
312 repo.ui.status(_('not deleting ignored file %s\n') % uipathfn(f))
309 for f in clean + trackeddirty:
313 for f in clean + trackeddirty:
310 ds.drop(f)
314 ds.drop(f)
311
315
@@ -28,6 +28,9 b''
28 $ hg clone --narrow ssh://user@dummy/remote main -q \
28 $ hg clone --narrow ssh://user@dummy/remote main -q \
29 > --include d1 --include d3 --include d5 --include d7
29 > --include d1 --include d3 --include d5 --include d7
30
30
31 Ignore file called "ignored"
32 $ echo ignored > main/.hgignore
33
31 $ hg share main share
34 $ hg share main share
32 updating working directory
35 updating working directory
33 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -55,15 +58,19 b' Narrow the share and check that the main'
55 # Make d3/f dirty
58 # Make d3/f dirty
56 $ echo x >> main/d3/f
59 $ echo x >> main/d3/f
57 $ echo y >> main/d3/g
60 $ echo y >> main/d3/g
61 $ touch main/d3/ignored
62 $ touch main/d3/untracked
58 $ hg add main/d3/g
63 $ hg add main/d3/g
59 $ hg -R main st
64 $ hg -R main st
60 M d3/f
65 M d3/f
61 A d3/g
66 A d3/g
67 ? d3/untracked
62 # Make d5/f not match the dirstate timestamp even though it's clean
68 # Make d5/f not match the dirstate timestamp even though it's clean
63 $ sleep 2
69 $ sleep 2
64 $ hg -R main st
70 $ hg -R main st
65 M d3/f
71 M d3/f
66 A d3/g
72 A d3/g
73 ? d3/untracked
67 $ hg -R main debugdirstate --no-dates
74 $ hg -R main debugdirstate --no-dates
68 n 644 2 set d1/f
75 n 644 2 set d1/f
69 n 644 2 set d3/f
76 n 644 2 set d3/f
@@ -91,6 +98,8 b' Narrow the share and check that the main'
91 not deleting possibly dirty file d3/f
98 not deleting possibly dirty file d3/f
92 not deleting possibly dirty file d3/g
99 not deleting possibly dirty file d3/g
93 not deleting possibly dirty file d5/f
100 not deleting possibly dirty file d5/f
101 not deleting unknown file d3/untracked
102 not deleting ignored file d3/ignored
94 # d1/f, d3/f, d3/g and d5/f should no longer be reported
103 # d1/f, d3/f, d3/g and d5/f should no longer be reported
95 $ hg -R main files
104 $ hg -R main files
96 main/d7/f
105 main/d7/f
@@ -99,6 +108,8 b' Narrow the share and check that the main'
99 $ find main/d* -type f | sort
108 $ find main/d* -type f | sort
100 main/d3/f
109 main/d3/f
101 main/d3/g
110 main/d3/g
111 main/d3/ignored
112 main/d3/untracked
102 main/d5/f
113 main/d5/f
103 main/d7/f
114 main/d7/f
104
115
@@ -131,6 +142,8 b' Widen the share and check that the main '
131 $ hg -R main st --all
142 $ hg -R main st --all
132 M d3/f
143 M d3/f
133 ? d3/g
144 ? d3/g
145 ? d3/untracked
146 I d3/ignored
134 C d1/f
147 C d1/f
135 C d7/f
148 C d7/f
136
149
General Comments 0
You need to be logged in to leave comments. Login now