Read about our upcoming Code of Conduct on this issue

Commit cce59e35 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

dirstate: stop gathering parentfiledata in update_file

Gathering information here assume that they are valid cache information for a
clean file. It is true most of the time, but not garanteed.

Accurate data can still be explicitly provided.

We drop the spontaneous and will let the next `hg status` call record actual information.

Differential Revision: https://phab.mercurial-scm.org/D11791
parent 6becd5773133
......@@ -573,13 +573,6 @@ class dirstate(object):
self._dirty = True
need_parent_file_data = (
not possibly_dirty and not p2_info and wc_tracked and p1_tracked
)
if need_parent_file_data and parentfiledata is None:
parentfiledata = self._get_filedata(filename)
self._map.reset_state(
filename,
wc_tracked,
......
......@@ -173,8 +173,7 @@ transaction: in-memory dirstate changes should be written into
C c
$ hg debugstate --no-dates
n 644 12 set c (no-rhg !)
n 644 12 unset c (?)
n 644 12 set c (?)
n 0 -1 unset c (rhg known-bad-output !)
$ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
removing c
adding b
......
......@@ -9,6 +9,9 @@
> EOF
#endif
TODO: fix rhg bugs that make this test fail when status is enabled
$ unset RHG_STATUS
Checking the size/permissions/file-type of files stored in the
dirstate after an update where the files are changed concurrently
outside of hg's control.
......
......@@ -68,20 +68,39 @@ Wait to make sure we get a tick so the mtime of the largefiles become valid.
A linear merge will update standins before performing the actual merge. It will
do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
update the corresponding standins.
Verify that it actually marks the clean files as clean in lfdirstate so
we don't have to hash them again next time we update.
# note:
# We do this less agressively now, to avoid race condition, however the
# cache
# is properly set after the next status
#
# The "changed" output is marked as missing-correct-output/known-bad-output
# for clarify
$ hg up
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
updated to "f74e50bd9e55: #2"
1 other heads for branch "default"
$ hg debugdirstate --large --nodate
n 644 7 set large1 (missing-correct-output !)
n 644 13 set large2 (missing-correct-output !)
n 0 -1 unset large1 (known-bad-output !)
n 0 -1 unset large2 (known-bad-output !)
$ sleep 1 # so that mtime are not ambiguous
$ hg status
$ hg debugdirstate --large --nodate
n 644 7 set large1
n 644 13 set large2
Test that lfdirstate keeps track of last modification of largefiles and
prevents unnecessary hashing of content - also after linear/noop update
(XXX Since there is a possible race during update, we only do this after the next
status call, this is slower, but more correct)
$ sleep 1
$ hg st
$ hg debugdirstate --large --nodate
......@@ -92,6 +111,13 @@ prevents unnecessary hashing of content - also after linear/noop update
updated to "f74e50bd9e55: #2"
1 other heads for branch "default"
$ hg debugdirstate --large --nodate
n 644 7 set large1 (missing-correct-output !)
n 644 13 set large2 (missing-correct-output !)
n 0 -1 unset large1 (known-bad-output !)
n 0 -1 unset large2 (known-bad-output !)
$ sleep 1 # so that mtime are not ambiguous
$ hg status
$ hg debugdirstate --large --nodate
n 644 7 set large1
n 644 13 set large2
......
......@@ -1063,7 +1063,7 @@ timestamp of them isn't changed on the filesystem (see also issue4583)
$ cat r1
Y1
$ hg debugstate | grep ' r1$'
n 644 3 unset r1
n 0 -1 unset r1
$ hg status -A r1
M r1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment