diff options
author | Glenn Morris <[email protected]> | 2007-05-17 07:38:11 +0000 |
---|---|---|
committer | Glenn Morris <[email protected]> | 2007-05-17 07:38:11 +0000 |
commit | 6e94b3b6d8008110c0fb4f19663ab2d1e34abb50 (patch) | |
tree | c6c455a37839243c24eef66099a9c22be911a202 /lisp | |
parent | 84bbd894e3366bec7efa97f7b78d1dcdfef46ad7 (diff) |
Sync change from trunk at request of rms in FOR-RELEASE:
Stefan Monnier <monnier at iro.umontreal.ca>
(vc-find-root): Stop searching when the user changes.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/vc-hooks.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index d67a0262d8..1bde704790 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -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) |