Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
3b27900d
Commit
3b27900d
authored
Jul 20, 2007
by
Stefan Monnier
Browse files
(vc-find-root): Fix case where `file' is the current
directory and the root as well.
parent
a272e668
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
lisp/ChangeLog
lisp/ChangeLog
+6
-2
lisp/vc-hooks.el
lisp/vc-hooks.el
+13
-12
No files found.
lisp/ChangeLog
View file @
3b27900d
2007-07-20 Stefan Monnier <monnier@iro.umontreal.ca>
* vc-hooks.el (vc-find-root): Fix case where `file' is the current
directory and the root as well.
2007-07-20 Dan Nicolaescu <dann@ics.uci.edu>
* vc-hooks.el (vc-default-workfile-unchanged-p): Pass a list
...
...
@@ -5,8 +10,7 @@
* vc-hg.el (vc-hg-print-log): Deal with multiple file arguments.
(vc-hg-registered): Replace if with when.
(vc-hg-state): Deal with nonexistent files and handle removed
files.
(vc-hg-state): Deal with nonexistent files and handle removed files.
(vc-hg-dir-state, vc-hg-dired-state-info): New functions.
(vc-hg-checkout): Re-enable.
(vc-hg-create-repo): Fix typos.
...
...
lisp/vc-hooks.el
View file @
3b27900d
...
...
@@ -317,24 +317,25 @@ The function walks up the directory tree from FILE looking for WITNESS.
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-
exists
-p
file
))
(
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
))))
(
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
(
nth
2
(
file-attributes
file
))))
(
string-match
vc-ignore-dir-regexp
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
(
nth
2
(
file-attributes
file
))))
(
string-match
vc-ignore-dir-regexp
file
)))
(
if
(
file-exists-p
(
expand-file-name
witness
file
))
(
setq
root
file
)
(
setq
file
(
directory-file-name
file
))))
(
setq
root
file
)
(
if
(
equal
file
(
setq
file
(
file-name-directory
(
directory-file-name
file
))))
(
setq
file
nil
))))
root
))
;; Access functions to file properties
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment