Commit 6f0dfad8 authored by Glenn Morris's avatar Glenn Morris

Tweak vc-tests.el for bzr

* test/lisp/vc/vc-tests.el (vc-test--working-revision):
Handle test environments where HOME does not exist.
parent 8e94fb1d
......@@ -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."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment