emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: State of VC?


From: Alexandru Harsanyi
Subject: Re: State of VC?
Date: Sat, 26 Jan 2008 16:46:17 +0900


On 24 Jan 2008, at 4:07 PM, Dan Nicolaescu wrote:

wrong behaviour of vc-workfile-unchanged-p
http://lists.gnu.org/archive/html/emacs-devel/2007-12/msg00867.html

The analysis in the bug report seems correct.
Opinions on this patch?
(this code has been around for a long time...)

--- vc-hooks.el.~1.220.~2008-01-13 10:45:01.000000000 -0800
+++ vc-hooks.el2008-01-23 23:01:02.000000000 -0800
@@ -558,10 +558,11 @@
     (if (and checkout-time
;; Tramp and Ange-FTP return this when they don't know the time.
              (not (equal lastmod '(0 0))))
-        (equal checkout-time lastmod)
-      (let ((unchanged (vc-call workfile-unchanged-p file)))
- (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0))
-        unchanged))))
+        (if (equal checkout-time lastmod)
+    t
+  (let ((unchanged (vc-call workfile-unchanged-p file)))
+    (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0))
+    unchanged)))))

 (defun vc-default-workfile-unchanged-p (backend file)
   "Check if FILE is unchanged by diffing against the master version.


with the above changes, vc-workfile-unchanged-p will return nil when the test for the first if is false (and checkout-time ...). This vc will consider the file changed each time the checkout-time is not known. How about:


Index: vc-hooks.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-hooks.el,v
retrieving revision 1.220
diff -u -p -r1.220 vc-hooks.el
--- vc-hooks.el 8 Jan 2008 20:44:35 -0000       1.220
+++ vc-hooks.el 26 Jan 2008 07:45:06 -0000
@@ -557,11 +557,12 @@ and does not employ any heuristic at all
         (lastmod (nth 5 (file-attributes file))))
     (if (and checkout-time
;; Tramp and Ange-FTP return this when they don't know the time.
-             (not (equal lastmod '(0 0))))
-        (equal checkout-time lastmod)
-      (let ((unchanged (vc-call workfile-unchanged-p file)))
- (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0))
-        unchanged))))
+             (not (equal lastmod '(0 0)))
+             (equal checkout-time lastmod))
+        t
+        (let ((unchanged (vc-call workfile-unchanged-p file)))
+ (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0))
+          unchanged))))

 (defun vc-default-workfile-unchanged-p (backend file)
   "Check if FILE is unchanged by diffing against the master version.


Cheers,
Alex.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]