* test/test-riece-log.el (lunit-test-case-setup): #riece -> =23riece.
authorueno <ueno>
Tue, 7 Dec 2004 10:12:14 +0000 (10:12 +0000)
committerueno <ueno>
Tue, 7 Dec 2004 10:12:14 +0000 (10:12 +0000)
* riece-log.el (riece-log-insert): Renamed from
riece-log-flashback-1; simplified.
(riece-log-get-files): Check existence of directory.
(riece-log-get-directory): New implementation.

lisp/ChangeLog
lisp/riece-log.el
lisp/test/test-riece-log.el

index 8ec7cde..a363641 100644 (file)
@@ -1,7 +1,11 @@
 2004-12-07  Daiki Ueno  <ueno@unixuser.org>
 
+       * test/test-riece-log.el (lunit-test-case-setup): #riece -> =23riece.
+
        * riece-log.el (riece-log-insert): Renamed from
        riece-log-flashback-1; simplified.
+       (riece-log-get-files): Check existence of directory.
+       (riece-log-get-directory): New implementation.
 
 2004-12-07  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
index 738b2a5..3f2c9bc 100644 (file)
@@ -94,32 +94,16 @@ If integer, flash back only this line numbers. t means all lines."
    (riece-log-get-directory identity)))
 
 (defun riece-log-get-files (identity)
-  (let ((files (directory-files (riece-log-get-directory identity) t
-                               (concat "^"
-                                       (riece-make-interval-regexp "[0-9]" 8)
-                                       "\\.log$")
-                               t)))
-    (nreverse (sort files #'string-lessp))))
+  (let ((directory (riece-log-get-directory identity)))
+    (if (file-directory-p directory)
+       (nreverse (sort (directory-files directory t
+                        (concat "^"
+                                (riece-make-interval-regexp "[0-9]" 8)
+                                "\\.log$")
+                        t)
+                 #'string-lessp)))))
 
 (defun riece-log-get-directory (identity)
-  (let ((channel (riece-identity-canonicalize-prefix
-                 (riece-identity-prefix identity)))
-       (server (riece-identity-server identity))
-       (map (assoc (riece-format-identity identity) riece-log-directory-map))
-       name)
-    (cond (map (setq name (cdr map)))
-         ((string-match riece-strict-channel-regexp channel)
-          (let ((suffix (match-string 2 channel)))
-            (setq name (substring channel (match-end 1) (match-beginning 2)))
-            (when (and (stringp suffix)
-                       (string-match "^:\\*\\.\\(.*\\)" suffix))
-              (setq name (concat name "-" (match-string 1 suffix))))))
-         (t (setq name "priv")))
-    (if server
-       (expand-file-name name (expand-file-name server riece-log-directory))
-      (expand-file-name name riece-log-directory))))
-
-(defun riece-log-get-directory-1 (identity)
   (let ((prefix (riece-identity-canonicalize-prefix
                 (riece-identity-prefix identity)))
        (server (riece-identity-server identity))
index 7e2f591..94bd81b 100644 (file)
@@ -19,7 +19,7 @@
                               (temp-directory)
                             temporary-file-directory))
        test-riece-log-directory
-       (expand-file-name "riece" riece-log-directory))
+       (expand-file-name "=23riece" riece-log-directory))
   (make-directory riece-log-directory)
   (make-directory test-riece-log-directory)
   (write-region "03:14 <test> a b c\n03:15 <test> a b c\n" nil