Function: vc-steal-lock

vc-steal-lock is a byte-compiled function defined in vc.el.gz.

Signature

(vc-steal-lock FILE REV OWNER)

Documentation

Steal the lock on FILE.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc-steal-lock (file rev owner)
  "Steal the lock on FILE."
  (let (file-description)
    (if rev
	(setq file-description (format "%s:%s" file rev))
      (setq file-description file))
    (when (not (yes-or-no-p (format "Steal the lock on %s from %s? "
				    file-description owner)))
      (error "Steal canceled"))
    (message "Stealing lock on %s..." file)
    (with-vc-properties
     (list file)
     (vc-call steal-lock file rev)
     `((vc-state . edited)))
    (vc-resynch-buffer file t t)
    (message "Stealing lock on %s...done" file)
    ;; Write mail after actually stealing, because if the stealing
    ;; goes wrong, we don't want to send any mail.
    (compose-mail owner (format "Stolen lock on %s" file-description))
    (setq default-directory (expand-file-name "~/"))
    (cond
     ((eq mail-user-agent 'sendmail-user-agent)
      (mail-text))
     ((message-goto-body)))
    (insert
     (format "I stole the lock on %s, " file-description)
     (current-time-string)
     ".\n")
    (message
     (substitute-command-keys
      "Please explain why you stole the lock.  Type \\`C-c C-c' when done"))))