Mercurial > public > mercurial-scm > hg-stable
comparison hgext/githelp.py @ 42415:37ff80505dfd
githelp: add --dry-run for mv
Differential Revision: https://phab.mercurial-scm.org/D6460
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 30 May 2019 16:40:34 +0800 |
parents | eddff539f5be |
children | 7752cd3a2f83 |
comparison
equal
deleted
inserted
replaced
42414:eddff539f5be | 42415:37ff80505dfd |
---|---|
682 ui.status((bytes(cmd)), "\n") | 682 ui.status((bytes(cmd)), "\n") |
683 | 683 |
684 def mv(ui, repo, *args, **kwargs): | 684 def mv(ui, repo, *args, **kwargs): |
685 cmdoptions = [ | 685 cmdoptions = [ |
686 ('f', 'force', None, ''), | 686 ('f', 'force', None, ''), |
687 ('n', 'dry-run', None, ''), | |
687 ] | 688 ] |
688 args, opts = parseoptions(ui, cmdoptions, args) | 689 args, opts = parseoptions(ui, cmdoptions, args) |
689 | 690 |
690 cmd = Command('mv') | 691 cmd = Command('mv') |
691 cmd.extend(args) | 692 cmd.extend(args) |
692 | 693 |
693 if opts.get('force'): | 694 if opts.get('force'): |
694 cmd['-f'] = None | 695 cmd['-f'] = None |
696 if opts.get('dry_run'): | |
697 cmd['-n'] = None | |
695 | 698 |
696 ui.status((bytes(cmd)), "\n") | 699 ui.status((bytes(cmd)), "\n") |
697 | 700 |
698 def pull(ui, repo, *args, **kwargs): | 701 def pull(ui, repo, *args, **kwargs): |
699 cmdoptions = [ | 702 cmdoptions = [ |