From 6f0dfad84e1c1608bff9d691395bbe4ba1a39a52 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 1 May 2017 13:23:30 -0400 Subject: [PATCH] Tweak vc-tests.el for bzr * test/lisp/vc/vc-tests.el (vc-test--working-revision): Handle test environments where HOME does not exist. --- test/lisp/vc/vc-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/lisp/vc/vc-tests.el b/test/lisp/vc/vc-tests.el index f2898cb6d2c..656f673b201 100644 --- a/test/lisp/vc/vc-tests.el +++ b/test/lisp/vc/vc-tests.el @@ -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." -- 2.39.5