Mercurial > hg
comparison hgext/rebase.py @ 39097:c1a1fb389b4d
rebase: do not set internal dryrun flag by --confirm
This prepares for cleaning up option checking.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 15 Aug 2018 10:32:10 +0900 |
parents | 571361e47137 |
children | a42506059522 |
comparison
equal
deleted
inserted
replaced
39096:33f5cffe725f | 39097:c1a1fb389b4d |
---|---|
803 | 803 |
804 """ | 804 """ |
805 opts = pycompat.byteskwargs(opts) | 805 opts = pycompat.byteskwargs(opts) |
806 inmemory = ui.configbool('rebase', 'experimental.inmemory') | 806 inmemory = ui.configbool('rebase', 'experimental.inmemory') |
807 dryrun = opts.get('dry_run') | 807 dryrun = opts.get('dry_run') |
808 confirm = opts.get('confirm') | |
808 stop = opts.get('stop') | 809 stop = opts.get('stop') |
809 if stop: | 810 if stop: |
810 if opts.get('dry_run') or opts.get('confirm'): | 811 if opts.get('dry_run') or opts.get('confirm'): |
811 raise error.Abort(_('cannot use --stop with --dry-run ' | 812 raise error.Abort(_('cannot use --stop with --dry-run ' |
812 'or --confirm')) | 813 'or --confirm')) |
815 if dryrun: | 816 if dryrun: |
816 if opts.get('abort'): | 817 if opts.get('abort'): |
817 raise error.Abort(_('cannot specify both --dry-run and --abort')) | 818 raise error.Abort(_('cannot specify both --dry-run and --abort')) |
818 if opts.get('continue'): | 819 if opts.get('continue'): |
819 raise error.Abort(_('cannot specify both --dry-run and --continue')) | 820 raise error.Abort(_('cannot specify both --dry-run and --continue')) |
820 if opts.get('confirm'): | 821 if confirm: |
821 dryrun = True | |
822 if opts.get('dry_run'): | 822 if opts.get('dry_run'): |
823 raise error.Abort(_('cannot specify both --confirm and --dry-run')) | 823 raise error.Abort(_('cannot specify both --confirm and --dry-run')) |
824 if opts.get('abort'): | 824 if opts.get('abort'): |
825 raise error.Abort(_('cannot specify both --confirm and --abort')) | 825 raise error.Abort(_('cannot specify both --confirm and --abort')) |
826 if opts.get('continue'): | 826 if opts.get('continue'): |
840 ('--' + key)) | 840 ('--' + key)) |
841 userrevs = list(repo.revs(opts.get('auto_orphans'))) | 841 userrevs = list(repo.revs(opts.get('auto_orphans'))) |
842 opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)] | 842 opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)] |
843 opts['dest'] = '_destautoorphanrebase(SRC)' | 843 opts['dest'] = '_destautoorphanrebase(SRC)' |
844 | 844 |
845 if dryrun: | 845 if dryrun or confirm: |
846 return _dryrunrebase(ui, repo, opts) | 846 return _dryrunrebase(ui, repo, opts) |
847 elif stop: | 847 elif stop: |
848 rbsrt = rebaseruntime(repo, ui) | 848 rbsrt = rebaseruntime(repo, ui) |
849 rbsrt.restorestatus() | 849 rbsrt.restorestatus() |
850 | 850 |