# HG changeset patch # User Ludovic Chabant # Date 1330060828 28800 # Node ID 9361f6b9e5a49c917913f86e8a0ced20083731cf # Parent c3958d29878e93a22d38e1290159d7873460aba2 Added `Hgrevert` command. diff -r c3958d29878e -r 9361f6b9e5a4 plugin/lawrencium.vim --- a/plugin/lawrencium.vim Wed Dec 28 11:24:53 2011 -0800 +++ b/plugin/lawrencium.vim Thu Feb 23 21:20:28 2012 -0800 @@ -783,6 +783,29 @@ " }}} +" Hgrevert {{{ + +function! s:HgRevert(bang, ...) abort + " Get the files to revert. + let l:filenames = a:000 + if a:0 == 0 + let l:filenames = [ expand('%:p') ] + endif + if a:bang + call insert(l:filenames, '--no-backup', 0) + endif + + " Get the repo. + let l:repo = s:hg_repo() + + " Run the command. + call l:repo.RunCommand('revert', l:filenames) +endfunction + +call s:AddMainCommand("-bang -nargs=* -complete=customlist,s:ListRepoFiles Hgrevert :call s:HgRevert(0, )") + +" }}} + " Autoload Functions {{{ " Prints a summary of the current repo (if any) that's appropriate for