aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-24 00:58:07 +0000
committerRichard M. Stallman1994-09-24 00:58:07 +0000
commit29fc1ce99358a577c8c0fde7eaebc0f2958166b6 (patch)
treef52e93e2351e03692425c8bcc73010658215da3e
parent403ca74580dc9bff22ecf4027a4cd81150e53eed (diff)
downloademacs-29fc1ce99358a577c8c0fde7eaebc0f2958166b6.tar.gz
emacs-29fc1ce99358a577c8c0fde7eaebc0f2958166b6.zip
(vc-backend-checkout): Add if-statements to the shell cmds
to discard the extra arg some shells make. (vc-rename-file): Add autoload cookie. (vc-steal-lock): (1) Function should be non-interactive, because it doesn't work when called directly by the user. (2) Don't display revision "nil" when stealing lock if revision is unknown. (3) Put "Stolen lock on <file>" instead of just the file name in the Subject of the notification message.
-rw-r--r--lisp/vc.el54
1 files changed, 34 insertions, 20 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 11602b8d502..77101d1615d 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -584,24 +584,28 @@ level to check it in under. COMMENT, if specified, is the checkin comment."
584 584
585(defun vc-steal-lock (file rev &optional owner) 585(defun vc-steal-lock (file rev &optional owner)
586 "Steal the lock on the current workfile." 586 "Steal the lock on the current workfile."
587 (interactive) 587 (let (file-description)
588 (if (not owner) 588 (if (not owner)
589 (setq owner (vc-locking-user file))) 589 (setq owner (vc-locking-user file)))
590 (if (not (y-or-n-p (format "Take the lock on %s:%s from %s? " file rev owner))) 590 (if rev
591 (error "Steal cancelled")) 591 (setq file-description (format "%s:%s" file rev))
592 (pop-to-buffer (get-buffer-create "*VC-mail*")) 592 (setq file-description file))
593 (setq default-directory (expand-file-name "~/")) 593 (if (not (y-or-n-p (format "Take the lock on %s from %s? "
594 (auto-save-mode auto-save-default) 594 file-description owner)))
595 (mail-mode) 595 (error "Steal cancelled"))
596 (erase-buffer) 596 (pop-to-buffer (get-buffer-create "*VC-mail*"))
597 (mail-setup owner (format "%s:%s" file rev) nil nil nil 597 (setq default-directory (expand-file-name "~/"))
598 (list (list 'vc-finish-steal file rev))) 598 (auto-save-mode auto-save-default)
599 (goto-char (point-max)) 599 (mail-mode)
600 (insert 600 (erase-buffer)
601 (format "I stole the lock on %s:%s, " file rev) 601 (mail-setup owner (format "Stolen lock on %s" file-description) nil nil nil
602 (current-time-string) 602 (list (list 'vc-finish-steal file rev configuration)))
603 ".\n") 603 (goto-char (point-max))
604 (message "Please explain why you stole the lock. Type C-c C-c when done.")) 604 (insert
605 (format "I stole the lock on %s, " file-description)
606 (current-time-string)
607 ".\n")
608 (message "Please explain why you stole the lock. Type C-c C-c when done.")))
605 609
606;; This is called when the notification has been sent. 610;; This is called when the notification has been sent.
607(defun vc-finish-steal (file version) 611(defun vc-finish-steal (file version)
@@ -1183,6 +1187,7 @@ A prefix argument means do not revert the buffer afterwards."
1183 (vc-checkout (buffer-file-name) nil))) 1187 (vc-checkout (buffer-file-name) nil)))
1184 )) 1188 ))
1185 1189
1190;;;###autoload
1186(defun vc-rename-file (old new) 1191(defun vc-rename-file (old new)
1187 "Rename file OLD to NEW, and rename its master file likewise." 1192 "Rename file OLD to NEW, and rename its master file likewise."
1188 (interactive "fVC rename file: \nFRename to: ") 1193 (interactive "fVC rename file: \nFRename to: ")
@@ -1541,7 +1546,13 @@ Return nil if there is no such person."
1541 (progn 1546 (progn
1542 (vc-do-command 1547 (vc-do-command
1543 0 "/bin/sh" file "-c" 1548 0 "/bin/sh" file "-c"
1544 (format "umask %o; exec >\"$1\" || exit; shift; umask %o; exec get \"$@\"" 1549 ;; Some shells make the "" dummy argument into $0
1550 ;; while others use the shell's name as $0 and
1551 ;; use the "" as $1. The if-statement
1552 ;; converts the latter case to the former.
1553 (format "if [ x\"$1\" = x ]; then shift; fi; \
1554 umask %o; exec >\"$1\" || exit; \
1555 shift; umask %o; exec get \"$@\""
1545 (logand 511 (lognot vc-modes)) 1556 (logand 511 (lognot vc-modes))
1546 (logand 511 (lognot (default-file-modes)))) 1557 (logand 511 (lognot (default-file-modes))))
1547 "" ; dummy argument for shell's $0 1558 "" ; dummy argument for shell's $0
@@ -1563,7 +1574,10 @@ Return nil if there is no such person."
1563 (progn 1574 (progn
1564 (vc-do-command 1575 (vc-do-command
1565 0 "/bin/sh" file "-c" 1576 0 "/bin/sh" file "-c"
1566 (format "umask %o; exec >\"$1\" || exit; shift; umask %o; exec co \"$@\"" 1577 ;; See the SCCS case, above, regarding the if-statement.
1578 (format "if [ x\"$1\" = x ]; then shift; fi; \
1579 umask %o; exec >\"$1\" || exit; \
1580 shift; umask %o; exec co \"$@\""
1567 (logand 511 (lognot vc-modes)) 1581 (logand 511 (lognot vc-modes))
1568 (logand 511 (lognot (default-file-modes)))) 1582 (logand 511 (lognot (default-file-modes))))
1569 "" ; dummy argument for shell's $0 1583 "" ; dummy argument for shell's $0