From 34ca0f4c796bca424a0e3033b419eb15b79a2f59 Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Sat, 5 Oct 2013 07:47:00 +0800 Subject: [PATCH] New functions for finding the administrative directory in VC. * vc/vc-svn.el (vc-svn-find-admin-dir): * vc/vc-rcs.el (vc-rcs-find-admin-dir): * vc/vc-mtn.el (vc-mtn-find-admin-dir): * vc/vc-cvs.el (vc-cvs-find-admin-dir): * vc/vc-arch.el (vc-arch-find-admin-dir): New functions. --- lisp/ChangeLog | 8 ++++++++ lisp/vc/vc-arch.el | 4 ++++ lisp/vc/vc-cvs.el | 4 ++++ lisp/vc/vc-mtn.el | 3 +++ lisp/vc/vc-rcs.el | 4 ++++ lisp/vc/vc-svn.el | 4 ++++ lisp/vc/vc.el | 4 ++++ 7 files changed, 31 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2f996cba224..427c7394bff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-10-04 Xue Fuqiao + + * vc/vc-svn.el (vc-svn-find-admin-dir): + * vc/vc-rcs.el (vc-rcs-find-admin-dir): + * vc/vc-mtn.el (vc-mtn-find-admin-dir): + * vc/vc-cvs.el (vc-cvs-find-admin-dir): + * vc/vc-arch.el (vc-arch-find-admin-dir): New functions. + 2013-10-04 Stefan Monnier * textmodes/css-mode.el (css-smie-rules): Toplevel's a list (bug#15467). diff --git a/lisp/vc/vc-arch.el b/lisp/vc/vc-arch.el index e9c65b49202..6ef66f2402a 100644 --- a/lisp/vc/vc-arch.el +++ b/lisp/vc/vc-arch.el @@ -227,6 +227,10 @@ Only the value `maybe' can be trusted :-(." (vc-file-setprop file 'arch-root root))))) +(defun vc-arch-find-admin-dir (file) + "Return the administrative directory of FILE." + (expand-file-name "{arch}" (vc-arch-root file))) + (defun vc-arch-register (files &optional rev _comment) (if rev (error "Explicit initial revision not supported for Arch")) (dolist (file files) diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 57e23aba4d9..db3895ccbd1 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -1226,6 +1226,10 @@ is non-nil." table (lambda () (vc-cvs-revision-table (car files)))))) table)) +(defun vc-cvs-find-admin-dir (file) + "Return the administrative directory of FILE." + (vc-find-root file "CVS")) + (defun vc-cvs-ignore (file &optional _directory _remove) "Ignore FILE under CVS." (vc-cvs-append-to-ignore (file-name-directory file) file)) diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 56536a26b41..22e4004d49b 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -86,6 +86,9 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (vc-file-setprop file 'vc-mtn-root (vc-find-root file vc-mtn-admin-format)))) +(defun vc-mtn-find-admin-dir (file) + "Return the administrative directory of FILE." + (expand-file-name vc-mtn-admin-dir (vc-mtn-root file))) (defun vc-mtn-registered (file) (let ((root (vc-mtn-root file))) diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index ef1ae8294b2..618250dedab 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -593,6 +593,10 @@ files beneath it." (and newvers (concat "-r" newvers))) (vc-switches 'RCS 'diff)))) +(defun vc-rcs-find-admin-dir (file) + "Return the administrative directory of FILE." + (vc-find-root file "RCS")) + (defun vc-rcs-comment-history (file) "Return a string with all log entries stored in BACKEND for FILE." (with-current-buffer "*vc*" diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 36f27548123..1fd51dd2148 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -361,6 +361,10 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY." "Return the list of ignored files." ) +(defun vc-svn-find-admin-dir (file) + "Return the administrative directory of FILE." + (expand-file-name vc-svn-admin-directory (vc-svn-root file))) + (defun vc-svn-checkout (file &optional editable rev) (message "Checking out %s..." file) (with-current-buffer (or (get-file-buffer file) (current-buffer)) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 69098efc50b..13f0d836f91 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -347,6 +347,10 @@ ;; ;; Mark conflicts as resolved. Some VC systems need to run a ;; command to mark conflicts as resolved. +;; +;; - find-admin-dir (file) +;; +;; Return the administrative directory of FILE. ;; HISTORY FUNCTIONS ;; -- 2.39.2