ignore files with invalid filenames
mbp at sourcefrog.net
Wed Aug 8 09:38:19 BST 2007
On 8/7/07, Fabio Machado de Oliveira <absfabio at terra.com.br> wrote:
> Hi again Martin,
> I found that "bzr pull" also have a problem with the existance of
> unversioned files with invalid filenames, and I expect it to happen
> with many other commands.
> I am wondering if its a case of replacing all of the "os.listdir"
> with something that already exclude these files, but I think it could
> have some performance decrease, as there is a utf8 encoding cache that
> would probably lose part or all of its performance gain.
> Or if the patches I submitted are going in the right way, so I will wait
> for someone to review that patch before trying to continue.
I think rather than replacing the calls individually, you probably
want to put access to workingtree files under the control of the
workingtree so that this policy is centralized.
I think it would be nice if files with invalid/unrepresentable names
were not seen outside of the workingtree.
We need to decide just what should happen to files with invalid names.
Should they just be ignored entirely, or should we give the user some
kind of notification. I think a good tradeoff would be:
1 - if they explicitly name the file, give an error
2 - if it's just unknown or ignored, ignore it
I think we can accomplish that by
1- when a filename is given, if we can't decode it on the command
line, or can't convert it into the fsencoding, error
2- otherwise, when listing the workingtree, skip files that can't be decoded.
Not totally sure though...
More information about the bazaar