Show More
@@ -38,8 +38,8 b' def wrapdirstate(repo, dirstate):' | |||
|
38 | 38 | return super(narrowdirstate, self).normal(*args, **kwargs) |
|
39 | 39 | |
|
40 | 40 | @_editfunc |
|
41 | def set_tracked(self, *args): | |
|
42 | return super(narrowdirstate, self).set_tracked(*args) | |
|
41 | def set_tracked(self, *args, **kwargs): | |
|
42 | return super(narrowdirstate, self).set_tracked(*args, **kwargs) | |
|
43 | 43 | |
|
44 | 44 | @_editfunc |
|
45 | 45 | def set_untracked(self, *args): |
@@ -47,6 +47,8 b' import re' | |||
|
47 | 47 | from mercurial.i18n import _ |
|
48 | 48 | from mercurial.node import short |
|
49 | 49 | from mercurial import ( |
|
50 | cmdutil, | |
|
51 | extensions, | |
|
50 | 52 | pycompat, |
|
51 | 53 | registrar, |
|
52 | 54 | ) |
@@ -215,6 +217,23 b' def reposetup(ui, repo):' | |||
|
215 | 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 | 237 | def extsetup(ui): |
|
219 | 238 | # deprecated config: win32text.warn |
|
220 | 239 | if ui.configbool(b'win32text', b'warn'): |
@@ -224,3 +243,4 b' def extsetup(ui):' | |||
|
224 | 243 | b"https://mercurial-scm.org/wiki/Win32TextExtension\n" |
|
225 | 244 | ) |
|
226 | 245 | ) |
|
246 | extensions.wrapfunction(cmdutil, '_performrevert', wrap_revert) |
General Comments 0
You need to be logged in to leave comments.
Login now