##// 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 141 for f in files:
142 142 ui.warn(_('not removing %s: %s (use forget to undo)\n')
143 143 % (m.rel(f), reason))
144 return int(len(files) > 0)
145
146 result = 0
144 147
145 148 if after:
146 149 remove, forget = deleted, []
147 warn(modified + added + clean, _('file still exists'))
150 result = warn(modified + added + clean, _('file still exists'))
148 151 else:
149 152 remove, forget = deleted + clean, []
150 warn(modified, _('file is modified'))
151 warn(added, _('file has been marked for add'))
153 result = warn(modified, _('file is modified'))
154 result = warn(added, _('file has been marked for add')) or result
152 155
153 156 for f in sorted(remove + forget):
154 157 if ui.verbose or not m.exact(f):
@@ -181,6 +184,8 b' def removelargefiles(ui, repo, *pats, **'
181 184 finally:
182 185 wlock.release()
183 186
187 return result
188
184 189 # For overriding mercurial.hgweb.webcommands so that largefiles will
185 190 # appear at their right place in the manifests.
186 191 def decodepath(orig, path):
@@ -207,9 +212,9 b' def overrideadd(orig, ui, repo, *pats, *'
207 212
208 213 def overrideremove(orig, ui, repo, *pats, **opts):
209 214 installnormalfilesmatchfn(repo[None].manifest())
210 orig(ui, repo, *pats, **opts)
215 result = orig(ui, repo, *pats, **opts)
211 216 restorematchfn()
212 removelargefiles(ui, repo, *pats, **opts)
217 return removelargefiles(ui, repo, *pats, **opts) or result
213 218
214 219 def overridestatusfn(orig, repo, rev2, **opts):
215 220 try:
@@ -79,6 +79,17 b' Test status, subdir and unknown files'
79 79 C sub/normal2
80 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 93 Remove both largefiles and normal files.
83 94
84 95 $ hg remove normal1 large1
@@ -96,11 +107,15 b' Remove both largefiles and normal files.'
96 107 A large1-test
97 108 $ hg rm large1-test
98 109 not removing large1-test: file has been marked for add (use forget to undo)
110 [1]
99 111 $ hg st
100 112 A large1-test
101 113 $ hg forget large1-test
102 114 $ hg st
103 115 ? large1-test
116 $ hg remove large1-test
117 not removing large1-test: file is untracked
118 [1]
104 119 $ rm large1-test
105 120
106 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