Mercurial > emacs
comparison lisp/vc.el @ 4854:a964061ab350
(vc-backend-checkout): Do not set umask to value that does not allow
user-write permission while `co' is running; some versions of `co'
won't work, because they can't write their temporaries.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Thu, 14 Oct 1993 18:28:24 +0000 |
parents | 4c49473fbfd4 |
children | 9da6c6c24ddd |
comparison
equal
deleted
inserted
replaced
4853:3ec2205d12b5 | 4854:a964061ab350 |
---|---|
1459 (if workfile (concat "-G" workfile)) | 1459 (if workfile (concat "-G" workfile)) |
1460 (and rev (concat "-r" (vc-lookup-triple file rev)))) | 1460 (and rev (concat "-r" (vc-lookup-triple file rev)))) |
1461 (if workfile ;; RCS | 1461 (if workfile ;; RCS |
1462 ;; RCS doesn't let us check out into arbitrary file names directly. | 1462 ;; RCS doesn't let us check out into arbitrary file names directly. |
1463 ;; Use `co -p' and make stdout point to the correct file. | 1463 ;; Use `co -p' and make stdout point to the correct file. |
1464 (let ((default-modes (default-file-modes)) | 1464 (let ((vc-modes (logior (file-modes (vc-name file)) |
1465 (vc-modes (logior (file-modes (vc-name file)) | |
1466 (if writable 128 0))) | 1465 (if writable 128 0))) |
1467 (failed t)) | 1466 (failed t)) |
1468 (unwind-protect | 1467 (unwind-protect |
1469 (progn | 1468 (progn |
1470 (set-default-file-modes vc-modes) | |
1471 (vc-do-command | 1469 (vc-do-command |
1472 0 "/bin/sh" file "-c" | 1470 0 "/bin/sh" file "-c" |
1473 "filename=$1; shift; exec co \"$@\" >$filename" | 1471 (format "umask %o; exec >\"$1\" || exit; shift; umask %o; exec co \"$@\"" |
1472 (logand 511 (lognot vc-modes)) | |
1473 (logand 511 (lognot (default-file-modes)))) | |
1474 "" ; dummy argument for shell's $0 | 1474 "" ; dummy argument for shell's $0 |
1475 filename | 1475 filename |
1476 (if writable "-l") | 1476 (if writable "-l") |
1477 (concat "-p" rev)) | 1477 (concat "-p" rev)) |
1478 (setq failed nil)) | 1478 (setq failed nil)) |
1479 (set-default-file-modes default-modes) | |
1480 (and failed (file-exists-p filename) (delete-file filename)))) | 1479 (and failed (file-exists-p filename) (delete-file filename)))) |
1481 (vc-do-command 0 "co" file | 1480 (vc-do-command 0 "co" file |
1482 (if writable "-l") | 1481 (if writable "-l") |
1483 (and rev (concat "-r" rev)))) | 1482 (and rev (concat "-r" rev)))) |
1484 ) | 1483 ) |