213 return |
215 return |
214 for name, fn in pycompat.iteritems(_filters): |
216 for name, fn in pycompat.iteritems(_filters): |
215 repo.adddatafilter(name, fn) |
217 repo.adddatafilter(name, fn) |
216 |
218 |
217 |
219 |
|
220 def wrap_revert(orig, repo, ctx, names, uipathfn, actions, *args, **kwargs): |
|
221 # reset dirstate cache for file we touch |
|
222 ds = repo.dirstate |
|
223 with ds.parentchange(): |
|
224 for filename in actions[b'revert'][0]: |
|
225 entry = ds.get_entry(filename) |
|
226 if entry is not None: |
|
227 if entry.p1_tracked: |
|
228 ds.update_file( |
|
229 filename, |
|
230 entry.tracked, |
|
231 p1_tracked=True, |
|
232 p2_info=entry.p2_info, |
|
233 ) |
|
234 return orig(repo, ctx, names, uipathfn, actions, *args, **kwargs) |
|
235 |
|
236 |
218 def extsetup(ui): |
237 def extsetup(ui): |
219 # deprecated config: win32text.warn |
238 # deprecated config: win32text.warn |
220 if ui.configbool(b'win32text', b'warn'): |
239 if ui.configbool(b'win32text', b'warn'): |
221 ui.warn( |
240 ui.warn( |
222 _( |
241 _( |
223 b"win32text is deprecated: " |
242 b"win32text is deprecated: " |
224 b"https://mercurial-scm.org/wiki/Win32TextExtension\n" |
243 b"https://mercurial-scm.org/wiki/Win32TextExtension\n" |
225 ) |
244 ) |
226 ) |
245 ) |
|
246 extensions.wrapfunction(cmdutil, '_performrevert', wrap_revert) |