1

I have written a batch script to do the diff between two revisions using Windows command-line SVN. The directory name has a space (I am cursing the developer for creating a directory name with a space).

SVN Version: 1.7
OS: Windows XP

For example, /svnrepo/xyz/project/C# Code/files/

The trouble is for the C# code directory name, I am assuming that the space is causing the issue - when I tried to run the diff command, the output is quite unusual:

svn diff -r633:700 /svnrepo/xyz/project/***C# Code***/files/

A /svnrepo/xyz/project/C%23%20Code/files/

How do I correct this issue?

I wish to get the output like:

A /svnrepo/xyz/project/C# Code/files/ So that I can write the output to some text file.

PS: I am a Linux person. And new to batch scripting.

1 Answer 1

2

There is no "issue". That's standard URL character encoding (%23 means hex 23 or 0x23, which is decimal 35, which is the ASCII code for #, and %20 is hex 20 or 0x20, which is decimal 32, which is the ASCII code for a space character). You see the same thing in the address bar of your web browswer if you try to navigate to a URL that has those characters as part of the site address.

To log the differences to a file, just use command-line redirection:

svn diff -r633:700 /svnrepo/xyz/project/C# Code/files/ > diffs.txt
Sign up to request clarification or add additional context in comments.

2 Comments

I see! you are right. However, when i tried to redirect the dir path to text file, it is having these ASCII chars. Now my requirement is to redirect the dir path to text file and compare the dir path with the local path. e.g. I am having the same structure locally on my windows D:\C# Code\files when I do the comparision it is looking for a dir with the ASCII code and it fails since it is not able to recognize the C# Code folder. Is there a way to convert the ASCII to actual path while doing the comparison?
I'm not sure what "when I do the comparison" means. Do you mean the actual "diff" operation itself? If so, you just diff the local version, and it should automatically be diffing against the repository version. (It's exactly what I did to test my answer, was diff a local file to see what the changes were in the repository and make sure the redirection worked. Can you clarify what the issue is you're having now?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.