emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117072: Merge from emacs-24; up to r117083


From: Glenn Morris
Subject: [Emacs-diffs] trunk r117072: Merge from emacs-24; up to r117083
Date: Thu, 08 May 2014 07:02:19 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117072 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2014-05-08 00:02:08 -0700
message:
  Merge from emacs-24; up to r117083
modified:
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
  test/automated/vc-bzr.el       vcbzr.el-20111020033852-tb09uuuxskzxqlzo-1
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2014-05-08 03:41:21 +0000
+++ b/test/ChangeLog    2014-05-08 07:02:08 +0000
@@ -1,7 +1,8 @@
 2014-05-08  Glenn Morris  <address@hidden>
 
        * automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781)
-       (vc-bzr-test-faulty-bzr-autoloads): Disable bzr logging.
+       (vc-bzr-test-faulty-bzr-autoloads):
+       Give bzr a temporary home-directory, in case the real one is missing.
 
 2014-05-08  Dmitry Gutov  <address@hidden>
 

=== modified file 'test/automated/vc-bzr.el'
--- a/test/automated/vc-bzr.el  2014-05-08 03:34:20 +0000
+++ b/test/automated/vc-bzr.el  2014-05-08 06:58:46 +0000
@@ -31,17 +31,26 @@
 (ert-deftest vc-bzr-test-bug9726 ()
   "Test for http://debbugs.gnu.org/9726 ."
   (skip-unless (executable-find vc-bzr-program))
-  (let* ((tempdir (make-temp-file "vc-bzr-test" t))
-         (ignored-dir (expand-file-name "ignored-dir" tempdir))
-         (default-directory (file-name-as-directory tempdir))
-         (process-environment (cons (format "BZR_LOG=%s" null-device)
+  ;; Bzr wants to access HOME, e.g. to write ~/.bzr.log.
+  ;; This is a problem on hydra, where HOME is non-existent.
+  ;; You can disable logging with BZR_LOG=/dev/null, but then
+  ;; some commands (eg `bzr status') want to access ~/.bazaar,
+  ;; and will abort if they cannot.  I could not figure out how to
+  ;; stop bzr doing that, so just set HOME to a tempir for the duration.
+  (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 "HOME=%s" homedir)
                                     process-environment)))
     (unwind-protect
         (progn
           (make-directory ignored-dir)
           (with-temp-buffer
             (insert (file-name-nondirectory ignored-dir))
-            (write-region nil nil (expand-file-name ".bzrignore" tempdir)
+            (write-region nil nil (expand-file-name ".bzrignore" bzrdir)
                           nil 'silent))
           (call-process vc-bzr-program nil nil nil "init")
           (call-process vc-bzr-program nil nil nil "add")
@@ -57,17 +66,20 @@
           (with-current-buffer "*vc-dir*"
             (goto-char (point-min))
             (should (search-forward "unregistered" nil t))))
-      (delete-directory tempdir t))))
+      (delete-directory homedir t))))
 
 ;; Not specific to bzr.
 (ert-deftest vc-bzr-test-bug9781 ()
   "Test for http://debbugs.gnu.org/9781 ."
   (skip-unless (executable-find vc-bzr-program))
-  (let* ((tempdir (make-temp-file "vc-bzr-test" t))
-         (subdir (expand-file-name "subdir" tempdir))
-         (file (expand-file-name "file" tempdir))
-         (default-directory (file-name-as-directory tempdir))
-         (process-environment (cons (format "BZR_LOG=%s" null-device)
+  (let* ((homedir (make-temp-file "vc-bzr-test" t))
+         (bzrdir (expand-file-name "bzr" homedir))
+         (subdir (progn
+                   (make-directory bzrdir)
+                   (expand-file-name "subdir" bzrdir)))
+         (file (expand-file-name "file" bzrdir))
+         (default-directory (file-name-as-directory bzrdir))
+         (process-environment (cons (format "HOME=%s" homedir)
                                     process-environment)))
     (unwind-protect
         (progn
@@ -84,7 +96,7 @@
           (with-temp-buffer
             (insert "different text")
             (write-region nil nil file nil 'silent))
-          (vc-dir tempdir)
+          (vc-dir bzrdir)
           (while (vc-dir-busy)
             (sit-for 0.1))
           (vc-dir-mark-all-files t)
@@ -95,17 +107,20 @@
                   (vc-next-action nil))
               (fset 'y-or-n-p f)))
           (should (get-buffer "*vc-log*")))
-      (delete-directory tempdir t))))
+      (delete-directory homedir t))))
 
 ;; http://lists.gnu.org/archive/html/help-gnu-emacs/2012-04/msg00145.html
 (ert-deftest vc-bzr-test-faulty-bzr-autoloads ()
   "Test we can generate autoloads in a bzr directory when bzr is faulty."
   (skip-unless (executable-find vc-bzr-program))
-  (let* ((tempdir (make-temp-file "vc-bzr-test" t))
-         (file (expand-file-name "foo.el" tempdir))
-         (default-directory (file-name-as-directory tempdir))
-         (generated-autoload-file (expand-file-name "loaddefs.el" tempdir))
-         (process-environment (cons (format "BZR_LOG=%s" null-device)
+  (let* ((homedir (make-temp-file "vc-bzr-test" t))
+         (bzrdir (expand-file-name "bzr" homedir))
+         (file (progn
+                 (make-directory bzrdir)
+                 (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 "HOME=%s" homedir)
                                     process-environment)))
     (unwind-protect
         (progn
@@ -123,6 +138,6 @@
           (delete-file ".bzr/checkout/dirstate")
           (should (progn (update-directory-autoloads default-directory)
                          t)))
-      (delete-directory tempdir t))))
+      (delete-directory homedir t))))
 
 ;;; vc-bzr.el ends here


reply via email to

[Prev in Thread] Current Thread [Next in Thread]