fix race in localrepo.addchangegroup.
localrepo.addchangegroup writes to changelog, then manifest, then normal
files. this breaks access ordering. if reader reads changelog while
manifest is being written, can find pointers into places in manifest
that are not yet written. same can happen for manifest and normal files.
fix is to make almost no change to localrepo.addchangegroup. it must
to write changelog and manifest data early because it has to read them
while writing other files. instead, write changelog and manifest data
to temp file that reader cannot see, then append temp data to manifest
after all normal files written, finally append temp data to changelog.
temp file code is in new appendfile module. can be used in other places
with small changes.
much smaller race still left. we write all new data in one write call,
but reader can maybe see partial update because python or os or filesystem
cannot always make write really atomic. file locking no help: slow, not
portable, not reliable over nfs. only real safe other plan is write to
temp file every time and rename, but performance bad when manifest or
changelog is big.
05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
(the rawcommit command is deprecated)
05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
changeset: 2:e110db3db549
tag: tip
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: 2
(the rawcommit command is deprecated)
05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
changeset: 3:0f9843914735
tag: tip
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: 3
(the rawcommit command is deprecated)
d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
changeset: 4:909a3d1d3ee1
tag: tip
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: 4
(the rawcommit command is deprecated)
05f9e54f4c9b86b09099803d8b49a50edcb4eaab 644 a
54837d97f2932a8194e69745a280a2c11e61ff9c 644 b
3570202ceac2b52517df64ebd0a062cb0d8fe33a 644 c
changeset: 4:909a3d1d3ee1
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: 4
(the rawcommit command is deprecated)
d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
changeset: 6:725fdd0728db
tag: tip
parent: 4:909a3d1d3ee1
parent: 5:f56d4c64ab98
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: 6
(the rawcommit command is deprecated)
d6e3c4976c13feb1728cd3ac851abaf7256a5c23 644 a
76d5e637cbec1bcc04a5a3fa4bcc7d13f6847c00 644 c
changeset: 7:2c11b55105cb
tag: tip
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: 7