Mercurial > public > mercurial-scm > hg
comparison hgext/githelp.py @ 35721:f50067fbeead
githelp: don't reference 3rd party commands for `git show`
`hg show` is a Facebook-ism. Reference functionality in core.
The logic here isn't terrific. But it is better than nothing.
Differential Revision: https://phab.mercurial-scm.org/D1729
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 14 Jan 2018 11:19:45 -0800 |
parents | b3cf58487731 |
children | 257f3651ada9 |
comparison
equal
deleted
inserted
replaced
35720:b3cf58487731 | 35721:f50067fbeead |
---|---|
874 ('', 'pretty', '', ''), | 874 ('', 'pretty', '', ''), |
875 ('U', 'unified', int, ''), | 875 ('U', 'unified', int, ''), |
876 ] | 876 ] |
877 args, opts = parseoptions(ui, cmdoptions, args) | 877 args, opts = parseoptions(ui, cmdoptions, args) |
878 | 878 |
879 cmd = Command('show') | |
880 if opts.get('name_status'): | 879 if opts.get('name_status'): |
881 if opts.get('pretty') == 'format:': | 880 if opts.get('pretty') == 'format:': |
882 cmd = Command('stat') | 881 cmd = Command('status') |
883 cmd['--change'] = 'tip' | 882 cmd['--change'] = '.' |
884 else: | 883 else: |
885 cmd = Command('log') | 884 cmd = Command('log') |
886 cmd.append('--style status') | 885 cmd.append('--style status') |
887 cmd.append('-r tip') | 886 cmd.append('-r .') |
888 elif len(args) > 0: | 887 elif len(args) > 0: |
889 if ispath(repo, args[0]): | 888 if ispath(repo, args[0]): |
890 cmd.append('.') | 889 cmd = Command('cat') |
890 else: | |
891 cmd = Command('export') | |
891 cmd.extend(args) | 892 cmd.extend(args) |
892 if opts.get('unified'): | 893 if opts.get('unified'): |
893 cmd.append('--config diff.unified=%d' % (opts['unified'],)) | 894 cmd.append('--config diff.unified=%d' % (opts['unified'],)) |
894 elif opts.get('unified'): | 895 elif opts.get('unified'): |
896 cmd = Command('export') | |
895 cmd.append('--config diff.unified=%d' % (opts['unified'],)) | 897 cmd.append('--config diff.unified=%d' % (opts['unified'],)) |
898 else: | |
899 cmd = Command('export') | |
896 | 900 |
897 ui.status((str(cmd)), "\n") | 901 ui.status((str(cmd)), "\n") |
898 | 902 |
899 def stash(ui, repo, *args, **kwargs): | 903 def stash(ui, repo, *args, **kwargs): |
900 cmdoptions = [ | 904 cmdoptions = [ |