0

I worked all day on several new files in an SVN directory.

At the end of the day I added and committed them. Unfortunately I did that from my laptop (I was going back and forth between the two dirs) which had basically empty files and the next morning I did an update on my main PC which wiped the files I had worked on all day. I tried various 'recover', log, info, etc and found no trace of any previous version.

Is there any way to get the version that was wiped by the first update. I didn't get any warning.

dargaud
  • 2,431
  • 2
  • 26
  • 39
  • Are you sure you don't have a "tree conflict"? Is it possible your local files are renamed? – wimh Dec 23 '12 at 10:07

1 Answers1

0

Can you give us more details? Were the files you lost on your PC committed into Subversion? If they were, you should be able to recover them even if they were deleted on your laptop.

Were these files uncommitted local files? Probably no way to get them back. However, Subversion rarely deletes stuff willy-nilly. Modified files are updated when an update is done and modified sections are never deleted. If a file isn't in the repository, it will never be deleted when an update is done even if a file of the same name was created in the repository. In that case, you'll get a conflict.

Maybe a future hint: Use Dropbox for your Subversion working directory if you're moving back and forth between two machines. Dropbox automatically syncs the two directories -- even Subversion working directories. Plus, it stores a history of the file changes outside of Subversion. You cannot, no never, do not, not allowed, don't do, use a Dropbox directory with Subversion at the same time on two machines. However, if you are merely going back and forth between two systems, it works pretty good.

David W.
  • 105,218
  • 39
  • 216
  • 337
  • WC on Dropbox is Bad Idea (tm)!!! "Always commit" and "always update" is The Right Way! For Subversion over Dropbox I'll recall Occam's Razor – Lazy Badger Dec 23 '12 at 16:17
  • @LazyBadger. You definitely can't have more than one person using a dropbox directory, but I haven't found any issues using Dropbox in a _serial_ manner. You should commit often, but you also don't want to commit incomplete work and break the build. If nothing else Dropbox saves older versions of my files after each edit. That allows me to get back older versions that I might not have committed. As a bonus, I can work on my laptop at home and my PC at work. An alternative is gitsvn which would allow you to do local commits, and only commit complete work to Subversion. – David W. Dec 23 '12 at 17:08
  • I'm not exactly sure that's quite how it happened, but I don't really see another way. I must have started working on those new files from my laptop, but then switched to the PC. I had to go back and forth because the PC had the dataset on which to run the code. So basically the code I wrote on the PC wasn't really deleted but overwritten by the mainly empty ones. It was their first commit. Still, I'm surprised I made that mistake. – dargaud Dec 23 '12 at 17:25
  • I **have and use** Dropbox *this* way. And I freely commit incomplete work and don't worry about broken builds (I use branches and don't follow blindly "trunk must always work"). And my main rule "Shit may happens and always happens, be ready" is more-bullet-proof, than blind presumption and cry "All lost" – Lazy Badger Dec 23 '12 at 19:37