1 ;;; vc-svn17.el --- Subversion 1.7 support for vc-svn on Emacs23
3 ;; Copyright (C) 2012 Taiki SUGAWARA <buzz.taiki@gmail.com>
5 ;; Author: Taiki SUGAWARA <buzz.taiki@gmail.com>
6 ;; Maintainer: Taiki SUGAWARA <buzz.taiki@gmail.com>
8 ;; URL: https://github.com/buzztaiki/vc-svn17-el
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ;; This package provides subversion 1.7 support for vc-svn on Emacs23.
27 ;; To use this package, put followings in your .emacs:
29 ;; (require 'vc-svn17)
35 (defmacro vc-svn17-defun (name args &rest body)
36 (declare (indent defun))
37 `(when (<= emacs-major-version 23)
38 ,(if (stringp (car body))
39 `(defun ,name ,args ,(car body) ,@(cdr body))
40 `(defun ,name ,args nil ,@body))))
42 (defmacro vc-svn17-repfun (name args &rest body)
43 (declare (indent defun))
44 `(when (<= emacs-major-version 23)
45 (defadvice ,name (around vc-svn17 ,args activate)
46 (setq ad-return-value ,@body))))
49 (vc-svn17-defun vc-svn-root (file)
50 (vc-find-root file vc-svn-admin-directory))
52 (vc-svn17-repfun vc-svn-registered (file)
53 (when (vc-svn-root file)
55 (cd (file-name-directory file))
56 (let* (process-file-side-effects
60 (vc-svn-command t t file "status" "-v")
63 (let ((parsed (vc-svn-parse-status file)))
64 (and parsed (not (memq parsed '(ignored unregistered))))))))))
66 (vc-svn17-repfun vc-svn-responsible-p (file)
69 (vc-svn17-repfun vc-svn-repository-hostname (dirname)
71 (let (process-file-side-effects)
72 (vc-svn-command t t dirname "info"))
73 (goto-char (point-min))
74 (when (re-search-forward "^URL: *\\(.*\\)" nil t)
78 ;;; vc-svn17.el ends here