;;; vc-svn.el --- non-resident support for Subversion version-control
-;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation, Inc.
;; Author: FSF (see vc.el for full credits)
:group 'vc)
(defcustom vc-svn-register-switches nil
- "Extra switches for registering a file into SVN.
+ "Switches for registering a file into SVN.
A string or list of strings passed to the checkin program by
-\\[vc-register]."
- :type '(choice (const :tag "None" nil)
+\\[vc-register]. If nil, use the value of `vc-register-switches'.
+If t, use no switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
(string :tag "Argument String")
- (repeat :tag "Argument List"
- :value ("")
- string))
+ (repeat :tag "Argument List" :value ("") string))
:version "22.1"
:group 'vc)
;;;###autoload (load "vc-svn")
;;;###autoload (vc-svn-registered f))))
-;;;###autoload
-(add-to-list 'completion-ignored-extensions ".svn/")
-
(defun vc-svn-registered (file)
"Check if FILE is SVN registered."
(when (file-readable-p (expand-file-name (concat vc-svn-admin-directory
(?? . unregistered)
;; This is what vc-svn-parse-status does.
(?~ . edited)))
- (re (if remote "^\\(.\\)..... \\([ *]\\) +[-0-9]+ +\\(.*\\)$"
+ (re (if remote "^\\(.\\)..... \\([ *]\\) +\\(?:[-0-9]+\\)? \\(.*\\)$"
;; Subexp 2 is a dummy in this case, so the numbers match.
"^\\(.\\)....\\(.\\) \\(.*\\)$"))
result)
;; FIXME are there other possible combinations?
(cond ((eq state 'edited) (setq state 'needs-merge))
((not state) (setq state 'needs-update))))
- (when state
+ (when (and state (not (string= "." filename)))
(setq result (cons (list filename state) result)))))
(funcall callback result)))
CALLBACK is called as (CALLBACK RESULT BUFFER), where
RESULT is a list of conses (FILE . STATE) for directory DIR."
;; FIXME should this rather be all the files in dir?
- (let* ((local (vc-stay-local-p dir))
- (remote (and local (not (eq local 'only-file)))))
+ ;; FIXME: the vc-stay-local-p logic below is disabled, it ends up
+ ;; calling synchronously (vc-svn-registered DIR) => calling svn status -v DIR
+ ;; which is VERY SLOW for big trees and it makes emacs
+ ;; completely unresponsive during that time.
+ (let* ((local (and nil (vc-stay-local-p dir)))
+ (remote (or t (not local) (eq local 'only-file))))
(vc-svn-command (current-buffer) 'async nil "status"
(if remote "-u"))
(vc-exec-after
(vc-do-command "*vc*" 0 vc-svn-program '(".")
"checkout" (concat "file://" default-directory "SVN")))
-;; FIXME doc is wrong re switches.
(defun vc-svn-register (files &optional rev comment)
"Register FILES into the SVN version-control system.
The COMMENT argument is ignored This does an add but not a commit.
-
-`vc-register-switches' and `vc-svn-register-switches' are passed to
-the SVN command (in that order)."
+Passes either `vc-svn-register-switches' or `vc-register-switches'
+to the SVN command."
(apply 'vc-svn-command nil 0 files "add" (vc-switches 'SVN 'register)))
(defun vc-svn-responsible-p (file)
(defun vc-svn-diff (files &optional oldvers newvers buffer)
"Get a difference report using SVN between two revisions of fileset FILES."
(and oldvers
+ (not newvers)
files
(catch 'no
(dolist (f files)