I have a file in a Subversion repository which changes almost every time it's opened in the IDE, thus creating conflicts on almost every update.
Is it possible to force SVN to always overwrite the local file with the one in the repository, even if there are local changes?
EDIT: It's a VB6 project file. Those contain GUIDs of the referenced ActiveX classes and their local file names. When a project is opened, the local file names are automaticall updated. It has to be under version control because the application cannot be built without it.
The svn update command never discards or removes local changes made in your working copy.
When you check out with the --force option, any unversioned file in the checkout target tree which ordinarily would obstruct the checkout will still become versioned, but Subversion will preserve its contents as-is.
If you want to undo all changes you made in a file since the last update you need to select the file, right click to pop up the context menu and then select the command TortoiseSVN → Revert A dialog will pop up showing you the files that you've changed and can revert.
svn update brings changes from the repository into your working copy. If no revision is given, it brings your working copy up to date with the HEAD revision. Otherwise, it synchronizes the working copy to the revision given by the --revision ( -r ) option.
Firstly, I feel sorry for you for having to work in VB6.
Secondly, I suppose what you really need to do is delete the file before you update. So in this case, you could have a bat file called 'do update', and you just double-click that, instead of actually using TortiseSVN (or whatever) to do the updates. You make this bat delete it, and then, unsurprisingly, update.
Incredibly lame, but I do see your problem that the file needs to be in source control, yet you want to disregard general changes unless explicitly committed.
I guess that this is a file, which is always dynamically created/modified by your IDE.
I think if you add this file to the svn:ignore settings, this would better fit your needs. Look at the svn-configuration for more details. This setting makes your SVN ignore this file on adding or importing. With it you could also keep your local changes to the file, in case you have the necessity to do so at one point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With