convert fails if renaming long name with slash at the end.

Fabian bona+google at fabian-kreutz.de
Tue Dec 1 03:59:08 CST 2009


Hi!

I converted my svn repository with a filemap that renamed:
rename . web/
Note the slash at the end!

This usually does work, but in line 138  of mercurial/store.py
(hybridencode) is some handling for very long filenames, which fails:

  File "/usr/lib/python2.6/site-packages/mercurial/store.py", line
138, in hybridencode
    if d[-1] in '. ':
IndexError: string index out of range


To reproduce simply execute:

mkdir testcase
cd testcase
mkdir abcdefghijklmnopqrstuvwxyz; cd abcdefghijklmnopqrstuvwxyz
mkdir abcdefghijklmnopqrstuvwxyz; cd abcdefghijklmnopqrstuvwxyz
mkdir abcdefghijklmnopqrstuvwxyz; cd abcdefghijklmnopqrstuvwxyz
echo file > abcdefghijklmnopqrstuvwxyz.txt
cd ../../..
hg init
hg commit -A -m create
cd ..
echo "rename . web/" > filemap
hg convert testcase testcase2 --filemap filemap

Bye, Fabian


More information about the Mercurial-devel mailing list