diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf0472e..aebc149 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -384,6 +384,11 @@ * textmodes/sgml-mode.el (sgml-font-lock-syntactic-keywords): Use syntax-ppss on a position *before* the char we want to change. +2008-07-04 Justin Bogner + + * vc-hooks.el (vc-find-root): + Find the directory when using invert, not the file itself. + 2008-07-04 Dan Nicolaescu * vc-dir.el (vc-dir-query-replace-regexp): New function. diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 2ccbdcc..0662961 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -327,6 +327,13 @@ The function walks up the directory tree from FILE looking for WITNESS. If WITNESS if not found, return nil, otherwise return the root. Optional arg INVERT non-nil reverses the sense of the check; the root is the last directory for which WITNESS *is* found." + (when (not (file-directory-p file)) + (setq file (file-name-directory file))) + ;; In the invert case, we should return nil if WITNESS doesn't exist + ;; in the first place. + (if (and invert + (not (file-exists-p (expand-file-name witness file)))) + nil ;; Represent /home/luser/foo as ~/foo so that we don't try to look for ;; witnesses in /home or in /. (setq file (abbreviate-file-name file)) @@ -359,7 +366,7 @@ the root is the last directory for which WITNESS *is* found." ;; (This occurs, for example, when placing dotfiles under RCS.) (when (and (not root) invert prev-file) (setq root prev-file)) - root)) + root))) ;; Access functions to file properties ;; (Properties should be _set_ using vc-file-setprop, but