From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#7221: timestamp in cvs-quickdir on Win32 system Date: Thu, 20 Aug 2020 16:07:41 +0200 Message-ID: <87imddv2aa.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39779"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 7221@debbugs.gnu.org To: Rolf Unger Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 20 16:08:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8lEg-000AEf-TJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Aug 2020 16:08:10 +0200 Original-Received: from localhost ([::1]:56562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8lEf-0003GE-Re for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Aug 2020 10:08:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8lEY-0003Eb-NS for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 10:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8lEY-000752-Eg for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 10:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8lEY-0003zj-7q for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 10:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Aug 2020 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7221 X-GNU-PR-Package: emacs Original-Received: via spool by 7221-submit@debbugs.gnu.org id=B7221.159793247415341 (code B ref 7221); Thu, 20 Aug 2020 14:08:02 +0000 Original-Received: (at 7221) by debbugs.gnu.org; 20 Aug 2020 14:07:54 +0000 Original-Received: from localhost ([127.0.0.1]:43275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8lEP-0003zM-RV for submit@debbugs.gnu.org; Thu, 20 Aug 2020 10:07:54 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:58062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8lEO-0003z9-1C for 7221@debbugs.gnu.org; Thu, 20 Aug 2020 10:07:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8qEl6WzNZ+IXTvUHrEwr27EeC9m61xNU9ujliCx+QSE=; b=lTGpwRJveVjG45YWQu5VirUvYk fTDIFExOtumsKZ1aYmt8Bn9xSRTdxoZh9asKJH7uRJlRNJy1IlozdWuq6pl1DE8tJtOfbA7fsbiG+ IT+RuPo70e01TOqQXAwvXJxLIgDkC4zQ2Ht7CWx0Q1aDTxJQ+c3BNRSdrUtgUly5qac8=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8lEE-0004GO-Sy; Thu, 20 Aug 2020 16:07:45 +0200 X-Now-Playing: Various's _SHAPE Platform 2019_: "Marta SmiLga - Untitled 11" In-Reply-To: (Rolf Unger's message of "Fri, 15 Oct 2010 13:14:41 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185694 Archived-At: (I'm going through old bug reports that unfortunately got no attention at the time.) Rolf Unger writes: > I realized that the cvs-quickdir command always returned MODIFIED for the > state of the files under CVS when running this on MS Win2k. At some time > I was using cvs-quickdir on a Linux box and was suprised that the results > were correct on Linux. > > I inspected this a bit closer and figured out that the problem is in the > pcvs-info.el:cvs-fileinfo-from-entries function. Comparing the file > attributes time with the timestamp from the CVS/Entries file seems to > compare two different formats. > > (setq timestamp (format-time-string "%c" mtime 'utc)) > > seems to be the problem. I experimented a bit with the format-time-string > and found out that the "%c" format specifier is not robust on Win32 > > (insert (concat "\n" (format-time-string "%c" (current-time) t))) > > gives me after: > > (setq system-time-locale nil): 15.10.2010 10:45:44 > > (setq system-time-locale "C"): 10/15/10 10:44:52 > > The first one picks up my locale settings from the OS and is the common > german format. But only the second one is relevant for cvs-quickdir. > > If I use a detailed format string "%a %b %e %H:%M:%S %Y" I get the date > string in a format that matches what is used in CVS/Entries. So the suggestion is to do this: diff --git a/lisp/vc/pcvs-info.el b/lisp/vc/pcvs-info.el index 9f8a168a0a..5a607e337b 100644 --- a/lisp/vc/pcvs-info.el +++ b/lisp/vc/pcvs-info.el @@ -454,7 +454,8 @@ cvs-fileinfo-from-entries ((let ((mtime (file-attribute-modification-time (file-attributes (concat dir f)))) (system-time-locale "C")) - (setq timestamp (format-time-string "%c" mtime t)) + (setq timestamp (format-time-string "%a %b %e %H:%M:%S %Y" + mtime t)) ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep 5". ;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference. (if (= (aref timestamp 8) ?0) But I guess the assumption here is that cvs will output the date in the locale's date format, which is why we're using %c here. If your cvs outputs in ISO8601 no matter what your locale is, then you'll get a mismatch here. So I'm kinda leaning towards this not being a bug, but a cvs version that doesn't behave correctly... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no