[issue1651] copies.copies() returing repo.dirstate.copies() can lead patch.diff() to corrupt the dirstate.

Richard Lowe mercurial-bugs at selenic.com
Tue May 5 20:07:03 CDT 2009


New submission from Richard Lowe <richlowe at richlowe.net>:

[line references with reference to hg edd676eae7d7]

repo.dirstate.copies() returns the _copymap directly.

copies.copies() at line 109 of copies.py will return repo.dirstate.copies()
directly.

patch.diff() at lines 1238-1240 will permute the first dict returned by
copies.copies().

This will corrupt the dirstate in memory (and on disk, should the dirstate be
written after patch.diff() has been called).

At some point in this chain of events, a copy should returned, rather than the
actual in-memory dirstate copymap.
I'm not sure which of these should return a copy (probably copies.copies()?)

This seems (by inspection and slight testing) to affect 1.1.x, 1.2.x, and tip.

----------
messages: 9272
nosy: richlowe
priority: bug
status: unread
title: copies.copies() returing repo.dirstate.copies() can lead patch.diff() to corrupt the dirstate.

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



More information about the Mercurial-devel mailing list