tortoise-svn.el を追加

TortoiseSVNemacsから呼べると便利だと思ったので作成してみました。
結構便利かも。

使い方

キーバインドはなんとなくvc-modeにあわせてあります。

C-x v l ログを表示
C-x v L ログを表示(ディレクトリ、もしくはファイル指定)

C-x v = 差分を表示

C-x v b 注釈履歴を表示

C-x v c コミット
C-x v C コミット(ディレクトリ、もしくはファイル指定)

C-x v s 変更をチェック
C-x v S 変更をチェック(ディレクトリ、もしくはファイル指定)

C-x v r 元に戻す
C-x v R 元に戻す(ディレクトリ、もしくはファイル指定)

C-x v h ヘルプを表示

ソース

;;; tortoise-svn.el

;;; Commentary:
;; tortoise-svn キーバインド

(defun tortoise-command (command filename)
  (call-process-shell-command
   (concat "TortoiseProc /command:" command " "
	   "/path:\"" (expand-file-name filename) "\"")))

(defun tortoise-svn-log ()
  (interactive)
  (tortoise-svn-log-select (buffer-file-name)))

(defun tortoise-svn-log-select (filename &optional wildcards)
  (interactive (find-file-read-args "Find file: " t))
  (tortoise-command "log" filename))

(defun tortoise-svn-diff ()
  (interactive)
  (tortoise-command "diff" (buffer-file-name)))

(defun tortoise-svn-blame ()
 (interactive)
 (tortoise-command "blame" (buffer-file-name)))

(defun tortoise-svn-commit ()		; ログ入力させてもいいかも
  (interactive)
  (tortoise-svn-commit-select (buffer-file-name)))

(defun tortoise-svn-commit-select (filename &optional wildcards)
  (interactive (find-file-read-args "Find file: " t))
  (call-process-shell-command
   (concat "TortoiseProc /command:commit "
	   "/path:\"" (expand-file-name filename) "\""
	   )))

(defun tortoise-svn-repostatus ()
  (interactive)
  (tortoise-svn-repostatus-select (buffer-file-name)))

(defun tortoise-svn-repostatus-select (filename &optional wildcards)
  (interactive (find-file-read-args "Find file: " t))
  (tortoise-command "repostatus" filename))

(defun tortoise-svn-revert ()
  (interactive)
  (tortoise-svn-revert-select (buffer-file-name)))

(defun tortoise-svn-revert-select (filename &optional wildcards)
  (interactive (find-file-read-args "Find file: " t))
  (tortoise-command "revert" filename))

(defun tortoise-svn-help ()
 (interactive)
 (call-process-shell-command
  (concat "TortoiseProc /command:help")))

; キーバインド設定
(global-set-key "\C-xvl" 'tortoise-svn-log)
(global-set-key "\C-xvL" 'tortoise-svn-log-select)

(global-set-key "\C-xv=" 'tortoise-svn-diff)

(global-set-key "\C-xvb" 'tortoise-svn-blame)

(global-set-key "\C-xvc" 'tortoise-svn-commit)
(global-set-key "\C-xvC" 'tortoise-svn-commit-select)

(global-set-key "\C-xvs" 'tortoise-svn-repostatus)
(global-set-key "\C-xvS" 'tortoise-svn-repostatus-select)

(global-set-key "\C-xvr" 'tortoise-svn-revert)
(global-set-key "\C-xvR" 'tortoise-svn-revert-select)

(global-set-key "\C-xvh" 'tortoise-svn-help)

(provide 'tortoise-svn)