Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG7752cd3a2f83: githelp: translate git stash show and clear actions and --patch flag
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| pulkit |
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/githelp.py (17 lines) | |||
| M | tests/test-githelp.t (16 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 197a7b9b8b49 | 013128108642 | Anton Shestakov | May 30 2019, 4:42 AM |
| cmd.append('--config diff.unified=%d' % (opts['unified'],)) | cmd.append('--config diff.unified=%d' % (opts['unified'],)) | ||||
| else: | else: | ||||
| cmd = Command('export') | cmd = Command('export') | ||||
| ui.status((bytes(cmd)), "\n") | ui.status((bytes(cmd)), "\n") | ||||
| def stash(ui, repo, *args, **kwargs): | def stash(ui, repo, *args, **kwargs): | ||||
| cmdoptions = [ | cmdoptions = [ | ||||
| ('p', 'patch', None, ''), | |||||
| ] | ] | ||||
| args, opts = parseoptions(ui, cmdoptions, args) | args, opts = parseoptions(ui, cmdoptions, args) | ||||
| cmd = Command('shelve') | cmd = Command('shelve') | ||||
| action = args[0] if len(args) > 0 else None | action = args[0] if len(args) > 0 else None | ||||
| if action == 'list': | if action == 'list': | ||||
| cmd['-l'] = None | cmd['-l'] = None | ||||
| if opts.get('patch'): | |||||
| cmd['-p'] = None | |||||
| elif action == 'show': | |||||
| if opts.get('patch'): | |||||
| cmd['-p'] = None | |||||
| else: | |||||
| cmd['--stat'] = None | |||||
| if len(args) > 1: | |||||
| cmd.append(args[1]) | |||||
| elif action == 'clear': | |||||
| cmd['--cleanup'] = None | |||||
| elif action == 'drop': | elif action == 'drop': | ||||
| cmd['-d'] = None | cmd['-d'] = None | ||||
| if len(args) > 1: | if len(args) > 1: | ||||
| cmd.append(args[1]) | cmd.append(args[1]) | ||||
| else: | else: | ||||
| cmd.append('<shelve name>') | cmd.append('<shelve name>') | ||||
| elif action == 'pop' or action == 'apply': | elif action == 'pop' or action == 'apply': | ||||
| cmd = Command('unshelve') | cmd = Command('unshelve') | ||||
| if len(args) > 1: | if len(args) > 1: | ||||
| cmd.append(args[1]) | cmd.append(args[1]) | ||||
| if action == 'apply': | if action == 'apply': | ||||
| cmd['--keep'] = None | cmd['--keep'] = None | ||||
| elif (action == 'branch' or action == 'show' or action == 'clear' | elif action == 'branch' or action == 'create': | ||||
| or action == 'create'): | |||||
| ui.status(_("note: Mercurial doesn't have equivalents to the " | ui.status(_("note: Mercurial doesn't have equivalents to the " | ||||
| "git stash branch, show, clear, or create actions\n\n")) | "git stash branch or create actions\n\n")) | ||||
| return | return | ||||
| else: | else: | ||||
| if len(args) > 0: | if len(args) > 0: | ||||
| if args[0] != 'save': | if args[0] != 'save': | ||||
| cmd['--name'] = args[0] | cmd['--name'] = args[0] | ||||
| elif len(args) > 1: | elif len(args) > 1: | ||||
| cmd['--name'] = args[1] | cmd['--name'] = args[1] | ||||
| githelp for stash drop without name | githelp for stash drop without name | ||||
| $ hg githelp -- git stash drop | $ hg githelp -- git stash drop | ||||
| hg shelve -d <shelve name> | hg shelve -d <shelve name> | ||||
| githelp for stash drop with name | githelp for stash drop with name | ||||
| $ hg githelp -- git stash drop xyz | $ hg githelp -- git stash drop xyz | ||||
| hg shelve -d xyz | hg shelve -d xyz | ||||
| githelp for stash list with patch | |||||
| $ hg githelp -- git stash list -p | |||||
| hg shelve -l -p | |||||
| githelp for stash show | |||||
| $ hg githelp -- git stash show | |||||
| hg shelve --stat | |||||
| githelp for stash show with patch and name | |||||
| $ hg githelp -- git stash show -p mystash | |||||
| hg shelve -p mystash | |||||
| githelp for stash clear | |||||
| $ hg githelp -- git stash clear | |||||
| hg shelve --cleanup | |||||
| githelp for whatchanged should show deprecated message | githelp for whatchanged should show deprecated message | ||||
| $ hg githelp -- whatchanged -p | $ hg githelp -- whatchanged -p | ||||
| this command has been deprecated in the git project, thus isn't supported by this tool | this command has been deprecated in the git project, thus isn't supported by this tool | ||||
| githelp for git branch -m renaming | githelp for git branch -m renaming | ||||
| $ hg githelp -- git branch -m old new | $ hg githelp -- git branch -m old new | ||||
| hg bookmark -m old new | hg bookmark -m old new | ||||