5

I'm using AnkhSVN with Visual Studio 2010.

When I start to edit a file, I'd like to either automatically update the file from the repository, or be warned that it needs updating.

Is this possible?

Fernando
  • 1,239
  • 1
  • 16
  • 27
  • 2
    me think it can cause problems, what if the file you are editing updates and has dependencies on other files and when you are either running/deploying/compiling you might get errors and bugs and issues that will force you to update everything just to be certain not to chase a wild goose. – Max Oct 12 '11 at 18:35

2 Answers2

2

Would keeping the working copy updated be of use?

If so, you can use this: How do I automatically update a Subversion working copy?

Community
  • 1
  • 1
Tom
  • 964
  • 9
  • 25
  • I don't necessarily want to constantly be updating everything. However, when I'm going to make a change to a file, it would be good to know if what I have is out of date--and to perhaps automatically update it. – Fernando Oct 12 '11 at 18:18
  • In the question I posted someone mentioned svn notifier, from: http://svnnotifier.tigris.org/. I see it can perform automatic updates (http://svnnotifier.tigris.org/img/5.jpg). You will always be updated, though not "constantly" as in "constantly executing a scheduled task". I'm not sure if that's what you mean. – Tom Oct 12 '11 at 18:25
  • Also, you can't update a repository, you can update a working copy though – Sander Rijken Oct 12 '11 at 18:25
  • Well---I don't want to have all sorts of files updating out from under me without my knowledge. I am looking for something to (optionally, at my discretion) update a single file just before I edit it. – Fernando Oct 12 '11 at 18:27
1

There's not really a way to do this in Subversion, except when you're using locking and svn:needs-lock on files. The reason is that when you start editing your file can be up to date, but when you want to commit it's changed, and needs updating. Subversion will check for this case and notify you to update when you try to commit.

To get notification of files others are working on, you can go to the "Recent changes" tab in the Pending Changes window (View -> Pending Changes, then click the 3rd tab from the top). You can configure this to update every 'X' time, UI should be pretty self explanatory here.

See my answer here for info on svn:needs-lock, but make sure you understand the pitfalls of exclusive locking of files.

Community
  • 1
  • 1
Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
  • I understand that it might be changed by the time you commit, even if you've got an updated version when you start to edit it. But it would still make sense to have an updated version before you start! – Fernando Oct 12 '11 at 18:24
  • The answer to that can be simple: No AnkhSvn doesn't do that. Thinking about it, it might be a useful feature, but difficult to implement in a way that helps you. You most likely don't want to update just that file, because more often than not other files have to be updated as well. And a confirmation would be necessary, where we try to keep AnkhSvn as unobtrusive as possible. I you have a good idea how this should work (functionally), please request it at http://feedback.ankhsvn.net/ – Sander Rijken Oct 12 '11 at 18:42
  • Speaking of the "Pending Changes -- recent changes" for AnkhSVN in Visual Studio 2010 -- I can't seem to find the location where you set the refresh time period. – Fernando Oct 12 '11 at 19:49
  • Could be that's only available in daily builds right now, but new releases are on the way – Sander Rijken Oct 12 '11 at 20:31