128 manifest = repo[None].manifest() |
128 manifest = repo[None].manifest() |
129 installnormalfilesmatchfn(manifest) |
129 installnormalfilesmatchfn(manifest) |
130 orig(ui, repo, *pats, **opts) |
130 orig(ui, repo, *pats, **opts) |
131 restorematchfn() |
131 restorematchfn() |
132 |
132 |
133 after, force = opts.get('after'), opts.get('force') |
133 after = opts.get('after') |
134 if not pats and not after: |
134 if not pats and not after: |
135 raise util.Abort(_('no files specified')) |
135 raise util.Abort(_('no files specified')) |
136 m = scmutil.match(repo[None], pats, opts) |
136 m = scmutil.match(repo[None], pats, opts) |
137 try: |
137 try: |
138 repo.lfstatus = True |
138 repo.lfstatus = True |
143 if lfutil.standin(f) in manifest] |
143 if lfutil.standin(f) in manifest] |
144 for list in [s[0], s[1], s[3], s[6]]] |
144 for list in [s[0], s[1], s[3], s[6]]] |
145 |
145 |
146 def warn(files, reason): |
146 def warn(files, reason): |
147 for f in files: |
147 for f in files: |
148 ui.warn(_('not removing %s: %s (use -f to force removal)\n') |
148 ui.warn(_('not removing %s: %s (use forget to undo)\n') |
149 % (m.rel(f), reason)) |
149 % (m.rel(f), reason)) |
150 |
150 |
151 if force: |
151 if after: |
152 remove, forget = modified + deleted + clean, added |
|
153 elif after: |
|
154 remove, forget = deleted, [] |
152 remove, forget = deleted, [] |
155 warn(modified + added + clean, _('file still exists')) |
153 warn(modified + added + clean, _('file still exists')) |
156 else: |
154 else: |
157 remove, forget = deleted + clean, [] |
155 remove, forget = deleted + clean, [] |
158 warn(modified, _('file is modified')) |
156 warn(modified, _('file is modified')) |