diff 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
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat Feb 07 19:40:02 2015 -0500
+++ b/mercurial/cmdutil.py	Sat Feb 07 21:47:28 2015 -0500
@@ -2783,14 +2783,14 @@
 
             _performrevert(repo, parents, ctx, actions)
 
-            # get the list of subrepos that must be reverted
-            subrepomatch = scmutil.match(ctx, pats, opts)
-            targetsubs = sorted(s for s in ctx.substate if subrepomatch(s))
-
-            if targetsubs:
-                # Revert the subrepos on the revert list
-                for sub in targetsubs:
-                    ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts)
+        # get the list of subrepos that must be reverted
+        subrepomatch = scmutil.match(ctx, pats, opts)
+        targetsubs = sorted(s for s in ctx.substate if subrepomatch(s))
+
+        if targetsubs:
+            # Revert the subrepos on the revert list
+            for sub in targetsubs:
+                ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts)
     finally:
         wlock.release()