From unknown Sun Aug 17 09:10:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#3298 <3298@debbugs.gnu.org> To: bug#3298 <3298@debbugs.gnu.org> Subject: Status: vc-revert-buffer sets file time-stamp into the past. Reply-To: bug#3298 <3298@debbugs.gnu.org> Date: Sun, 17 Aug 2025 16:10:31 +0000 retitle 3298 vc-revert-buffer sets file time-stamp into the past. reassign 3298 emacs submitter 3298 Sergei Organov severity 3298 normal tag 3298 patch thanks From osv@javad.com Fri May 15 12:57:27 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 15 May 2009 19:57:28 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n4FJvLxJ000615 for ; Fri, 15 May 2009 12:57:22 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M52U9-0001xR-JJ for bug-gnu-emacs@gnu.org; Fri, 15 May 2009 14:50:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M52U3-0001vo-8Q for bug-gnu-emacs@gnu.org; Fri, 15 May 2009 14:50:20 -0400 Received: from [199.232.76.173] (port=49741 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M52U2-0001vj-LP for bug-gnu-emacs@gnu.org; Fri, 15 May 2009 14:50:14 -0400 Received: from [205.178.136.214] (port=60086 helo=javad.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M52U2-0007u5-5j for bug-gnu-emacs@gnu.org; Fri, 15 May 2009 14:50:14 -0400 Received: (qmail 28618 invoked from network); 15 May 2009 18:43:48 +0000 Received: from unknown (HELO osv.gnss.ru) (89.175.180.242) by javad.com with (AES256-SHA encrypted) SMTP; 15 May 2009 18:43:48 +0000 Received: from osv by osv.gnss.ru with local (Exim 4.69) (envelope-from ) id 1M52NK-0006c0-16 for bug-gnu-emacs@gnu.org; Fri, 15 May 2009 22:43:18 +0400 To: bug-gnu-emacs@gnu.org Subject: vc-revert-buffer sets file time-stamp into the past. From: Sergei Organov Date: Fri, 15 May 2009 22:43:18 +0400 Message-ID: <87fxf6dx6h.fsf@osv.gnss.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Hello, When I have a file under version control (CVS), make some changes to the file, save it, and then call vc-revert-buffer (bound to C-x v u), the resulting reverted file has time-stamp in the past. To see the problem one needs to wait a little after checking out the file(s) before modifying/saving the testing file, because it's at this moment the backup of the file is being created with the time-stamp of initial file, and it's that backup file will later be copied to create reverted file. That's how it goes: Before change/save: file.cc (old time) After change/save: file.cc (new time) file.cc.~1.3~ (old time) After revert: file.cc (old time) This badly affects make, is inconsistent with the way revert is performed by PCL-CVS, and is inconsistent with manual revert of a file using CVS command-line: $ rm FILE; cvs update FILE The offending code is in the "vc.el" `vc-revert-file' function: (copy-file backup-file file 'ok-if-already-exists 'keep-date) It's `keep-date' that leads to the old time-stamp being assigned to the reverted file. In GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-10 on raven, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10402000 configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 locale-coding-system: utf-8 default-enable-multibyte-characters: t From rgm@gnu.org Sat Dec 12 11:49:59 2009 Received: (at control) by emacsbugs.donarmstrong.com; 12 Dec 2009 19:49:59 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.1 required=4.0 tests=AWL,MURPHY_DRUGS_REL8,ONEWORD, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nBCJnvk8012762 for ; Sat, 12 Dec 2009 11:49:59 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NJXyX-0006VY-Ia; Sat, 12 Dec 2009 14:49:57 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19235.62437.517216.202583@fencepost.gnu.org> Date: Sat, 12 Dec 2009 14:49:57 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: blue X-Ran: f/oD){E2(dp^5wn";w9(4`B/aK|Q88u[J>o$J\W6_lioh(Aq8MU,7kT(ap3Lg\8s^Vs4Kw X-Debbugs-No-Ack: yes merge 5181 3298 tags 3298 patch reassign 5194 spam From unknown Sun Aug 17 09:10:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 10 Aug 2011 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator