all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alexandru Harsanyi <harsanyi@mac.com>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: State of VC?
Date: Sat, 26 Jan 2008 16:46:17 +0900	[thread overview]
Message-ID: <702CB3E3-18B0-4696-BE8B-B814A451B2B0@mac.com> (raw)
In-Reply-To: <200801240707.m0O77KcX018757@sallyv1.ics.uci.edu>


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.

  parent reply	other threads:[~2008-01-26  7:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 16:43 State of VC? Eric S. Raymond
2008-01-22 17:08 ` Tom Tromey
2008-01-22 22:07   ` Dan Nicolaescu
2008-01-22 21:51     ` Tom Tromey
2008-01-23  2:31       ` Stefan Monnier
2008-01-23 19:01       ` Dan Nicolaescu
2008-01-25  0:17         ` Tom Tromey
2008-01-26 19:21           ` Dan Nicolaescu
2008-01-26 22:06             ` Eric S. Raymond
2008-02-17 18:16               ` Dan Nicolaescu
2008-02-17 18:24                 ` Thien-Thi Nguyen
2008-02-17 18:56                   ` Dan Nicolaescu
2008-02-18  8:03                     ` Thien-Thi Nguyen
2008-02-18  8:36                       ` Miles Bader
2008-02-18  8:48                         ` Thien-Thi Nguyen
2008-02-18  8:57                           ` Miles Bader
2008-02-18  9:18                             ` Thien-Thi Nguyen
2008-02-25 15:14                             ` Thien-Thi Nguyen
2008-02-18 17:40                       ` Dan Nicolaescu
2008-02-19 13:52                         ` Thien-Thi Nguyen
2008-02-19 15:44                           ` Dan Nicolaescu
2008-02-19 16:57                             ` Thien-Thi Nguyen
2008-02-19 20:53                               ` Dan Nicolaescu
2008-02-17 23:09                 ` Eric S. Raymond
2008-01-22 22:26     ` Glenn Morris
2008-01-23 13:01       ` Johan Bockgård
2008-01-24  7:07       ` Dan Nicolaescu
2008-01-24  8:58         ` Thien-Thi Nguyen
2008-01-24 14:57           ` Stefan Monnier
2008-01-24 15:09             ` Thien-Thi Nguyen
2008-01-25 22:47             ` Richard Stallman
2008-01-26  2:57               ` Stefan Monnier
2008-01-26  7:46         ` Alexandru Harsanyi [this message]
2008-01-24 13:23       ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=702CB3E3-18B0-4696-BE8B-B814A451B2B0@mac.com \
    --to=harsanyi@mac.com \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.