Michael Hackner
Michael Hackner

Reputation: 8645

svn propedit gives me a blank file

I know that the svn:ignore property is populated in my working copy, but when I do

svn propedit svn:ignore . --editor-cmd notepad

I get a blank file; editing and saving the blank file has no effect on the property. Using other editors gives a similar result.

Why isn’t this working?

I am using a 1.4.2 server and a 1.6.6 client on Windows XP.

Update

I have tried Notepad, UltraEdit-32, and Sublime Text, with and without the start /wait command, and not gotten anything to work. I have gotten it to work on a Debian machine, just not on Windows XP. Can anyone provide an example of a command that has the desired result, or a setting that I need to change in Windows?

Upvotes: 2

Views: 1958

Answers (2)

haui
haui

Reputation: 617

The editor you configure must communicate back to SVN that you are done with your edit operation. This communication is done by letting SVN wait until the exitor has been closed.

Normally, when invoking programs on the Windows command line, they do not let the calling process wait, but fork a new process and let the calling command continue. SVN therefore thinks the edit operation is immediately finished and ignores your changes.

To prevent you favorite editor from forking another process, you must invoke it through the start utility passing the /wait option. You configure your preferred editor in the following way:

set SVN_EDITOR="start /wait notepad++.exe"

Before, you now invoke the svn propedit command, you must make sure, that the editor (Notepad++ in the above example) is actually closed. Otherwise, it is not started again and therefore the \wait option does not work!

Now you can invoke

svn propedit svn:ignore .

The editor now opens. You can edit the properties file, save it and close the editor. After the editor has been closed, SVN updates the property.

Upvotes: 2

Aaron Digulla
Aaron Digulla

Reputation: 328860

You must use an editor which doesn't fork itself (i.e. starts an instance in the background and then returns immediately). For Windows, I'm not sure which editor doesn't work.

To try, start the editor from the command line. If you get a new prompt before you close the editor window, it won't work.

Upvotes: 2

Related Questions