comparison plugin/lawrencium.vim @ 16:724f6db3baa2

Don't show `hg commit` output if there's nothing to show. Fixed a regexp for `hg status`.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 13 Dec 2011 17:17:03 -0800
parents f02e37f395ae
children 5c6c605d0660
comparison
equal deleted inserted replaced
15:f02e37f395ae 16:724f6db3baa2
317 317
318 function! s:HgStatus() abort 318 function! s:HgStatus() abort
319 " Get the repo and the `hg status` output. 319 " Get the repo and the `hg status` output.
320 let l:repo = s:hg_repo() 320 let l:repo = s:hg_repo()
321 let l:status_text = l:repo.RunCommand('status') 321 let l:status_text = l:repo.RunCommand('status')
322 if l:status_text ==# '\v\%^\s*\%$' 322 if l:status_text ==# '\v%^\s*%$'
323 echo "Nothing modified." 323 echo "Nothing modified."
324 endif 324 endif
325 325
326 " Open a new temp buffer in the preview window, jump to it, 326 " Open a new temp buffer in the preview window, jump to it,
327 " and paste the `hg status` output in there. 327 " and paste the `hg status` output in there.
594 call writefile(l:lines, a:log_file) 594 call writefile(l:lines, a:log_file)
595 595
596 " Get the repo and commit with the given message. 596 " Get the repo and commit with the given message.
597 let l:repo = s:hg_repo() 597 let l:repo = s:hg_repo()
598 let l:output = l:repo.RunCommand('commit', '-l', a:log_file) 598 let l:output = l:repo.RunCommand('commit', '-l', a:log_file)
599 if a:show_output 599 if a:show_output && l:output !~# '\v%^\s*%$'
600 call s:trace("Output from hg commit:", 1)
600 echom l:output 601 echom l:output
601 endif 602 endif
602 endfunction 603 endfunction
603 604
604 call s:AddMainCommand("-bang Hgcommit :execute s:HgCommit(<bang>0, 0)") 605 call s:AddMainCommand("-bang Hgcommit :execute s:HgCommit(<bang>0, 0)")