Fix for Python 2.3 compatibility.
Note: Name of comparing function of sort() is "cmpfunc" in Python 2.3
and "cmp" in Python 2.4.
% file replaced with directory
adding a
% should fail - would corrupt dirstate
abort: file named 'a' already in dirstate
% directory replaced with file
adding a/a
% should fail - would corrupt dirstate
abort: directory named 'a' already in dirstate
% directory replaced with file
adding b/c/d
% should fail - would corrupt dirstate
abort: directory named 'b' already in dirstate