Commits

ZyX_I committed 2e763b7

Reduced number of shell calls for non-python driver by making getrevhex function just return a string if it is 40-hex digit hash

Comments (0)

Files changed (3)

plugin/aurum/drivers/mercurial.vim

 else "▶2
 let s:getrevhextemplate=shellescape('{node}')
 function s:hg.getrevhex(repo, rev)
-    if type(a:rev)==type('') && has_key(a:repo.changesets, a:rev)
-        return a:repo.changesets[a:rev].hex
+    if type(a:rev)==type('') && (has_key(a:repo.changesets, a:rev) ||
+                \                a:rev=~#'\v^[0-9a-f]{40}$')
+        return a:rev
     elseif type(a:rev)==type(0) && a:rev<len(a:repo.cslist)
         return a:repo.cslist[a:rev].hex
     endif
 {{{1 full
  1*1: 
 *2*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
-*2#2: vimdiff-fullrepo/nohglinesrev.lst
+*2#2: %TMPDIR%/test/vimdiff-fullrepo/nohglinesrev.lst
 {{{1 ,X
 *1*1: 
 {{{1 noonlymodified
  1*1: 
  2*1: 
- 2#2: vimdiff-fullrepo/addeddef
+ 2#2: %TMPDIR%/test/vimdiff-fullrepo/addeddef
  3*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:hglines2.lst
  3#2: 
 *4*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
-*4#2: vimdiff-fullrepo/nohglinesrev.lst
+*4#2: %TMPDIR%/test/vimdiff-fullrepo/nohglinesrev.lst
 {{{1 untracked
  1*1: 
  2*1: 
- 2#2: vimdiff-fullrepo/addeddef
+ 2#2: %TMPDIR%/test/vimdiff-fullrepo/addeddef
  3*1: 
- 3#2: vimdiff-fullrepo/hglinesrev.lst
+ 3#2: %TMPDIR%/test/vimdiff-fullrepo/hglinesrev.lst
  4*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:hglines2.lst
  4#2: 
  5*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
- 5#2: vimdiff-fullrepo/nohglinesrev.lst
+ 5#2: %TMPDIR%/test/vimdiff-fullrepo/nohglinesrev.lst
 *6*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglines.lst
 *6#2: 
 {{{1 noonlymodified files *.lst
  1*1: 
  2*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
- 2#2: vimdiff-fullrepo/nohglinesrev.lst
+ 2#2: %TMPDIR%/test/vimdiff-fullrepo/nohglinesrev.lst
 *3*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:hglines2.lst
 *3#2: 
 {{{1 files :
- 1*1: vimdiff-fullrepo/nohglinesrev.lst
+ 1*1: %TMPDIR%/test/vimdiff-fullrepo/nohglinesrev.lst
 *2*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
-*2#2: vimdiff-fullrepo/nohglinesrev.lst
+*2#2: %TMPDIR%/test/vimdiff-fullrepo/nohglinesrev.lst
 {{{1 files repo/*.lst
  1*1: 
 *2*1: aurum://file:%ETMPDIR%%-test%-vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
         for w in range(1, tabpagewinnr(t, '$'))
             let s  = ((t==tcur)?('*'):(' ')).t
             let s .= ((w==wcur)?('*'):((w==wprev)?('#'):(' '))).w
-            let s .= ': '.bufname(bs[w-1])
+            let bn=bufname(bs[w-1])
+            if empty(getbufvar(bs[w-1], '&buftype')) && !empty(bn)
+                let bn=fnamemodify(bn, ':p')
+            endif
+            let s .= ': '.bn
             let r+=[s]
         endfor
     endfor