# HG changeset patch # User Glenn Morris # Date 1179387491 0 # Node ID a2d726c7e2d17524c0fa3c8c96b592de915d5950 # Parent 9844e2d783f63b0a74af3eb3e305e22f22f2393b Sync change from trunk at request of rms in FOR-RELEASE: Stefan Monnier (vc-find-root): Stop searching when the user changes. diff -r 9844e2d783f6 -r a2d726c7e2d1 lisp/vc-hooks.el --- a/lisp/vc-hooks.el Wed May 16 19:48:35 2007 +0000 +++ b/lisp/vc-hooks.el Thu May 17 07:38:11 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)