# HG changeset patch # User Ludovic Chabant # Date 1444110960 25200 # Node ID 4ca40abecc2af0ae24bf48cef50657e9f1aa78f6 # Parent 7cfe9ba2c7dd99c25bbf2992fe928447e0b3de4a Add `:Hgremove` command. diff -r 7cfe9ba2c7dd -r 4ca40abecc2a doc/lawrencium.txt --- a/doc/lawrencium.txt Sun Mar 15 08:32:45 2015 -0700 +++ b/doc/lawrencium.txt Mon Oct 05 22:56:00 2015 -0700 @@ -162,13 +162,22 @@ :Hgrevert {files} *:Hgrevert* Reverts the given files (in repo-relative paths). If no - file are given, reverts the current file. + files 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. +:Hgremove {files} *:Hgremove* + Removes the given files (in repo-relative paths). If + no files are given, removes the current file. + +:Hgremove! {files} *:Hgremove!* + Same as |:Hgremove| but with the --force option given + to remove the file even if it is currently added or + modified. + *:Hglog* :Hglog Opens the history (log) for the current repository diff -r 7cfe9ba2c7dd -r 4ca40abecc2a plugin/lawrencium.vim --- a/plugin/lawrencium.vim Sun Mar 15 08:32:45 2015 -0700 +++ b/plugin/lawrencium.vim Mon Oct 05 22:56:00 2015 -0700 @@ -1726,6 +1726,30 @@ " }}} +" Hgremove {{{ + +function! s:HgRemove(bang, ...) abort + " Get the files to remove. + let l:filenames = a:000 + if a:0 == 0 + let l:filenames = [ expand('%:p') ] + endif + if a:bang + call insert(l:filenames, '--force', 0) + endif + + " Get the repo and run the command. + let l:repo = s:hg_repo() + call l:repo.RunCommand('rm', l:filenames) + + " Re-edit the file to see the change. + edit +endfunction + +call s:AddMainCommand("-bang -nargs=* -complete=customlist,s:ListRepoFiles Hgremove :call s:HgRemove(0, )") + +" }}} + " Hglog, Hglogthis {{{ function! s:HgLog(vertical, ...) abort