views:

32

answers:

3

Late one afternoon, I did an export of my project repository, and took home my work on my USB key.

I've added many changes to the exported project, and now, having returned to the workplace, I want to update the repository with the project that I've now got.

To complicate matters, I've made updates to the project in both the main trunk and a branch - and I'd like to update the repository to reflect all those changes.

I'm new to SVN and have been relying on tortoise SVN, but I'm a bit lost now.

Would I be best to delete the repository and recreate it from the copies/branches I now have?

thanks

A: 

Not sure what's best, but I was in similar situation to yours and deleting and recreating was the best way out for me.

Gunner
Deleting and recreating __what__?
sbi
+2  A: 

Short answer: you can't. You shouldn't have "exported" your repository, but "checked it out".

Perhaps the easyiest way (depending on the size of the changes) would be to check out the repository in another directory, and manually copy your changes over that. Then commit all changes.

jeanreis
also useful response, thanks for the help!
freefallr
+4  A: 

Disclaimer: I'm not entirely sure whether this is the optimal solution and whether there aren't downsides. I can't see any, because the important .svn directories are not being touched, but I'm no SVN Guru. I recommend you make backups (well, one should anyway) and see what other answerers have to say.

If you're on Windows, I think it should be possible to do the following:

  • Check out a working copy (e.g. into /myproject)
  • Take the /myproject folder from the USB stick and copy+paste it over the local /myproject checkout
  • Windows Explorer should now integrate the two folders, leaving the invisible (and essential) .svn files in place, but adding any changes and new files from your exports.

  • You should now be able to do a "check for modifications" in Tortoise. Changed files should turn up as changed; new files and directories should be able to be added. The only thing this method will not cover is files and directories you deleted in your export.

You would have to do this individually for each branch I think - or at least I would do it just to make sure. But that is probably a minor inconvenience.

Pekka
+1 for noting that deleted files / dirs will not be picked up. Otherwise, this method is fine. (Although obv the OP should have "checked out" rather than "exported" in the first place).
Vicky
Don't forget to check for unversioned files that are new to the repo coming from the stick!
Arne Burmeister
thanks, I gave your idea a go, and found that it was best to just delete the repo and recreate it from my latest project.
freefallr
@user if the change history isn't important, that is surely the easiest way.
Pekka