Why does TortoiseSVN show the "modified" status icon for my working folder if there are modified, yet ignored files? Ignoring config file problems

StackOverflow https://stackoverflow.com/questions/17077522

Domanda

I'm a bit new to subversion/tortoiseSVN, and am a bit confused about how to deal with config files which should be different in developement and deployment, and I think my problem stems from this issue.

I want the central repository to have the config.php file that matches the deployment config file. So once that's in the repository and the deployment server is updated, I then updated my working folder in development, and right clicked the file and chose "unversion and add to ignore list" for this file. Now, it shows the deleted symbol and the whole working directory as modified. When I choose to commit everything, the commit dialog box shows the config.php file as deleted, but in the "ignore-on-commit" list, so that it doesn't get committed.

First of all, how did it get to the "ignore-on-commit" list?

Second of all, should be it be on that list? Like I said, I don't want to overwrite the config.php file on the repository, but I don't want to delete the config.php file altogether. I just want it different in my development checkout. Am I doing it the right way?

And lastly, why doesn't the status icon change?

Thank you.

È stato utile?

Soluzione

You cannot ignore files that are already in the repository.

Reread that first sentence.

Ignoring something in a version control system says to ignore files that aren't already in the version control system. For example, Imagine you have a compilation process that took the *.c files that are in your repository and compiled them into *.o files. The *.o files are simply part of the compilation process, and you certainly don't want them accidentally added into your repository.

If you ignore *.o files, and you did a svn status in Subversion, Subversion won't report on those files. If you did a svn add *, Subversion won't add those files to your repository. That's what ignore means in a version control system.

If you modify a file, and you don't want to change it when you do a commit, you have a few choices:

  • Use changelists to organize your files.
  • List the files you want to commit on the svn commit command line.
  • Revert the files you don't want to change before you do a commit. Before I commit, I always do a svn status just to make sure that I'm not accidentally modifying a file that I don't want to change.

I don't know how changelists work in TortoiseSVN, but you can put the files you don't want to commit. The files you want to ignore, into a changelist. The problem is that you can't operate on negated change lists. For example:

$ svn --cl ignore foo bar barfoo
$ svn status
M  blat
M  floob

--- Changelist 'ignore'
M foo
M bar
M barfoo

I can't say:

$ svn ! --cl foo commit

and only commit changes on floob and blat (unless I create a changelist for these files too).

Instead, you'll revert the files in your changelist ignore, then commit:

$ svn revert --cl ignore -R .  #Reverts all files in the changelist
$ svn commit --keep-changelists #Commits all other files

Note that the --keep-changelist option will keep the files you put on the changelist on the changelist even though they have no changes. This way, you can revert them again before the next commit.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top