##// END OF EJS Templates
revert: evaluate subrepos to revert against the working directory...
Matt Harbison -
r24464:30ddc3cf default
parent child Browse files
Show More
@@ -3049,14 +3049,14 b' def revert(ui, repo, ctx, parents, *pats'
3049 _performrevert(repo, parents, ctx, actions, interactive)
3049 _performrevert(repo, parents, ctx, actions, interactive)
3050
3050
3051 # get the list of subrepos that must be reverted
3051 # get the list of subrepos that must be reverted
3052 subrepomatch = scmutil.match(ctx, pats, opts)
3052 subrepomatch = scmutil.match(wctx, pats, opts)
3053 targetsubs = sorted(s for s in ctx.substate if subrepomatch(s))
3053 targetsubs = sorted(s for s in wctx.substate if subrepomatch(s))
3054
3054
3055 if targetsubs:
3055 if targetsubs:
3056 # Revert the subrepos on the revert list
3056 # Revert the subrepos on the revert list
3057 for sub in targetsubs:
3057 for sub in targetsubs:
3058 try:
3058 try:
3059 ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts)
3059 wctx.sub(sub).revert(ctx.substate[sub], *pats, **opts)
3060 except KeyError:
3060 except KeyError:
3061 raise util.Abort("subrepository '%s' does not exist in %s!"
3061 raise util.Abort("subrepository '%s' does not exist in %s!"
3062 % (sub, short(ctx.node())))
3062 % (sub, short(ctx.node())))
@@ -528,9 +528,19 b' The subrepo must sorts after the explici'
528 $ hg init test
528 $ hg init test
529 $ cd test
529 $ cd test
530 $ hg init x
530 $ hg init x
531 $ echo abc > abc.txt
532 $ hg ci -Am "abc"
533 adding abc.txt
531 $ echo "x = x" >> .hgsub
534 $ echo "x = x" >> .hgsub
532 $ hg add .hgsub
535 $ hg add .hgsub
533 $ touch a x/a
536 $ touch a x/a
534 $ hg add a x/a
537 $ hg add a x/a
535
538
539 $ hg ci -Sm "added x"
540 committing subrepository x
541 $ echo abc > x/a
542 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
543 abort: subrepository 'x' does not exist in 25ac2c9b3180!
544 [255]
545
536 $ cd ..
546 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now