3r1co / hg4j

Automatically exported from code.google.com/p/hg4j
GNU General Public License v2.0
0 stars 1 forks source link

HgStatusCommand reports phantom modifications if invoked right after 'hg update' #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Marc:
I'm experiencing a strange status-related effect here (on Windows):
I'm performing an "hg update" to an older revision. If I'm invoking a
HgStatusCommand immediately after the update, phantom modifications for
all updated files are reported. Example: hg4j repository, update from
TIP to r200. However, if I'm sleeping for 3 seconds (2 is not enough :),
and only after that time invoke HgStatusCommand no modifications are
reported, as expected

Original issue reported on code.google.com by tikhomir...@gmail.com on 11 Aug 2011 at 3:33

GoogleCodeExporter commented 8 years ago
To reproduce:
hg update -r <prev-rev>
java oth.console.Status

Modifications are reported unless any other native mercurial client command 
runs (i.e. no time interval)

'hg debugstate' suggests
n 666      14812 2011-04-14 10:41:30 src/org/tmatesoft/hg/repo/HgBundle.java
n   0         -1 unset               src/org/tmatesoft/hg/repo/HgChangelog.java

the reason might be in processing of certain dirstate fields.

Original comment by tikhomir...@gmail.com on 25 Aug 2011 at 2:21

GoogleCodeExporter commented 8 years ago
There are few bugs:
a) HgWorkingCopyStatusCollector didn't respect dirstate may point to anything 
but tip
b) dirstate entries with size == -1 shall not be automatically treated as 
modified
c) fileNode.length() gives incorrect results for first revision of a file that 
is a copy (returned value includes size of the copy metadata). With incorrect 
revision length, false Modified status is reported then.

Original comment by tikhomir...@gmail.com on 25 Aug 2011 at 3:28

GoogleCodeExporter commented 8 years ago
fileNode.length now respects metadata, HgWCStatusCollector respects dirstate 
parents.

Original comment by tikhomir...@gmail.com on 25 Aug 2011 at 7:39