all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: don@donarmstrong.com (Emacs bug Tracking System)
To: Chong Yidong <cyd@stupidchicken.com>
Subject: bug#694: marked as done (23.0.60; wrong behaviour of  vc-workfile-unchanged-p)
Date: Wed, 27 Aug 2008 13:45:04 -0700	[thread overview]
Message-ID: <handler.694.D694.121986961717487.ackdone@emacsbugs.donarmstrong.com> (raw)
In-Reply-To: D1E985FF-F665-40A8-BAF9-ED9800EAD336@mac.com

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]


Your message dated Wed, 27 Aug 2008 16:42:02 -0400
with message-id <87ljyiyyud.fsf@cyd.mit.edu>
and subject line Re: 23.0.60; wrong behaviour of vc-workfile-unchanged-p
has caused the Emacs bug report #694,
regarding 23.0.60; wrong behaviour of vc-workfile-unchanged-p
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
694: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=694
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4459 bytes --]

From: Alex Harsanyi <harsanyi@mac.com>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.60; wrong behaviour of vc-workfile-unchanged-p
Date: Mon, 11 Aug 2008 18:24:43 +0800
Message-ID: <D1E985FF-F665-40A8-BAF9-ED9800EAD336@mac.com>

(I posted this on emacs-devel in December 2007, the problem is still  
present
in the latest CVS version)

When calling `vc-next-action' (C-x v v) on a file which has no  
changes, vc.el
will revert to the master version for RCS or say that the file is up  
to date
for CVS.  Unfortunately, this does not work corectly when the file is
unchanged but its timestamp is more recent than the checkout time.   
Consider
this scenario:

  1/ Create a new file and register it with RCS

  2/ Checkout the file (C-x v v).

  3/ Type C-x v v again.  Emacs will revert to the master version,  
since the
  file is unchanged.

  4/ Modify the file, save it, undo the changes and save it again.   
This will
  have the effect that the file will have the same contents as when  
checked
  out but a more recent modification time.

  5/ Type C-x v v again.  Emacs will pop-up the VC-Log buffer and  
checkin the
  file.

The problem seems to be in `vc-workfile-unchanged-p': if the checkout  
time is
available for a file, it is compared against the modification time  
and the
"unchanged " decision is made on that alone, without consulting the  
backed
specific function (vc-rcs-workfile-unchanged-p or
vc-default-workfile-unchanged-p)

I believe vc-workfile-unchanged-p and if the two timestamsps are the  
same, it
can conclude that the file is unchanged, but if the timestamps are  
different,
it should call the backend specific workfile-unchanged-p function.

The following patch is one way to fix the problem:

--- vc-hooks.el.~1.261.~	2008-07-25 17:08:10.000000000 +0800
+++ vc-hooks.el	2008-08-11 18:22:04.000000000 +0800
@@ -561,8 +561,9 @@ 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)
+             (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))))

Best Regards,
Alex.




[-- Attachment #3: Type: message/rfc822, Size: 1632 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Alex Harsanyi <harsanyi@mac.com>
Cc: 694-done@emacsbugs.donarmstrong.com
Subject: Re: 23.0.60; wrong behaviour of vc-workfile-unchanged-p
Date: Wed, 27 Aug 2008 16:42:02 -0400
Message-ID: <87ljyiyyud.fsf@cyd.mit.edu>

> The problem seems to be in `vc-workfile-unchanged-p': if the checkout
> time is available for a file, it is compared against the modification
> time and the "unchanged " decision is made on that alone, without
> consulting the backed specific function (vc-rcs-workfile-unchanged-p or
> vc-default-workfile-unchanged-p)
>
> I believe vc-workfile-unchanged-p and if the two timestamsps are the
> same, it can conclude that the file is unchanged, but if the timestamps
> are different, it should call the backend specific workfile-unchanged-p
> function.

Sounds reasonable.  I've checked in your patch (with a minor
modification) into the CVS trunk.  Thanks.


  reply	other threads:[~2008-08-27 20:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87ljyiyyud.fsf@cyd.mit.edu>
2008-08-11 10:24 ` bug#694: 23.0.60; wrong behaviour of vc-workfile-unchanged-p Alex Harsanyi
2008-08-27 20:45   ` Emacs bug Tracking System [this message]
2008-08-28  1:31     ` bug#694: marked as done (23.0.60; wrong behaviour of Stefan Monnier
2008-08-28 14:07       ` Chong Yidong
2008-08-28 16:02         ` Stefan Monnier
2008-08-28 17:50           ` Chong Yidong

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=handler.694.D694.121986961717487.ackdone@emacsbugs.donarmstrong.com \
    --to=don@donarmstrong.com \
    --cc=cyd@stupidchicken.com \
    /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.