Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 23965:6156edaa82aa stable
revert: move prefetch to after the actions logic
The prefetch logic came before the actual population of the actions collection,
so it was always being passed an empty action list. This fixes it by moving it
to after that logic.
The only consumer of this function at the moment is remotefilelog, and I
verified it works with this change.
author | Durham Goode <durham@fb.com> |
---|---|
date | Tue, 27 Jan 2015 19:52:26 -0800 |
parents | 8a29897d42d2 |
children | 448bb32b8ee6 |
comparison
equal
deleted
inserted
replaced
23964:f1c127df7c4f | 23965:6156edaa82aa |
---|---|
2763 (clean, actions['noop'], discard), | 2763 (clean, actions['noop'], discard), |
2764 # Existing file, not tracked anywhere | 2764 # Existing file, not tracked anywhere |
2765 (unknown, actions['unknown'], discard), | 2765 (unknown, actions['unknown'], discard), |
2766 ) | 2766 ) |
2767 | 2767 |
2768 needdata = ('revert', 'add', 'undelete') | |
2769 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) | |
2770 | |
2771 wctx = repo[None] | 2768 wctx = repo[None] |
2772 for abs, (rel, exact) in sorted(names.items()): | 2769 for abs, (rel, exact) in sorted(names.items()): |
2773 # target file to be touch on disk (relative to cwd) | 2770 # target file to be touch on disk (relative to cwd) |
2774 target = repo.wjoin(abs) | 2771 target = repo.wjoin(abs) |
2775 # search the entry in the dispatch table. | 2772 # search the entry in the dispatch table. |
2795 ui.warn(msg % rel) | 2792 ui.warn(msg % rel) |
2796 break | 2793 break |
2797 | 2794 |
2798 | 2795 |
2799 if not opts.get('dry_run'): | 2796 if not opts.get('dry_run'): |
2797 needdata = ('revert', 'add', 'undelete') | |
2798 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) | |
2799 | |
2800 _performrevert(repo, parents, ctx, actions) | 2800 _performrevert(repo, parents, ctx, actions) |
2801 | 2801 |
2802 # get the list of subrepos that must be reverted | 2802 # get the list of subrepos that must be reverted |
2803 subrepomatch = scmutil.match(ctx, pats, opts) | 2803 subrepomatch = scmutil.match(ctx, pats, opts) |
2804 targetsubs = sorted(s for s in ctx.substate if subrepomatch(s)) | 2804 targetsubs = sorted(s for s in ctx.substate if subrepomatch(s)) |