简体   繁体   中英

Problem with propset svn:ignore - possibly Vista related

As I understand it, the command to ignore the content of a directory using SVN is this:

svn propset svn:ignore "*" tmp/

This should set the ignore property on the content of the tmp directory, right? In other words, the wildcard is set to be the ignore value on the tmp directory. Trouble is, here's what is happening on my Windows box:

> svn propset svn:ignore "*" ./tmp
property 'svn:ignore' set on 'app'
property 'svn:ignore' set on 'config'
property 'svn:ignore' set on 'db'
property 'svn:ignore' set on 'doc'
property 'svn:ignore' set on 'lib'
property 'svn:ignore' set on 'log'
property 'svn:ignore' set on 'nbproject'
property 'svn:ignore' set on 'public'
[etc...]

That's not right. Am I doing something wrong (or perhaps going insane), or is my svn on Windows broken?

Some notes:

> svn --version
svn, version 1.5.2 (r32768)
compiled Aug 28 2008, 19:05:34


Update: I've have just tried this on a Windows XP machine and it works as expected. So either this is a Vista specific issue, or there is a problem with my Vista configuration. Is anyone else able to reproduce this problem on Vista? I have just spotted that Vista isn't listed as one of the supported platforms on the CollabNet downloads page .

It looks like Microsoft, in their infinite wisdom, have changed the behavior of wildcard expansion in Windows Vista :

So instead of an escaped wildcard being passed in, it gets expanded:

Under Win 95, 98, 2000, XP, the application runs as expected: it does wildcard expansion when parameters are like «*.txt» and it does NOT when parameters are like «"*.txt"». Under Windows Vista, wildcard expansion takes place always, or, said otherwise, double quotation marks DOES NOT suppress it.

There is further discussion on this issue on the Collabnet forum .

The command should be working as you expect.

The * is getting globbed, which it shouldn't be doing. So, you're running:
svn propset svn:ignore [value] app config db doc lib log nbproject public ... tmp
(since app was the first folder affected, I'm guessing there's another folder before it).

2 things you can try:

  1. Specify a list file: svn propset svn:ignore tmp -F .svnignore
  2. Just specify the path: svn propset svn:ignore tmp . This should open your default text editor (if configured) to allow you to write and save the list.

Reply to comment

Since you're now attempting to correct the setting, propedit and propdel would work fine -- especially if you have other changes within the directory.

But, if you don't have any other changes to worry about (check svn st ), it'll be faster using svn revert -R and svn propset .

This doesn't answer your svn question, but why are you trying to ignore all the contents of a directory? It seems to me that if you want a temporary directory at some point in the build, you should make the directory as part of the build instead of it being there from the repo.

Are you trying to ignore it because it's already there and you can't delete it?

Anyway, from my unix command line, this worked for me to ignore untracked file in a diretory called tmp

$ svn --version
svn, version 1.5.1 (r32289)
   compiled Aug 28 2008, 10:00:12

$  svn propset svn:ignore '*' tmp

Is Windows horking your quoting?

It sounds to me like the svn.exe binary compiled for windows is doing built-in globbing, which is something that it wouldn't normally do on a unix build because the unix shell is expected to do globbing while constructing the command line. I would consider that unexpected behaviour, especially since you can't seem to work around the globbing.

As others have pointed out, you can supply the * using the -F option or interactively in a text editor.

However, I think you may not be going about this in the easiest way. For ignoring an entire subdirectory, I would do something like this:

svn propset svn:ignore tmp .

This sets the svn:ignore property on . (the current directory, the parent of tmp/ ) that tells it to ignore the tmp subdirectory and everything underneath it.

Which version of subversion are you using?

I tried 1.5.2 on Windows, and it only changed the property on the tmp directory:

[C:\Temp\temp] :svn propset svn:ignore "*" tmp/
property 'svn:ignore' set on 'tmp'

and:

[C:\Temp\temp] :svn proplist *
svn: Skipping argument: '.svn' ends in a reserved name
Properties on 'tmp':
  svn:ignore

要使用“-F”替代方法在shell脚本中使用单行程,只需尝试以下操作:

echo "*" > .svnignore && svn propset svn:ignore <path> -F .svnignore && rm .svnignore

Try it without the trailing slash. Also, the tmp directory itself has to be added to the repository.

It's reasonable to use a GUI SVN client (unless you're a masochist!). If you're on Windows TortoiseSVN should be you first port of call. Right click on the file you want to ignore then click "TortoiseSVN -> Properties". In the properties dialog you can ignore the entire directory by clicking on the drop down arrow for "Name" and selecting "svn:ignore". Then in the values box just type "*" for all. This is all without the quotes of course.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM