Kallithea issues archive

Issue #258: win32lfn support in Kallithea for Windows installations

Reported by: Brandon Jones
State: resolved
Created on: 2016-12-06 20:43
Updated on: 2016-12-20 15:09


With our client installations we have the win32lfn extension installed on all client machines using TortoiseHG in Windows. This allows us to avoid the "long filename" limitation of Windows. It doesn't come up often, but it's there from time to time.

Here is the extension we use: https://bitbucket.org/remleduff/win32lfn

This works fine on our client machines, but the internal version of Mercurial that Kallithea uses does not know about this extension and does not use it.

I forced the internal Mercurial version of Kallithea to use win32lfn but I got errors when I tried to create a repo group. I'm sure given the nature of the extension that this would occur in more than one place. Here is the error I got.

2016-12-06 15:31:57.694 ERROR [kallithea.controllers.api.api] Traceback (most recent call last):
  File "c:\kallithea\env\lib\site-packages\kallithea\controllers\api\api.py", line 2099, in create_repo_group
  File "c:\kallithea\env\lib\site-packages\kallithea\model\repo_group.py", line 189, in create
  File "c:\kallithea\env\lib\site-packages\kallithea\model\repo_group.py", line 95, in _create_group
  File "c:\kallithea\env\lib\os.py", line 157, in makedirs
    mkdir(name, mode)
  File "c:\kallithea\env\scripts\win32lfn.py", line 193, in lfnmkdir
    pyerrno = _errmap[error]
KeyError: 5L 

I think it would be quite valuable if Kallithea could make use of this extension to handle support for long file names in Windows.



Comment by Mads Kiilerich, on 2016-12-10 13:56

That extension is for handling long filenames in the working directory on the client side. Why do you need it on the server?

Also, instead of adding workarounds and "support" for this extension in projects around Mercurial, it would be much better if the extension could be polished and upstreamed. That would be much better use of the resources.

Anyway: The actual error seems to be a problem inside win32lfn. For some error they have some internal mapping of error codes, and they got an error code they can't handle. The extension is also fragile in the way it crashes in such situations and hides the real problem.

Comment by Brandon Jones, on 2016-12-10 15:41

Our Kallithea server installation is on Windows as well, so it still falls victim to the long file names issue. Even though I'm not updating the working directory on the server, the internal .hg folder is containing files that are too long for Windows to play nicely with.

A user can have the long files on their machine but when they go to push the server throws an error.

Comment by Mads Kiilerich, on 2016-12-10 15:47

The Mercurial repo storage format will make sure that .hg store long file names with shorter names (in .hg/store/dh/ ). That seems to contradict your experience. The actual error can perhaps tell.

Comment by Brandon Jones, on 2016-12-10 16:27

To be fair, we are in the process of migrating to Kallithea from RhodeCode 1.5.3 right now, which is what originally exhibited the issue.

We are making this migration soon, and once we do I can try to create a repository with long files within it to try and recreate the error, so that it might be more useful in determining the issue.

Comment by Brandon Jones, on 2016-12-20 15:09

Can't recreate issue.