From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: don@donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <87ljyiyyud.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1219869903-18430-0" X-Trace: ger.gmane.org 1219870078 23515 80.91.229.12 (27 Aug 2008 20:47:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Aug 2008 20:47:58 +0000 (UTC) To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 27 22:48:52 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KYRwg-00077r-CF for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Aug 2008 22:48:50 +0200 Original-Received: from localhost ([127.0.0.1]:33185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYRvi-000785-5u for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Aug 2008 16:47:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYRvU-0006wE-HC for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2008 16:47:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYRvT-0006vD-Cu for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2008 16:47:35 -0400 Original-Received: from [199.232.76.173] (port=36315 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYRvS-0006um-RL for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2008 16:47:35 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47604) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KYRvR-00022e-Na for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2008 16:47:34 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7RKlTMf019768; Wed, 27 Aug 2008 13:47:30 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7RKj4GF018504; Wed, 27 Aug 2008 13:45:04 -0700 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com X-Emacs-PR-Message: closed 694 X-Emacs-PR-Package: emacs X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19784 Archived-At: This is a multi-part message in MIME format... ------------=_1219869903-18430-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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.) --=20 694: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D694 Emacs Bug Tracking System Contact don@donarmstrong.com with problems ------------=_1219869903-18430-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.9 required=4.0 tests=AWL,BAYES_00, MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Aug 2008 10:24:43 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7BAOe2t002428 for ; Mon, 11 Aug 2008 03:24:41 -0700 Received: from mx10.gnu.org ([199.232.76.166]:52505) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KSUYl-0005nz-Ef for emacs-pretest-bug@gnu.org; Mon, 11 Aug 2008 06:23:31 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KSUZn-00041b-KE for emacs-pretest-bug@gnu.org; Mon, 11 Aug 2008 06:24:39 -0400 Received: from hosted03.westnet.com.au ([203.10.1.215]:35273) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSUZm-000416-43 for emacs-pretest-bug@gnu.org; Mon, 11 Aug 2008 06:24:35 -0400 Received: from hosted03.westnet.com.au (hosted03.westnet.com.au [127.0.0.1]) by hosted03.westnet.com.au (Postfix) with SMTP id 5AC2E2BB2BD for ; Mon, 11 Aug 2008 18:24:30 +0800 (WST) Received: from [10.0.1.3] (dsl-58-7-70-164.wa.westnet.com.au [58.7.70.164]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by hosted03.westnet.com.au (Postfix) with ESMTP id 1311F2BB2AE for ; Mon, 11 Aug 2008 18:24:30 +0800 (WST) Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: emacs-pretest-bug@gnu.org From: Alex Harsanyi Subject: 23.0.60; wrong behaviour of vc-workfile-unchanged-p Date: Mon, 11 Aug 2008 18:24:43 +0800 X-Mailer: Apple Mail (2.753.1) X-PMX-Branch: TNG-Outgoing X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) (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. ------------=_1219869903-18430-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.7 required=4.0 tests=AWL,BAYES_00, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 694-done) by emacsbugs.donarmstrong.com; 27 Aug 2008 20:40:17 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7RKeCKK017390 for <694-done@emacsbugs.donarmstrong.com>; Wed, 27 Aug 2008 13:40:14 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id C70C257E14D; Wed, 27 Aug 2008 16:42:02 -0400 (EDT) To: Alex Harsanyi Cc: 694-done@emacsbugs.donarmstrong.com Subject: Re: 23.0.60; wrong behaviour of vc-workfile-unchanged-p From: Chong Yidong Date: Wed, 27 Aug 2008 16:42:02 -0400 Message-ID: <87ljyiyyud.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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. ------------=_1219869903-18430-0--