Comments
Patch
@@ -2525,10 +2525,13 @@ def revert(ui, repo, ctx, parents, *pats
(dsremoved, actions['undelete'], backup),
(clean, actions['noop'], discard),
(unknown, actions['unknown'], discard),
)
+ needdata = ('revert', 'add', 'remove', 'undelete')
+ _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata])
+
for abs, (rel, exact) in sorted(names.items()):
# target file to be touch on disk (relative to cwd)
target = repo.wjoin(abs)
# search the entry in the dispatch table.
# if the file is in any of these sets, it was touched in the working
@@ -2562,10 +2565,14 @@ def revert(ui, repo, ctx, parents, *pats
for sub in targetsubs:
ctx.sub(sub).revert(ui, ctx.substate[sub], *pats, **opts)
finally:
wlock.release()
+def _revertprefetch(repo, ctx, *files):
+ """Let extension changing the storage layer prefetch content"""
+ pass
+
def _performrevert(repo, parents, ctx, actions):
"""function that actually perform all the actions computed for revert
This is an independent function to let extension to plug in and react to
the imminent revert.