aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel1995-11-02 09:35:04 +0000
committerAndré Spiegel1995-11-02 09:35:04 +0000
commit318880476ed9a7af897cfc3c0d26becc7a855756 (patch)
tree9ac8e65281c89abb5c78506dd5b73aba8a8e92c5
parent0c6d8148e6d8c058841fa68288435606eb07a2a9 (diff)
downloademacs-318880476ed9a7af897cfc3c0d26becc7a855756.tar.gz
emacs-318880476ed9a7af897cfc3c0d26becc7a855756.zip
(vc-utc-string): Use timezone of TIMEVAL for the correction, not the
current one. (vc-rcsdiff-knows-brief): New variable. (vc-rcs-lock-from-diff): Use it.
-rw-r--r--lisp/vc-hooks.el33
1 files changed, 23 insertions, 10 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index a17e2617840..4b7bcbcf7af 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -42,6 +42,11 @@ The value is only computed when needed to avoid an expensive search.")
42 "*If non-nil, use VC for files managed with CVS. 42 "*If non-nil, use VC for files managed with CVS.
43If it is nil, don't use VC for those files.") 43If it is nil, don't use VC for those files.")
44 44
45(defvar vc-rcsdiff-knows-brief nil
46 "*Indicates whether rcsdiff understands the --brief option.
47The value is either `yes', `no', or nil. If it is nil, VC tries
48to use --brief and sets this variable to remember whether it worked.")
49
45(defvar vc-path 50(defvar vc-path
46 (if (file-directory-p "/usr/sccs") 51 (if (file-directory-p "/usr/sccs")
47 '("/usr/sccs") 52 '("/usr/sccs")
@@ -563,14 +568,22 @@ For CVS, the full name of CVS/Entries is returned."
563 568
564(defun vc-rcs-lock-from-diff (file) 569(defun vc-rcs-lock-from-diff (file)
565 ;; Diff the file against the master version. If differences are found, 570 ;; Diff the file against the master version. If differences are found,
566 ;; mark the file locked. This is only meaningful for RCS with non-strict 571 ;; mark the file locked. This is only used for RCS with non-strict
567 ;; locking. 572 ;; locking. (If "rcsdiff" doesn't understand --brief, we do a double-take
568 (if (zerop (vc-simple-command 1 "rcsdiff" file 573 ;; and remember the fact for the future.)
569 "--brief" ; Some diffs don't understand "--brief", but 574 (let* ((version (concat "-r" (vc-workfile-version file)))
570 ; for non-strict locking under VC we require it. 575 (status (if (eq vc-rcsdiff-knows-brief 'no)
571 (concat "-r" (vc-workfile-version file)))) 576 (vc-simple-command 1 "rcsdiff" file version)
572 (vc-file-setprop file 'vc-locking-user 'none) 577 (vc-simple-command 2 "rcsdiff" file "--brief" version))))
573 (vc-file-setprop file 'vc-locking-user (vc-file-owner file)))) 578 (if (eq status 2)
579 (if (not vc-rcsdiff-knows-brief)
580 (setq vc-rcsdiff-knows-brief 'no
581 status (vc-simple-command 1 "rcsdiff" file version))
582 (error "rcsdiff failed."))
583 (if (not vc-rcsdiff-knows-brief) (setq vc-rcsdiff-knows-brief 'yes)))
584 (if (zerop status)
585 (vc-file-setprop file 'vc-locking-user 'none)
586 (vc-file-setprop file 'vc-locking-user (vc-file-owner file)))))
574 587
575(defun vc-locking-user (file) 588(defun vc-locking-user (file)
576 ;; Return the name of the person currently holding a lock on FILE. 589 ;; Return the name of the person currently holding a lock on FILE.
@@ -737,10 +750,10 @@ For CVS, the full name of CVS/Entries is returned."
737 750
738(defun vc-utc-string (timeval) 751(defun vc-utc-string (timeval)
739 ;; Convert a time value into universal time, and return it as a 752 ;; Convert a time value into universal time, and return it as a
740 ;; human-readable string. This is to compare CVS checkout times 753 ;; human-readable string. This is for comparing CVS checkout times
741 ;; with file modification times. 754 ;; with file modification times.
742 (let (utc (high (car timeval)) (low (nth 1 timeval)) 755 (let (utc (high (car timeval)) (low (nth 1 timeval))
743 (offset (car (current-time-zone)))) 756 (offset (car (current-time-zone timeval))))
744 (setq low (- low offset)) 757 (setq low (- low offset))
745 (setq utc (if (> low 65535) 758 (setq utc (if (> low 65535)
746 (list (1+ high) (- low 65536)) 759 (list (1+ high) (- low 65536))