Mercurial > emacs
changeset 57094:7883de80034e
(vc-arch-root, vc-arch-registered): Use vc-find-root.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 13 Sep 2004 20:39:59 +0000 |
parents | 93192cf72b29 |
children | 74d256616e05 |
files | lisp/vc-arch.el |
diffstat | 1 files changed, 8 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/vc-arch.el Mon Sep 13 20:08:44 2004 +0000 +++ b/lisp/vc-arch.el Mon Sep 13 20:39:59 2004 +0000 @@ -73,18 +73,10 @@ (put 'Arch 'vc-functions nil) ;;;###autoload (defun vc-arch-registered (file) -;;;###autoload (let ((dir file)) -;;;###autoload (while (and (stringp dir) -;;;###autoload (not (equal -;;;###autoload dir (setq dir (file-name-directory dir)))) -;;;###autoload dir) -;;;###autoload (setq dir (if (file-directory-p -;;;###autoload (expand-file-name "{arch}" dir)) -;;;###autoload t (directory-file-name dir)))) -;;;###autoload (if (eq dir t) -;;;###autoload (progn -;;;###autoload (load "vc-arch") -;;;###autoload (vc-arch-registered file))))) +;;;###autoload (if (vc-find-root file "{arch}/=tagging-method") +;;;###autoload (progn +;;;###autoload (load "vc-arch") +;;;###autoload (vc-arch-registered file)))) (defun vc-arch-add-tagline () "Add an `arch-tag' to the end of the current file." @@ -186,18 +178,10 @@ (defun vc-arch-root (file) "Return the root directory of a Arch project, if any." (or (vc-file-getprop file 'arch-root) - (vc-file-setprop - file 'arch-root - (let ((root nil)) - (while (not (or root - (equal file (setq file (file-name-directory file))) - (null file))) - ;; Check the =tagging-method, in case someone naively manually - ;; creates a {arch} directory somewhere. - (if (file-exists-p (expand-file-name "{arch}/=tagging-method" file)) - (setq root file) - (setq file (directory-file-name file)))) - root)))) + (vc-file-setprop + ;; Check the =tagging-method, in case someone naively manually + ;; creates a {arch} directory somewhere. + file 'arch-root (vc-find-root file "{arch}/=tagging-method")))) (defun vc-arch-register (file &optional rev comment) (if rev (error "Explicit initial revision not supported for Arch"))