##// END OF EJS Templates
largefiles: exit from remove with 1 on warnings...
Matt Harbison -
r17576:e0081bb5 stable
parent child Browse files
Show More
@@ -141,14 +141,17 b' def removelargefiles(ui, repo, *pats, **'
141 for f in files:
141 for f in files:
142 ui.warn(_('not removing %s: %s (use forget to undo)\n')
142 ui.warn(_('not removing %s: %s (use forget to undo)\n')
143 % (m.rel(f), reason))
143 % (m.rel(f), reason))
144 return int(len(files) > 0)
145
146 result = 0
144
147
145 if after:
148 if after:
146 remove, forget = deleted, []
149 remove, forget = deleted, []
147 warn(modified + added + clean, _('file still exists'))
150 result = warn(modified + added + clean, _('file still exists'))
148 else:
151 else:
149 remove, forget = deleted + clean, []
152 remove, forget = deleted + clean, []
150 warn(modified, _('file is modified'))
153 result = warn(modified, _('file is modified'))
151 warn(added, _('file has been marked for add'))
154 result = warn(added, _('file has been marked for add')) or result
152
155
153 for f in sorted(remove + forget):
156 for f in sorted(remove + forget):
154 if ui.verbose or not m.exact(f):
157 if ui.verbose or not m.exact(f):
@@ -181,6 +184,8 b' def removelargefiles(ui, repo, *pats, **'
181 finally:
184 finally:
182 wlock.release()
185 wlock.release()
183
186
187 return result
188
184 # For overriding mercurial.hgweb.webcommands so that largefiles will
189 # For overriding mercurial.hgweb.webcommands so that largefiles will
185 # appear at their right place in the manifests.
190 # appear at their right place in the manifests.
186 def decodepath(orig, path):
191 def decodepath(orig, path):
@@ -207,9 +212,9 b' def overrideadd(orig, ui, repo, *pats, *'
207
212
208 def overrideremove(orig, ui, repo, *pats, **opts):
213 def overrideremove(orig, ui, repo, *pats, **opts):
209 installnormalfilesmatchfn(repo[None].manifest())
214 installnormalfilesmatchfn(repo[None].manifest())
210 orig(ui, repo, *pats, **opts)
215 result = orig(ui, repo, *pats, **opts)
211 restorematchfn()
216 restorematchfn()
212 removelargefiles(ui, repo, *pats, **opts)
217 return removelargefiles(ui, repo, *pats, **opts) or result
213
218
214 def overridestatusfn(orig, repo, rev2, **opts):
219 def overridestatusfn(orig, repo, rev2, **opts):
215 try:
220 try:
@@ -79,6 +79,17 b' Test status, subdir and unknown files'
79 C sub/normal2
79 C sub/normal2
80 $ rm sub/unknown
80 $ rm sub/unknown
81
81
82 Test exit codes for remove warning cases (modified and still exiting)
83
84 $ hg remove -A large1
85 not removing large1: file still exists (use forget to undo)
86 [1]
87 $ echo 'modified' > large1
88 $ hg remove large1
89 not removing large1: file is modified (use forget to undo)
90 [1]
91 $ hg up -Cq
92
82 Remove both largefiles and normal files.
93 Remove both largefiles and normal files.
83
94
84 $ hg remove normal1 large1
95 $ hg remove normal1 large1
@@ -96,11 +107,15 b' Remove both largefiles and normal files.'
96 A large1-test
107 A large1-test
97 $ hg rm large1-test
108 $ hg rm large1-test
98 not removing large1-test: file has been marked for add (use forget to undo)
109 not removing large1-test: file has been marked for add (use forget to undo)
110 [1]
99 $ hg st
111 $ hg st
100 A large1-test
112 A large1-test
101 $ hg forget large1-test
113 $ hg forget large1-test
102 $ hg st
114 $ hg st
103 ? large1-test
115 ? large1-test
116 $ hg remove large1-test
117 not removing large1-test: file is untracked
118 [1]
104 $ rm large1-test
119 $ rm large1-test
105
120
106 Copy both largefiles and normal files (testing that status output is correct).
121 Copy both largefiles and normal files (testing that status output is correct).
General Comments 0
You need to be logged in to leave comments. Login now