unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tim Van Holder <tim.vanholder@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 7905@debbugs.gnu.org
Subject: bug#7905: 24.0.50; VC not updating file status properly anymore after commit from vc-dir
Date: Mon, 31 Jan 2011 10:06:17 +0100	[thread overview]
Message-ID: <AANLkTimrp+9WU8FUMYdt8Hjtbk40jQFH6W=kb7F9Hc7x@mail.gmail.com> (raw)
In-Reply-To: <orei7wopuy.fsf@fencepost.gnu.org>

On 28 January 2011 19:16, Glenn Morris <rgm@gnu.org> wrote:
> Tim Van Holder wrote:
>
>> Think I see the problem being caused by vc-cvs-state-heuristic;
>
> This doesn't make sense to me, because vc-dir supposedly never uses that.
> But if so, setting vc-cvs-stay-local to nil should make everything work.

I checked the file-is-considered-edited-on-open behaviour, and there
vc-cvs-state-heuristic seems to be the culprit; as I mentioned, vc-dir
did not consider all files as modified.
Also, vc-dir correctly identifies the state after a 'g', so vc-dir
seems to work correctly in and of itself. I'm assuming the
update-status-in-vc-dir behaviour after a commit relies on local
operations, so if it expects to run vc-cvs-state-heuristic on the
newly-committed files to get their new state, it could be the culprit
there too.

>> it uses the file's checkout property:
>>   (vc-file-getprop file 'vc-checkout-time)
>> But this seems to always return 0 when I try to open a CVS-controlled
>> file, which means vc-cvs-state-heuristic will only report either
>> 'added or 'edited.
>
> Maybe edebugging vc-cvs-parse-entry will show why this is so.

Aha - it looks like it's a timezone thing. vc-cvs-parse-entry does
everything right, except that it tries to compare the file's mtime
with the time from CVS/Entries, assuming UTC as timezone for it (which
is correct for CVS/Entries but apparently not for mtime).
In my case, they differ by an hour:

$ date; date --utc
Mon Jan 31 09:50:50 CET 2011
Mon Jan 31 08:50:50 UTC 2011
$ grep foo CVS/Entries
/foo/1.297.2.24/Mon Jan 31 08:30:58 2011//Tmytag
$ stat foo
  File: `foo'
  Size: 75579           Blocks: 160        IO Block: 4096   regular file
Device: 808h/2056d      Inode: 8142863     Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/     tim)   Gid: ( 1000/     tim)
Access: 2011-01-31 09:37:57.000000000 +0100
Modify: 2011-01-31 09:30:58.000000000 +0100
Change: 2011-01-31 09:31:00.000000000 +0100

As a result, checkout-time is set to 0 (and state to edited).

Running "TZ=UTC emacs" shows the problem going away (both the vc-dir
state change and the file-edited-on-open).
So perhaps mtime needs decode-time applied, and then the zone argument
applied to the time info (I would expect there to be a function for
that already, but I didn't see one offhand).

> Perhaps the CVS/Entries file has an unexpected format.

Doubtful, since this also affected fresh clean sandboxes (like the one
in the sample).





  reply	other threads:[~2011-01-31  9:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 10:48 bug#7905: 24.0.50; VC not updating file status properly anymore after commit from vc-dir Tim Van Holder
2011-01-25  0:48 ` Glenn Morris
2011-01-25  8:00   ` Tim Van Holder
2011-01-25  9:44     ` Tim Van Holder
2011-01-25 11:30       ` Tim Van Holder
2011-01-26  4:25         ` Glenn Morris
2011-01-26  9:44           ` Tim Van Holder
2011-01-26 10:07             ` Tim Van Holder
2011-01-27  7:25               ` Glenn Morris
2011-01-27  9:51                 ` Tim Van Holder
2011-01-28 18:16                   ` Glenn Morris
2011-01-31  9:06                     ` Tim Van Holder [this message]
2011-01-31 10:31                       ` Andreas Schwab
2011-01-31 13:59                         ` Tim Van Holder
2011-01-31 14:10                           ` Andreas Schwab
2011-02-01 10:18                             ` Tim Van Holder
2011-02-01 21:45                               ` Glenn Morris
2011-02-02 11:40                                 ` Tim Van Holder

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='AANLkTimrp+9WU8FUMYdt8Hjtbk40jQFH6W=kb7F9Hc7x@mail.gmail.com' \
    --to=tim.vanholder@gmail.com \
    --cc=7905@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    /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).