# HG changeset patch # User Ludovic Chabant # Date 1323407524 28800 # Node ID 3a4f9f41a7e2c84ee473052a1e791331ccf4ada6 # Parent b6e4446ed2924a8b6cb93421614617b039fbdb6e Use a hackish shortcut to get the current branch faster for the statusline. diff -r b6e4446ed292 -r 3a4f9f41a7e2 plugin/lawrencium.vim --- a/plugin/lawrencium.vim Thu Dec 08 17:19:52 2011 -0800 +++ b/plugin/lawrencium.vim Thu Dec 08 21:12:04 2011 -0800 @@ -292,10 +292,11 @@ if !exists('b:mercurial_dir') return '' endif - let l:summary = s:hg_repo().RunCommand('summary') - let l:parent_rev = matchstr(l:summary, 'parent\: \d+\:[0-9a-f]+') - let l:branch = matchstr(l:summary, 'branch\: [\d\w\-_\.]+') - return l:branch . ', ' . l:parent_rev + let l:prefix = (a:0 > 0 ? a:1 : '') + let l:suffix = (a:0 > 1 ? a:2 : '') + let l:branch_file = s:hg_repo().GetFullPath('.hg/branch') + let l:branch = readfile(l:branch_file)[0] + return l:prefix . l:branch . l:suffix endfunction " Rescans the current buffer for setting up Mercurial commands.