diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6034,7 +6034,7 @@ def rename(ui, repo, *pats, **opts): """ context = lambda repo: repo.dirstate.changing_files(repo) rev = opts.get('at_rev') - ctx = None + if rev: ctx = logcmdutil.revsingle(repo, rev) if ctx.rev() is not None: