# HG changeset patch # User Ludovic Chabant # Date 1330061148 28800 # Node ID 42c40b8144f833f0d08888eb692b75abb9ee6f48 # Parent a384b4aff211bd52891e7ce66278c07e6135bef4# Parent f9abc2e2aa90cbf5ff04b0b821dbbc39863256dc Merged changes. diff -r f9abc2e2aa90 -r 42c40b8144f8 doc/lawrencium.txt --- a/doc/lawrencium.txt Mon Feb 13 15:41:45 2012 -0800 +++ b/doc/lawrencium.txt Thu Feb 23 21:25:48 2012 -0800 @@ -82,6 +82,14 @@ :Hgvcommit Same as |:Hgcommit| but uses a vertical split to edit the commit message. +:Hgrevert {files} *:Hgrevert* + Reverts the given files (in repo-relative paths). If no + file are given, reverts the current file. + +:Hgrevert! {files} *:Hgrevert!* + Same as |:Hgrevert| but with the --no-backup option + given to prevent a .orig backup file from being + created. ============================================================================= diff -r f9abc2e2aa90 -r 42c40b8144f8 plugin/lawrencium.vim --- a/plugin/lawrencium.vim Mon Feb 13 15:41:45 2012 -0800 +++ b/plugin/lawrencium.vim Thu Feb 23 21:25:48 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