Mercurial > emacs
comparison lisp/vc-svn.el @ 76025:a4103f62dec5
Remove the code inherited from CVSREAD and `cvs edit'.
(vc-svn-use-edit): Remove unused config var.
(vc-svn-update, vc-svn-revert): Checkout is always implicit.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 19 Feb 2007 19:42:10 +0000 |
parents | a8fd93a515a2 |
children | 9355f9b7bbff 114ec88248f4 dd7c098af727 |
comparison
equal
deleted
inserted
replaced
76024:00669875e4fe | 76025:a4103f62dec5 |
---|---|
83 "*Header keywords to be inserted by `vc-insert-headers'." | 83 "*Header keywords to be inserted by `vc-insert-headers'." |
84 :version "22.1" | 84 :version "22.1" |
85 :type '(repeat string) | 85 :type '(repeat string) |
86 :group 'vc) | 86 :group 'vc) |
87 | 87 |
88 (defconst vc-svn-use-edit nil | 88 ;; We want to autoload it for use by the autoloaded version of |
89 ;; Subversion does not provide this feature (yet). | 89 ;; vc-svn-registered, but we want the value to be compiled at startup, not |
90 "*Non-nil means to use `svn edit' to \"check out\" a file. | 90 ;; at dump time. |
91 This is only meaningful if you don't use the implicit checkout model | 91 ;; ;;;###autoload |
92 \(i.e. if you have $SVNREAD set)." | 92 (defconst vc-svn-admin-directory |
93 ;; :type 'boolean | 93 (cond ((and (memq system-type '(cygwin windows-nt ms-dos)) |
94 ;; :version "22.1" | |
95 ;; :group 'vc | |
96 ) | |
97 | |
98 (defvar vc-svn-admin-directory | |
99 (cond ((and (eq system-type 'windows-nt) | |
100 (getenv "SVN_ASP_DOT_NET_HACK")) | 94 (getenv "SVN_ASP_DOT_NET_HACK")) |
101 "_svn") | 95 "_svn") |
102 (t ".svn")) | 96 (t ".svn")) |
103 "The name of the \".svn\" subdirectory or its equivalent.") | 97 "The name of the \".svn\" subdirectory or its equivalent.") |
104 | 98 |
109 ;;; vc-svn-admin-directory is generally not defined when the | 103 ;;; vc-svn-admin-directory is generally not defined when the |
110 ;;; autoloaded function is called. | 104 ;;; autoloaded function is called. |
111 | 105 |
112 ;;;###autoload (defun vc-svn-registered (f) | 106 ;;;###autoload (defun vc-svn-registered (f) |
113 ;;;###autoload (let ((admin-dir (cond ((and (eq system-type 'windows-nt) | 107 ;;;###autoload (let ((admin-dir (cond ((and (eq system-type 'windows-nt) |
114 ;;;###autoload (getenv "SVN_ASP_DOT_NET_HACK")) | 108 ;;;###autoload (getenv "SVN_ASP_DOT_NET_HACK")) |
115 ;;;###autoload "_svn") | 109 ;;;###autoload "_svn") |
116 ;;;###autoload (t ".svn")))) | 110 ;;;###autoload (t ".svn")))) |
117 ;;;###autoload (when (file-readable-p (expand-file-name | 111 ;;;###autoload (when (file-readable-p (expand-file-name |
118 ;;;###autoload (concat admin-dir "/entries") | 112 ;;;###autoload (concat admin-dir "/entries") |
119 ;;;###autoload (file-name-directory f))) | 113 ;;;###autoload (file-name-directory f))) |
120 ;;;###autoload (load "vc-svn") | 114 ;;;###autoload (load "vc-svn") |
121 ;;;###autoload (vc-svn-registered f)))) | 115 ;;;###autoload (vc-svn-registered f)))) |
122 | 116 |
123 ;;;###autoload | 117 ;;;###autoload |
124 (add-to-list 'completion-ignored-extensions ".svn/") | 118 (add-to-list 'completion-ignored-extensions ".svn/") |
272 (vc-mode-line file) | 266 (vc-mode-line file) |
273 (message "Checking out %s...done" file)) | 267 (message "Checking out %s...done" file)) |
274 | 268 |
275 (defun vc-svn-update (file editable rev switches) | 269 (defun vc-svn-update (file editable rev switches) |
276 (if (and (file-exists-p file) (not rev)) | 270 (if (and (file-exists-p file) (not rev)) |
277 ;; If no revision was specified, just make the file writable | 271 ;; If no revision was specified, there's nothing to do. |
278 ;; if necessary (using `svn-edit' if requested). | 272 nil |
279 (and editable (not (eq (vc-svn-checkout-model file) 'implicit)) | |
280 (if vc-svn-use-edit | |
281 (vc-svn-command nil 0 file "edit") | |
282 (set-file-modes file (logior (file-modes file) 128)) | |
283 (if (equal file buffer-file-name) (toggle-read-only -1)))) | |
284 ;; Check out a particular version (or recreate the file). | 273 ;; Check out a particular version (or recreate the file). |
285 (vc-file-setprop file 'vc-workfile-version nil) | 274 (vc-file-setprop file 'vc-workfile-version nil) |
286 (apply 'vc-svn-command nil 0 file | 275 (apply 'vc-svn-command nil 0 file |
287 "update" | 276 "update" |
288 ;; default for verbose checkout: clear the sticky tag so | 277 ;; default for verbose checkout: clear the sticky tag so |
300 (vc-svn-command nil 0 new "move" (file-relative-name old))) | 289 (vc-svn-command nil 0 new "move" (file-relative-name old))) |
301 | 290 |
302 (defun vc-svn-revert (file &optional contents-done) | 291 (defun vc-svn-revert (file &optional contents-done) |
303 "Revert FILE to the version it was based on." | 292 "Revert FILE to the version it was based on." |
304 (unless contents-done | 293 (unless contents-done |
305 (vc-svn-command nil 0 file "revert")) | 294 (vc-svn-command nil 0 file "revert"))) |
306 (unless (eq (vc-checkout-model file) 'implicit) | |
307 (if vc-svn-use-edit | |
308 (vc-svn-command nil 0 file "unedit") | |
309 ;; Make the file read-only by switching off all w-bits | |
310 (set-file-modes file (logand (file-modes file) 3950))))) | |
311 | 295 |
312 (defun vc-svn-merge (file first-version &optional second-version) | 296 (defun vc-svn-merge (file first-version &optional second-version) |
313 "Merge changes into current working copy of FILE. | 297 "Merge changes into current working copy of FILE. |
314 The changes are between FIRST-VERSION and SECOND-VERSION." | 298 The changes are between FIRST-VERSION and SECOND-VERSION." |
315 (vc-svn-command nil 0 file | 299 (vc-svn-command nil 0 file |