]> git.eshelyaron.com Git - emacs.git/commitdiff
Make vc-bzr tests work with brz 3.1 (bug#43314)
authorGlenn Morris <rgm@gnu.org>
Sat, 12 Sep 2020 16:51:32 +0000 (09:51 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 12 Sep 2020 16:51:32 +0000 (09:51 -0700)
* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726)
(vc-bzr-test-bug9781, vc-bzr-test-faulty-bzr-autoloads):
Make them work with brz 3.1.

test/lisp/vc/vc-bzr-tests.el

index f738da7f41f57658120a73ea0313ff00e8066a00..b68a694512991822f8eb6f1aab6f25553457f950 100644 (file)
   ;; abort if they cannot.  I could not figure out how to stop bzr
   ;; doing that, so just give it a temporary homedir for the duration.
   ;; http://bugs.launchpad.net/bzr/+bug/137407 ?
+  ;;
+  ;; Note that with bzr 2.x, this works:
+  ;; mkdir /tmp/bzr
+  ;; HOME=/nonexistent BZR_HOME=/tmp/bzr bzr status
+  ;; but with brz 3.1, it complains:
+  ;; "failed to open trace file: [Errno 13] Permission denied: '/nonexistent'"
+  ;; which confuses vc-dir.
+  ;; We can quieten brz by adding either BRZ_LOG=/dev/null, or
+  ;; XDG_CACHE_HOME=/tmp/bzr (log defaults to XDG_CACHE_HOME/breezy/brz.log),
+  ;; but it seems simpler to just set HOME to a newly created
+  ;; temporary directory.
+  ;; TODO does this means tests should be setting XDG_ variables (not
+  ;; just HOME) to temporary values too?
   (let* ((homedir (make-temp-file "vc-bzr-test" t))
          (bzrdir (expand-file-name "bzr" homedir))
          (ignored-dir (progn
                         (make-directory bzrdir)
                         (expand-file-name "ignored-dir" bzrdir)))
          (default-directory (file-name-as-directory bzrdir))
-         (process-environment (cons (format "BZR_HOME=%s" homedir)
+         (process-environment (cons (format "HOME=%s" homedir)
                                     process-environment)))
     (unwind-protect
         (progn
@@ -81,7 +94,7 @@
                    (expand-file-name "subdir" bzrdir)))
          (file (expand-file-name "file" bzrdir))
          (default-directory (file-name-as-directory bzrdir))
-         (process-environment (cons (format "BZR_HOME=%s" homedir)
+         (process-environment (cons (format "HOME=%s" homedir)
                                     process-environment)))
     (unwind-protect
         (progn
                  (expand-file-name "foo.el" bzrdir)))
          (default-directory (file-name-as-directory bzrdir))
          (generated-autoload-file (expand-file-name "loaddefs.el" bzrdir))
-         (process-environment (cons (format "BZR_HOME=%s" homedir)
+         (process-environment (cons (format "HOME=%s" homedir)
                                     process-environment)))
     (unwind-protect
         (progn