Categories
josephscott

Subversion Doesn’t Like Trailing Spaces

My recent Subversion success hit an old snag the other day. I was importing another FrameMaker book, which seemed to go okay, but checking it out again failed on one directory over and over. It didn’t make any sense, there was nothing unusual about the directory that I could see. I removed the whole book and re-imported it just to see if I missed something. The second import went fine (so I thought), but the checkout failed in the same spot once again.

So I tried all the little variations of re-importing specific directories and checking out specific directories. The failure was always the same and always on the same directory. At one point I stopped and just looked at the error, which included the directory name, for a few minutes. I wondered, could there possibly be some white space on the end of the directory name?

Testing this theory was easy enough, filename completion in my shell confirmed that there was one space at the end of the directory name. Unbelievable! Who would put a space at the end of directory name!? At this point it didn’t matter, I removed the directory with the space from the repository. This took a couple of tries because the import on that directory didn’t really succeed properly. So even though the error showed up on checkout, it was the importing that actually failed in the first place.

Once the directory with the trailing space was renamed to exclude the space I was able to import it. Checkout also worked normally after that.

So if you have what looks like a normal file or directory that is causing errors on an import or checkout, take a moment ensure that there are no trailing spaces. Subversion won’t be happy if there are.

One reply on “Subversion Doesn’t Like Trailing Spaces”

I have a file on a CD that has a trailing space and I can’t copy it off, what to do….. 🙁
I’m in Windows XP

Leave a Reply

Your email address will not be published. Required fields are marked *