Mercurial > emacs
comparison lisp/vc-svn.el @ 94847:5e64dca662f0
Remove assumption about what nil means as a first arument to vc-do-command.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Sat, 10 May 2008 13:27:16 +0000 |
parents | eedf64b515f0 |
children | 4da572dc4992 |
comparison
equal
deleted
inserted
replaced
94846:1a6e4ea4e517 | 94847:5e64dca662f0 |
---|---|
206 ;;; State-changing functions | 206 ;;; State-changing functions |
207 ;;; | 207 ;;; |
208 | 208 |
209 (defun vc-svn-create-repo () | 209 (defun vc-svn-create-repo () |
210 "Create a new SVN repository." | 210 "Create a new SVN repository." |
211 (vc-do-command nil 0 "svnadmin" '("create" "SVN")) | 211 (vc-do-command "*vc*" 0 "svnadmin" '("create" "SVN")) |
212 (vc-do-command nil 0 "svn" '(".") | 212 (vc-do-command "*vc*" 0 "svn" '(".") |
213 "checkout" (concat "file://" default-directory "SVN"))) | 213 "checkout" (concat "file://" default-directory "SVN"))) |
214 | 214 |
215 (defun vc-svn-register (files &optional rev comment) | 215 (defun vc-svn-register (files &optional rev comment) |
216 "Register FILES into the SVN version-control system. | 216 "Register FILES into the SVN version-control system. |
217 The COMMENT argument is ignored This does an add but not a commit. | 217 The COMMENT argument is ignored This does an add but not a commit. |
387 (insert comment)) | 387 (insert comment)) |
388 (if fileurl-p | 388 (if fileurl-p |
389 ;; Repository Root is a local file. | 389 ;; Repository Root is a local file. |
390 (progn | 390 (progn |
391 (unless (vc-do-command | 391 (unless (vc-do-command |
392 nil 0 "svnadmin" nil | 392 "*vc*" 0 "svnadmin" nil |
393 "setlog" "--bypass-hooks" directory | 393 "setlog" "--bypass-hooks" directory |
394 "-r" rev (format "%s" tempfile)) | 394 "-r" rev (format "%s" tempfile)) |
395 (error "Log edit failed")) | 395 (error "Log edit failed")) |
396 (delete-file tempfile)) | 396 (delete-file tempfile)) |
397 | 397 |
398 ;; Remote repository, using svn+ssh. | 398 ;; Remote repository, using svn+ssh. |
399 (unless (vc-do-command nil 0 "scp" nil "-q" tempfile remotefile) | 399 (unless (vc-do-command "*vc*" 0 "scp" nil "-q" tempfile remotefile) |
400 (error "Copy of comment to %s failed" remotefile)) | 400 (error "Copy of comment to %s failed" remotefile)) |
401 (unless (vc-do-command | 401 (unless (vc-do-command |
402 nil 0 "ssh" nil "-q" host | 402 "*vc*" 0 "ssh" nil "-q" host |
403 (format "svnadmin setlog --bypass-hooks %s -r %s %s; rm %s" | 403 (format "svnadmin setlog --bypass-hooks %s -r %s %s; rm %s" |
404 directory rev tempfile tempfile)) | 404 directory rev tempfile tempfile)) |
405 (error "Log edit failed"))))) | 405 (error "Log edit failed"))))) |
406 | 406 |
407 ;;; | 407 ;;; |
515 | 515 |
516 (defun vc-svn-command (buffer okstatus file-or-list &rest flags) | 516 (defun vc-svn-command (buffer okstatus file-or-list &rest flags) |
517 "A wrapper around `vc-do-command' for use in vc-svn.el. | 517 "A wrapper around `vc-do-command' for use in vc-svn.el. |
518 The difference to vc-do-command is that this function always invokes `svn', | 518 The difference to vc-do-command is that this function always invokes `svn', |
519 and that it passes `vc-svn-global-switches' to it before FLAGS." | 519 and that it passes `vc-svn-global-switches' to it before FLAGS." |
520 (apply 'vc-do-command buffer okstatus vc-svn-program file-or-list | 520 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list |
521 (if (stringp vc-svn-global-switches) | 521 (if (stringp vc-svn-global-switches) |
522 (cons vc-svn-global-switches flags) | 522 (cons vc-svn-global-switches flags) |
523 (append vc-svn-global-switches | 523 (append vc-svn-global-switches |
524 flags)))) | 524 flags)))) |
525 | 525 |
623 ((eq status ?R) | 623 ((eq status ?R) |
624 (vc-file-setprop file 'vc-state 'removed)) | 624 (vc-file-setprop file 'vc-state 'removed)) |
625 (t 'edited))))) | 625 (t 'edited))))) |
626 (if filename (vc-file-getprop filename 'vc-state)))) | 626 (if filename (vc-file-getprop filename 'vc-state)))) |
627 | 627 |
628 (defun vc-svn-dir-state-heuristic (dir) | |
629 "Find the SVN state of all files in DIR, using only local information." | |
630 (vc-svn-dir-state dir 'local)) | |
631 | |
632 (defun vc-svn-valid-symbolic-tag-name-p (tag) | 628 (defun vc-svn-valid-symbolic-tag-name-p (tag) |
633 "Return non-nil if TAG is a valid symbolic tag name." | 629 "Return non-nil if TAG is a valid symbolic tag name." |
634 ;; According to the SVN manual, a valid symbolic tag must start with | 630 ;; According to the SVN manual, a valid symbolic tag must start with |
635 ;; an uppercase or lowercase letter and can contain uppercase and | 631 ;; an uppercase or lowercase letter and can contain uppercase and |
636 ;; lowercase letters, digits, `-', and `_'. | 632 ;; lowercase letters, digits, `-', and `_'. |