diff mercurial/cmdutil.py @ 24464:30ddc3cf76df

revert: evaluate subrepos to revert against the working directory Reverting to a revision where the subrepo didn't exist will now abort, and matching subrepos against the working directory is consistent with how filesets are evaluated since 5b85a5bc5bbb.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 25 Mar 2015 22:20:44 -0400
parents 06d199e66bbc
children 1ff35d76421c
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Mar 25 21:54:47 2015 -0400
+++ b/mercurial/cmdutil.py	Wed Mar 25 22:20:44 2015 -0400
@@ -3049,14 +3049,14 @@
             _performrevert(repo, parents, ctx, actions, interactive)
 
         # 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))
+        subrepomatch = scmutil.match(wctx, pats, opts)
+        targetsubs = sorted(s for s in wctx.substate if subrepomatch(s))
 
         if targetsubs:
             # Revert the subrepos on the revert list
             for sub in targetsubs:
                 try:
-                    ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts)
+                    wctx.sub(sub).revert(ctx.substate[sub], *pats, **opts)
                 except KeyError:
                     raise util.Abort("subrepository '%s' does not exist in %s!"
                                       % (sub, short(ctx.node())))