Mercurial > hg
comparison mercurial/cmdutil.py @ 24134:afed5d2e7985
revert: display full subrepo output with --dry-run
Since the point of --dry-run is to show what will happen, the output with and
without it should agree. And since revert wasn't being called on subrepos with
--dry-run before, revert in the subrepo had to be defanged in this case.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 07 Feb 2015 21:47:28 -0500 |
parents | c260887cdbcd |
children | 67952dc7a88f |
comparison
equal
deleted
inserted
replaced
24133:79c2c29c71ae | 24134:afed5d2e7985 |
---|---|
2781 needdata = ('revert', 'add', 'undelete') | 2781 needdata = ('revert', 'add', 'undelete') |
2782 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) | 2782 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) |
2783 | 2783 |
2784 _performrevert(repo, parents, ctx, actions) | 2784 _performrevert(repo, parents, ctx, actions) |
2785 | 2785 |
2786 # get the list of subrepos that must be reverted | 2786 # get the list of subrepos that must be reverted |
2787 subrepomatch = scmutil.match(ctx, pats, opts) | 2787 subrepomatch = scmutil.match(ctx, pats, opts) |
2788 targetsubs = sorted(s for s in ctx.substate if subrepomatch(s)) | 2788 targetsubs = sorted(s for s in ctx.substate if subrepomatch(s)) |
2789 | 2789 |
2790 if targetsubs: | 2790 if targetsubs: |
2791 # Revert the subrepos on the revert list | 2791 # Revert the subrepos on the revert list |
2792 for sub in targetsubs: | 2792 for sub in targetsubs: |
2793 ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts) | 2793 ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts) |
2794 finally: | 2794 finally: |
2795 wlock.release() | 2795 wlock.release() |
2796 | 2796 |
2797 def _revertprefetch(repo, ctx, *files): | 2797 def _revertprefetch(repo, ctx, *files): |
2798 """Let extension changing the storage layer prefetch content""" | 2798 """Let extension changing the storage layer prefetch content""" |