/[emacs]/emacs/lisp/vc-hooks.el
ViewVC logotype

Diff of /emacs/lisp/vc-hooks.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.149 by monnier, Wed May 7 17:22:28 2003 UTC revision 1.150 by monnier, Thu May 8 17:45:08 2003 UTC
# Line 370  For registered files, the value returned Line 370  For registered files, the value returned
370                       with locking; it represents an erroneous condition that                       with locking; it represents an erroneous condition that
371                       should be resolved by the user (vc-next-action will                       should be resolved by the user (vc-next-action will
372                       prompt the user to do it)."                       prompt the user to do it)."
373      ;; FIXME: New (sub)states needed (?):
374      ;; - `added' (i.e. `edited' but with no base version yet,
375      ;;            typically represented by vc-workfile-version = "0")
376      ;; - `conflict' (i.e. `edited' with conflict markers)
377      ;; - `removed'
378      ;; - `copied' and `moved' (might be handled by `removed' and `added')
379    (or (vc-file-getprop file 'vc-state)    (or (vc-file-getprop file 'vc-state)
380        (if (vc-backend file)        (if (vc-backend file)
381            (vc-file-setprop file 'vc-state            (vc-file-setprop file 'vc-state
# Line 398  and does not employ any heuristic at all Line 404  and does not employ any heuristic at all
404  (defun vc-default-workfile-unchanged-p (backend file)  (defun vc-default-workfile-unchanged-p (backend file)
405    "Check if FILE is unchanged by diffing against the master version.    "Check if FILE is unchanged by diffing against the master version.
406  Return non-nil if FILE is unchanged."  Return non-nil if FILE is unchanged."
407    (zerop (vc-call diff file (vc-workfile-version file))))    ;; If rev1 is nil, `diff' uses the current workfile version.
408      (zerop (vc-call diff file)))
409    
410  (defun vc-workfile-version (file)  (defun vc-workfile-version (file)
411    "Return the version level of the current workfile FILE.    "Return the version level of the current workfile FILE.
# Line 583  visiting FILE." Line 590  visiting FILE."
590        ;; If the user is root, and the file is not owner-writable,        ;; If the user is root, and the file is not owner-writable,
591        ;; then pretend that we can't write it        ;; then pretend that we can't write it
592        ;; even though we can (because root can write anything).        ;; even though we can (because root can write anything).
593        ;; This way, even root cannot modify a file that isn't locked.      ;; This way, even root cannot modify a file that isn't locked.
594        (and (equal file buffer-file-name)      (and (equal file buffer-file-name)
595             (not buffer-read-only)           (not buffer-read-only)
596             (zerop (user-real-uid))             (zerop (user-real-uid))
597             (zerop (logand (file-modes buffer-file-name) 128))             (zerop (logand (file-modes buffer-file-name) 128))
598             (setq buffer-read-only t)))             (setq buffer-read-only t)))

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.150

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26