diff 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
line wrap: on
line diff
--- a/hgext/githelp.py	Mon Dec 18 21:09:08 2017 -0800
+++ b/hgext/githelp.py	Sun Jan 14 11:19:45 2018 -0800
@@ -876,23 +876,27 @@
     ]
     args, opts = parseoptions(ui, cmdoptions, args)
 
-    cmd = Command('show')
     if opts.get('name_status'):
         if opts.get('pretty') == 'format:':
-            cmd = Command('stat')
-            cmd['--change'] = 'tip'
+            cmd = Command('status')
+            cmd['--change'] = '.'
         else:
             cmd = Command('log')
             cmd.append('--style status')
-            cmd.append('-r tip')
+            cmd.append('-r .')
     elif len(args) > 0:
         if ispath(repo, args[0]):
-            cmd.append('.')
+            cmd = Command('cat')
+        else:
+            cmd = Command('export')
         cmd.extend(args)
         if opts.get('unified'):
             cmd.append('--config diff.unified=%d' % (opts['unified'],))
     elif opts.get('unified'):
+        cmd = Command('export')
         cmd.append('--config diff.unified=%d' % (opts['unified'],))
+    else:
+        cmd = Command('export')
 
     ui.status((str(cmd)), "\n")