unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Rolf Unger <rz.unger@web.de>
Cc: 7221@debbugs.gnu.org
Subject: bug#7221: timestamp in cvs-quickdir on Win32 system
Date: Thu, 20 Aug 2020 16:07:41 +0200	[thread overview]
Message-ID: <87imddv2aa.fsf@gnus.org> (raw)
In-Reply-To: <E1P6iFF-0005te-Kt@platon.wg-mit-garten.local> (Rolf Unger's message of "Fri, 15 Oct 2010 13:14:41 +0200")

(I'm going through old bug reports that unfortunately got no attention
at the time.)

Rolf Unger <rz.unger@web.de> 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





  reply	other threads:[~2020-08-20 14:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15 11:14 bug#7221: timestamp in cvs-quickdir on Win32 system Rolf Unger
2020-08-20 14:07 ` Lars Ingebrigtsen [this message]
2020-10-02  9:42   ` Stefan Kangas
2020-10-02 10:30     ` Eli Zaretskii
2021-08-26 18:07       ` Lars Ingebrigtsen
2021-08-26 23:06         ` Rolf Unger
2021-08-27 12:20           ` Eli Zaretskii
2021-09-25  2:38             ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imddv2aa.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=7221@debbugs.gnu.org \
    --cc=rz.unger@web.de \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).