tests/test-issue612
author Alexandre Fayolle <alexandre.fayolle@logilab.fr>
Thu, 23 Sep 2010 11:41:27 +0200
branchstable
changeset 12391 ca5fd84d62c6
parent 4819 9797124581c9
child 12156 4c94b6d0fb1c
permissions -rwxr-xr-x
Fix memory leak when using hg commands over http repositories When using hg commands over an http repository in a long running process, a httphandler instance is leaked for each command, because of a loop handler.parent -> OpenerDirector and OpenerDirector.handlers -> handler which is not handled by Python's gc. Discussion on #mercurial concluded that removing the __del__ method solved the problem.

#!/bin/sh

mkdir t
cd t

hg init
mkdir src
echo a > src/a.c
hg ci -Ama -d "10000000 0"

hg mv src source
hg ci -Ammove -d "1000000 0"

hg co -C 0
echo new > src/a.c
echo compiled > src/a.o
hg ci -mupdate -d "1000000 0"

hg st

hg merge

hg st