1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-29 11:02:01 +00:00

Tweak vc-tests.el for bzr

* test/lisp/vc/vc-tests.el (vc-test--working-revision):
Handle test environments where HOME does not exist.
This commit is contained in:
Glenn Morris 2017-05-01 13:23:30 -04:00
parent 8e94fb1dd9
commit 6f0dfad84e

View File

@ -307,8 +307,13 @@ This checks also `vc-backend' and `vc-responsible-backend'."
(file-name-as-directory
(expand-file-name
(make-temp-name "vc-test") temporary-file-directory)))
(process-environment process-environment)
tempdir
vc-test--cleanup-hook)
(when (eq backend 'Bzr)
(setq tempdir (make-temp-file "vc-test--state" t)
process-environment (cons (format "BZR_HOME=%s" tempdir)
process-environment)))
(unwind-protect
(progn
;; Cleanup.
@ -357,7 +362,9 @@ This checks also `vc-backend' and `vc-responsible-backend'."
'(nil unregistered))))))
;; Save exit.
(ignore-errors (run-hooks 'vc-test--cleanup-hook)))))
(ignore-errors
(if tempdir (delete-directory tempdir t))
(run-hooks 'vc-test--cleanup-hook)))))
(defun vc-test--working-revision (backend)
"Check the working revision of a repository."