From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Harsanyi Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#694: 23.0.60; wrong behaviour of vc-workfile-unchanged-p Date: Mon, 11 Aug 2008 18:24:43 +0800 Message-ID: Reply-To: Alex Harsanyi , 694@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218472155 18053 80.91.229.12 (11 Aug 2008 16:29:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 16:29:15 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 18:30:07 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 1KSaHH-0004wh-FP for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 18:29:51 +0200 Original-Received: from localhost ([127.0.0.1]:42777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSaGL-0005fj-Bx for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 12:28:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSUw5-0000Mm-8W for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:47:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSUw0-0000Gt-30 for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:47:36 -0400 Original-Received: from [199.232.76.173] (port=50751 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSUvz-0000Ga-Im for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:47:31 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51833) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSUvy-0007wU-9a for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2008 06:47:31 -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 m7BAlOmD009730; Mon, 11 Aug 2008 03:47:24 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7BAU4DX004124; Mon, 11 Aug 2008 03:30:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Alex Harsanyi Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 11 Aug 2008 10:30:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 694 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12184502832434 (code B ref -1); Mon, 11 Aug 2008 10:30:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 11 Aug 2008 10:24:43 +0000 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) 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) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Mon, 11 Aug 2008 06:47:36 -0400 X-Mailman-Approved-At: Mon, 11 Aug 2008 12:28:36 -0400 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:19294 gmane.emacs.pretest.bugs:22816 Archived-At: (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.