]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-find-root): Stop searching when the user changes.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 May 2007 17:09:08 +0000 (17:09 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 May 2007 17:09:08 +0000 (17:09 +0000)
lisp/ChangeLog
lisp/vc-hooks.el

index 9f519f688e154b9ec5beedf6fdeea8198f5fe9d4..298684782ed7732e7dece58e6eed2d76039782e6 100644 (file)
@@ -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)
index d67a0262d8833de43e3e5365449c13e20fa2fa5b..1bde704790b7b3a3c0b36a4869979991937fc7a2 100644 (file)
@@ -315,10 +315,17 @@ If WITNESS if not found, return nil, otherwise return the root."
   ;; 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)