svn.vimãã¡ãã£ã¨ã ã便å©ã«
svn-diff.vim - Show diff when commiting changes on a subversion repository : vim online
Subversionã«ããã½ã¼ã¹ç®¡çãè¡ãªã£ã¦ããVimmerã®å¤ã(?)ã®æ¹ã¯ãsvn.vim(svn-diff.vim)ãå©ç¨ããã¦ããã¨æãã¾ãã
ãããªãç§ãå©ç¨ãã¦ãã¾ãããã³ãããæã«svn diffã®çµæã表示ãã¦ãããé常ã«ä¾¿å©ãªãã©ã°ã¤ã³ã§ãã
ããã¡ãã£ã¨ã ã便å©ã«
ã³ããããããã¡ã¤ã«ã®
- svn infoæ å ±(ã³ãããå URLã ã)
- æçµã³ããããã°
ã表示ããããã«ãã¦ã¿ã¾ããã
以ä¸ã®ããã«è¡¨ç¤ºããã¾ãã
URL: http://svn.com/repos/TestProject/trunk/hoge.pl ------------------------------------------------------------------------ r123 | tekiomo | 2011-01-11 19:43:39 +0900 (ç«, 11 1æ 2011) | 3 lines refs #10 hogeã1ååé¤ ------------------------------------------------------------------------ URL: http://svn.com/repos/TestProject/trunk/fuga.pl ------------------------------------------------------------------------ r234 | tekiomo | 2011-01-11 19:44:04 +0900 (ç«, 11 1æ 2011) | 3 lines refs #10 fugaã1å追å ------------------------------------------------------------------------ Index: trunk/hoge.pl =================================================================== --- trunk/hoge.pl (ãªãã¸ã§ã³ 123) +++ trunk/hoge.pl (ä½æ¥ã³ãã¼) @@ -12,4 +12,3 @@ hoge hoge -hoge (以ä¸çç¥)
diff
diffã¯ãããªæã
$ diff -u svn.vim.org svn.vim --- svn.vim.org 2011-01-11 20:04:36.175583001 +0900 +++ svn.vim 2011-01-11 20:03:31.455583000 +0900 @@ -22,26 +22,33 @@ function! Svn_diff_windows() let i = 0 - let list_of_files = '' + let files = [] while i <= line('$') let line = getline(i) if line =~ '^M' let file = substitute(line, '\v^MM?\s*(.*)\s*$', '\1', '') - let list_of_files = list_of_files . ' '.file + call add(files, file) endif let i = i + 1 endwhile - if list_of_files == "" + if len(files) == 0 return endif + + let list_of_files = join(files, ' ') new silent! setlocal ft=diff previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile - exe 'normal :r!LANG=C svn diff ' . list_of_files . "\n" + for file in files + execute 'normal :r!LANG=ja_JP.UTF8 svn info ' . file . " | grep 'URL:'\n" + execute 'normal :r!LANG=ja_JP.UTF8 svn log -r PREV:HEAD --limit=1 ' . file . "\n" + endfor + + execute 'normal :r!LANG=ja_JP.UTF8 svn diff ' . list_of_files . "\n" setlocal nomodifiable goto 1 redraw!
svn logé¨åãç´ãã¾ãã
ãã°ãæã£ã¦ãããªãã¨ãããã£ã¦ç¤¾é·ãä¿®æ£ãã¦ãã ããã¾ãããå·®åã¯âã§ãã(ä¸è¨ã®diffã¯ä¿®æ£æ¸ã¿)
- execute 'normal :r!LANG=ja_JP.UTF8 svn log -r BASE ' . file . "\n" + execute 'normal :r!LANG=ja_JP.UTF8 svn log -r PREV:HEAD --limit=1 ' . file . "\n"
ã³ãããæã®ãã¹ãã¡ãã£ã¨ã ãé²ããããã«ãªãããªã¼ã¨æãã¾ãã