# HG changeset patch # User timeless # Date 1450166041 0 # Node ID 4a921d66617f94b5a6b9ee592aaf93880feb025e # Parent dfab0afde928bce876bc0af99ca21d942d2b66bf import: refactor exact flag diff -r dfab0afde928 -r 4a921d66617f mercurial/commands.py --- a/mercurial/commands.py Mon Dec 14 05:29:55 2015 +0000 +++ b/mercurial/commands.py Tue Dec 15 07:54:01 2015 +0000 @@ -4665,6 +4665,7 @@ if date: opts['date'] = util.parsedate(date) + exact = opts.get('exact') update = not opts.get('bypass') if not update and opts.get('no_commit'): raise error.Abort(_('cannot use --no-commit with --bypass')) @@ -4676,10 +4677,11 @@ raise error.Abort(_('similarity must be between 0 and 100')) if sim and not update: raise error.Abort(_('cannot use --similarity with --bypass')) - if opts.get('exact') and opts.get('edit'): - raise error.Abort(_('cannot use --exact with --edit')) - if opts.get('exact') and opts.get('prefix'): - raise error.Abort(_('cannot use --exact with --prefix')) + if exact: + if opts.get('edit'): + raise error.Abort(_('cannot use --exact with --edit')) + if opts.get('prefix'): + raise error.Abort(_('cannot use --exact with --prefix')) base = opts["base"] wlock = dsguard = lock = tr = None @@ -4693,8 +4695,8 @@ if update: cmdutil.checkunfinished(repo) - if (opts.get('exact') or not opts.get('force')) and update: - cmdutil.bailifchanged(repo) + if (exact or not opts.get('force')): + cmdutil.bailifchanged(repo) if not opts.get('no_commit'): lock = repo.lock() @@ -4720,7 +4722,7 @@ if msg: haspatch = True ui.note(msg + '\n') - if update or opts.get('exact'): + if update or exact: parents = repo[None].parents() else: parents = [repo[node]]