# HG changeset patch # User Martin von Zweigbergk # Date 2015-03-24 20:56:51 # Node ID bab983bb6fd1117291e61de865a042a17c809a42 # Parent 55c449345b103017ea464d474fa9a2650529eac7 revert: define 'wctx' a little earlier and use it more diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2809,7 +2809,8 @@ def revert(ui, repo, ctx, parents, *pats ## filling of the `names` mapping # walk dirstate to fill `names` - m = scmutil.match(repo[None], pats, opts) + wctx = repo[None] + m = scmutil.match(wctx, pats, opts) if not m.always() or node != parent: m.bad = lambda x, y: False for abs in repo.walk(m): @@ -3012,7 +3013,6 @@ def revert(ui, repo, ctx, parents, *pats (unknown, actions['unknown'], discard), ) - wctx = repo[None] for abs, (rel, exact) in sorted(names.items()): # target file to be touch on disk (relative to cwd) target = repo.wjoin(abs)