[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc-hooks.el,v [EMACS_22_BASE]
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc-hooks.el,v [EMACS_22_BASE] |
Date: |
Sat, 16 Feb 2008 21:38:26 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Stefan Monnier <monnier> 08/02/16 21:38:25
Index: vc-hooks.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-hooks.el,v
retrieving revision 1.182.2.16
retrieving revision 1.182.2.17
diff -u -b -r1.182.2.16 -r1.182.2.17
--- vc-hooks.el 16 Feb 2008 20:21:16 -0000 1.182.2.16
+++ vc-hooks.el 16 Feb 2008 21:38:24 -0000 1.182.2.17
@@ -316,11 +316,12 @@
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 /.
- (while (not (file-directory-p file))
- (setq file (file-name-directory (directory-file-name file))))
(setq file (abbreviate-file-name file))
(let ((root nil)
- (user (nth 2 (file-attributes file))))
+ ;; `user' is not initialized outside the loop because
+ ;; `file' may not exist, so we may have to walk up part of the
+ ;; hierarchy before we find the "initial UID".
+ (user nil))
(while (not (or root
(null file)
;; As a heuristic, we stop looking up the hierarchy of
@@ -328,7 +329,9 @@
;; 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 (nth 2 (file-attributes file))))
+ (let ((prev-user user))
+ (setq user (nth 2 (file-attributes file)))
+ (and prev-user (not (equal user prev-user))))
(string-match vc-ignore-dir-regexp file)))
(if (file-exists-p (expand-file-name witness file))
(setq root file)