]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak vc-tests.el for bzr
authorGlenn Morris <rgm@gnu.org>
Mon, 1 May 2017 17:23:30 +0000 (13:23 -0400)
committerGlenn Morris <rgm@gnu.org>
Mon, 1 May 2017 17:23:30 +0000 (13:23 -0400)
* test/lisp/vc/vc-tests.el (vc-test--working-revision):
Handle test environments where HOME does not exist.

test/lisp/vc/vc-tests.el

index f2898cb6d2ccc0c956a427ee95838950f2869fc6..656f673b201eb8c853d0ca25515f2168024d77b1 100644 (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."