comparison plugin/lawrencium.vim @ 12:a7bf37a97a1b

Clean the 'HG:' lines from the commit message (apparently 'hg commit' doesn't do it with -o).
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 12 Dec 2011 15:59:15 -0800
parents b4baab0a4a92
children eab2680e6818
comparison
equal deleted inserted replaced
11:b4baab0a4a92 12:a7bf37a97a1b
466 if !filereadable(a:log_file) 466 if !filereadable(a:log_file)
467 call s:trace("Commit message was not saved... abort commit.") 467 call s:trace("Commit message was not saved... abort commit.")
468 return 468 return
469 endif 469 endif
470 470
471 call s:trace("Committing with log file: " . a:log_file)
472
473 " Clean up all the 'HG:' lines from the commit message.
474 let l:lines = readfile(a:log_file)
475 call filter(l:lines, "v:val !~# '\\v^HG:'")
476 call writefile(l:lines, a:log_file)
477
471 " Get the repo and commit with the given message. 478 " Get the repo and commit with the given message.
472 call s:trace("Committing with log file: " . a:log_file)
473 let l:repo = s:hg_repo() 479 let l:repo = s:hg_repo()
474 let l:output = l:repo.RunCommand('commit', '-l', a:log_file) 480 let l:output = l:repo.RunCommand('commit', '-l', a:log_file)
475 if a:show_output 481 if a:show_output
476 echom l:output 482 echom l:output
477 endif 483 endif