[issue1303] "hg st" reports files as modified when they are not

Remy Blank mercurial-bugs at selenic.com
Fri Sep 19 02:24:20 CDT 2008


New submission from Remy Blank <remy.blank at pobox.com>:

The following script ends up with "file" being shown as modified, but "hg di"
doesn't show any differences, and the file attributes are unmodified as well.

hg init test
cd test
echo "start" >file
hg add file
hg ci -m "Contains start"
echo "longer content" >file
hg ci -m "Contains longer content"
hg debugstate
sleep 2
hg up
hg debugstate
echo "start" >file
hg debugstate
hg up -r 0
hg debugstate
hg st
hg di

The idea is that the script creates two revisions, then changes the content of
"file" to be the content it had in revision 0, then updates to revision 0.

Here's a sample output of the script:

n   0         -1 unset               file
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
n 664         15 2008-09-18 00:35:58 file
n 664         15 2008-09-18 00:35:58 file
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
n 664         15 2008-09-18 00:35:58 file
M file

The reason why "file" is shown as modified is because its dirstate still has the
values it had in revision 1, so it seems that the update to revision 0 didn't
update the dirstate correctly.

If I remove the "hg up" after the "sleep 2", the problem disappears, as the
dirstate for "file" remains unset.

If I remove the "sleep 2", the problem sometimes happens, sometimes not. It
seems that the following update must not happen in the same second as the commit.

The problem happens with both 1.0.1 and 1.0.2 on Linux.

----------
messages: 7162
nosy: rblank
priority: bug
status: unread
title: "hg st" reports files as modified when they are not
topic: update

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue1303>
____________________________________________________



More information about the Mercurial-devel mailing list