changeset 80883:0bae4b50536b

(vc-find-root): Stop searching when the user changes.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 09 May 2007 17:09:08 +0000
parents e04539d0ccf5
children e7db9b9b5053
files lisp/ChangeLog lisp/vc-hooks.el
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed May 09 16:56:20 2007 +0000
+++ b/lisp/ChangeLog	Wed May 09 17:09:08 2007 +0000
@@ -1,3 +1,7 @@
+2007-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc-hooks.el (vc-find-root): Stop searching when the user changes.
+
 2007-05-09  Edward O'Connor  <hober0@gmail.com>  (tiny change)
 
 	* progmodes/python.el (python-font-lock-keywords)
--- a/lisp/vc-hooks.el	Wed May 09 16:56:20 2007 +0000
+++ b/lisp/vc-hooks.el	Wed May 09 17:09:08 2007 +0000
@@ -315,10 +315,17 @@
   ;; 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))
-  (let ((root nil))
+  (let ((root nil)
+        (user (nth 2 (file-attributes file))))
     (while (not (or root
                    (equal file (setq file (file-name-directory file)))
                    (null file)
+                   ;; As a heuristic, we stop looking up the hierarchy of
+                   ;; directories as soon as we find a directory belonging
+                   ;; to another user.  This should save us from looking in
+                   ;; things like /net and /afs.  This assumes that all the
+                   ;; files inside a project belong to the same user.
+                   (not (equal user (file-attributes file)))
                    (string-match vc-ignore-dir-regexp file)))
       (if (file-exists-p (expand-file-name witness file))
          (setq root file)