Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Taiki Sugawara February 12, 2012
file 79 lines (61 sloc) 2.479 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
;;; vc-svn17.el --- Subversion 1.7 support for vc-svn on Emacs23

;; Copyright (C) 2012 Taiki SUGAWARA <buzz.taiki@gmail.com>

;; Author: Taiki SUGAWARA <buzz.taiki@gmail.com>
;; Maintainer: Taiki SUGAWARA <buzz.taiki@gmail.com>
;; Version: 0.01
;; URL: https://github.com/buzztaiki/vc-svn17-el

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This package provides subversion 1.7 support for vc-svn on Emacs23.
;;
;; To use this package, put followings in your .emacs:
;;
;; (require 'vc-svn17)

;;; Code:

(require 'vc-svn)

(defmacro vc-svn17-defun (name args &rest body)
  (declare (indent defun))
  `(when (<= emacs-major-version 23)
     ,(if (stringp (car body))
`(defun ,name ,args ,(car body) ,@(cdr body))
`(defun ,name ,args nil ,@body))))

(defmacro vc-svn17-repfun (name args &rest body)
  (declare (indent defun))
  `(when (<= emacs-major-version 23)
     (defadvice ,name (around vc-svn17 ,args activate)
       (setq ad-return-value ,@body))))


(vc-svn17-defun vc-svn-root (file)
  (vc-find-root file vc-svn-admin-directory))

(vc-svn17-repfun vc-svn-registered (file)
  (when (vc-svn-root file)
    (with-temp-buffer
      (cd (file-name-directory file))
      (let* (process-file-side-effects
(status
(condition-case nil
;; Ignore all errors.
(vc-svn-command t t file "status" "-v")
(error nil))))
(when (eq 0 status)
(let ((parsed (vc-svn-parse-status file)))
(and parsed (not (memq parsed '(ignored unregistered))))))))))

(vc-svn17-repfun vc-svn-responsible-p (file)
  (vc-svn-root file))

(vc-svn17-repfun vc-svn-repository-hostname (dirname)
  (with-temp-buffer
    (let (process-file-side-effects)
      (vc-svn-command t t dirname "info"))
    (goto-char (point-min))
    (when (re-search-forward "^URL: *\\(.*\\)" nil t)
      (match-string 1))))

(provide 'vc-svn17)
;;; vc-svn17.el ends here
Something went wrong with that request. Please try again.