comparison plugin/lawrencium.vim @ 119:4ca40abecc2a

Add `:Hgremove` command.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 05 Oct 2015 22:56:00 -0700
parents 2e38e754c896
children 5168645017dd
comparison
equal deleted inserted replaced
118:7cfe9ba2c7dd 119:4ca40abecc2a
1724 1724
1725 call s:AddMainCommand("-bang -nargs=* -complete=customlist,s:ListRepoFiles Hgrevert :call s:HgRevert(<bang>0, <f-args>)") 1725 call s:AddMainCommand("-bang -nargs=* -complete=customlist,s:ListRepoFiles Hgrevert :call s:HgRevert(<bang>0, <f-args>)")
1726 1726
1727 " }}} 1727 " }}}
1728 1728
1729 " Hgremove {{{
1730
1731 function! s:HgRemove(bang, ...) abort
1732 " Get the files to remove.
1733 let l:filenames = a:000
1734 if a:0 == 0
1735 let l:filenames = [ expand('%:p') ]
1736 endif
1737 if a:bang
1738 call insert(l:filenames, '--force', 0)
1739 endif
1740
1741 " Get the repo and run the command.
1742 let l:repo = s:hg_repo()
1743 call l:repo.RunCommand('rm', l:filenames)
1744
1745 " Re-edit the file to see the change.
1746 edit
1747 endfunction
1748
1749 call s:AddMainCommand("-bang -nargs=* -complete=customlist,s:ListRepoFiles Hgremove :call s:HgRemove(<bang>0, <f-args>)")
1750
1751 " }}}
1752
1729 " Hglog, Hglogthis {{{ 1753 " Hglog, Hglogthis {{{
1730 1754
1731 function! s:HgLog(vertical, ...) abort 1755 function! s:HgLog(vertical, ...) abort
1732 " Get the file or directory to get the log from. 1756 " Get the file or directory to get the log from.
1733 " (empty string is for the whole repository) 1757 " (empty string is for the whole repository)