diff options
| author | Paul Eggert | 1993-07-22 10:57:46 +0000 |
|---|---|---|
| committer | Paul Eggert | 1993-07-22 10:57:46 +0000 |
| commit | d76b8d38bcd82d5f5fdea9d7b0db1749ef7dff5a (patch) | |
| tree | e1121ac5c6272a40af79a57ba4f611bf4c147f3b | |
| parent | c08c95c7afc653758f005970bb8eb4add7454885 (diff) | |
| download | emacs-d76b8d38bcd82d5f5fdea9d7b0db1749ef7dff5a.tar.gz emacs-d76b8d38bcd82d5f5fdea9d7b0db1749ef7dff5a.zip | |
> (vc-backend-revert): Use `co -f' instead of deleting the
working file ourselves; that way, if `co' fails, we won't have
deleted the working file.
(vc-backend-steal): Don't delete the working file. Use `rcs -u -l',
not `rcs -u ; rcs -l'; it's faster. Use vc-backend-dispatch -- the
old code couldn't have possibly worked.
| -rw-r--r-- | lisp/vc.el | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index 9265c60bcbd..fe4d6f3cbde 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -1485,9 +1485,7 @@ Return nil if there is no such person." | |||
| 1485 | (progn ;; SCCS | 1485 | (progn ;; SCCS |
| 1486 | (vc-do-command 0 "unget" file nil) | 1486 | (vc-do-command 0 "unget" file nil) |
| 1487 | (vc-do-command 0 "get" file nil)) | 1487 | (vc-do-command 0 "get" file nil)) |
| 1488 | (progn | 1488 | (vc-do-command 0 "co" file "-f" "-u")) ;; RCS. This deletes the work file. |
| 1489 | (delete-file file) ;; RCS | ||
| 1490 | (vc-do-command 0 "co" file "-u"))) | ||
| 1491 | (vc-file-setprop file 'vc-locking-user nil) | 1489 | (vc-file-setprop file 'vc-locking-user nil) |
| 1492 | (message "Reverting %s...done" file) | 1490 | (message "Reverting %s...done" file) |
| 1493 | ) | 1491 | ) |
| @@ -1495,15 +1493,12 @@ Return nil if there is no such person." | |||
| 1495 | (defun vc-backend-steal (file &optional rev) | 1493 | (defun vc-backend-steal (file &optional rev) |
| 1496 | ;; Steal the lock on the current workfile. Needs RCS 5.6.2 or later for -M. | 1494 | ;; Steal the lock on the current workfile. Needs RCS 5.6.2 or later for -M. |
| 1497 | (message "Stealing lock on %s..." file) | 1495 | (message "Stealing lock on %s..." file) |
| 1498 | (progn | 1496 | (vc-backend-dispatch |
| 1499 | (vc-do-command 0 "unget" file "-n" (if rev (concat "-r" rev))) | 1497 | (progn |
| 1500 | (vc-do-command 0 "get" file "-g" (if rev (concat "-r" rev))) | 1498 | (vc-do-command 0 "unget" file "-n" (if rev (concat "-r" rev))) |
| 1501 | ) | 1499 | (vc-do-command 0 "get" file "-g" (if rev (concat "-r" rev))) |
| 1502 | (progn | 1500 | ) |
| 1503 | (vc-do-command 0 "rcs" "-M" (concat "-u" rev) file) | 1501 | (vc-do-command 0 "rcs" "-M" (concat "-u" rev) (concat "-l" rev) file)) |
| 1504 | (delete-file file) | ||
| 1505 | (vc-do-command 0 "rcs" (concat "-l" rev) file) | ||
| 1506 | ) | ||
| 1507 | (vc-file-setprop file 'vc-locking-user (user-login-name)) | 1502 | (vc-file-setprop file 'vc-locking-user (user-login-name)) |
| 1508 | (message "Stealing lock on %s...done" file) | 1503 | (message "Stealing lock on %s...done" file) |
| 1509 | ) | 1504 | ) |