From: Glenn Morris Date: Mon, 1 May 2017 17:23:30 +0000 (-0400) Subject: Tweak vc-tests.el for bzr X-Git-Tag: emacs-26.0.90~521^2~499 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6f0dfad84e1c1608bff9d691395bbe4ba1a39a52;p=emacs.git Tweak vc-tests.el for bzr * test/lisp/vc/vc-tests.el (vc-test--working-revision): Handle test environments where HOME does not exist. --- 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."