2
votes

Problem (updated)

1. How can I replace the old version source code with new version?

I used TortoiseSVN to create a svn folder called svn://svn.domainname/program/android and uploaded these source code:

  • source code of an Android project
  • source code of a supporting library

The local path (in my Mac) of the uploaded files is:

~/svn_android/,

and the local path (in my Mac) of my Eclipse workspace is:

~/dev/android/workspace/.

After making some changes to my project in ~/dev/android/workspace/, I want to commit the new version to svn, but it doesn't work by just deleting all files in ~/svn_android/ and copying new version code from ~/dev/android/workspace/ to ~/svn_android/ and committing them.

Updated: There are many newly created files and many modified files, so I don't know what can I do except deleting all of them (except the ~/svn_android/.svn folder) and copy-and-pasting into the folder with all of the current version source code.

2. Should I upload the metadata of Eclipse IDE?

Eclipse is used as IDE for the project. Not sure whether the metadata used in Eclipse has been uploaded in this process. The metadata folder/file is listed here:

  • ~/dev/android/workspace/.metadata (folder)
  • ~/dev/android/workspace/.DS_Store (folder)
  • ~/dev/android/workspace/myproject/.metadata (folder)
  • ~/dev/android/workspace/myproject/.settings (folder)
  • ~/dev/android/workspace/myproject/.classpath (file)
  • ~/dev/android/workspace/myproject/.DS_Store (file)
  • ~/dev/android/workspace/myproject/.gitignore (file)
  • ~/dev/android/workspace/myproject/.project (file)
1
Do you mean the .project .classpath files? Those generally do not get added to source control. - Rich Schuler
You should not be deleting all files in ~/svn_android/. I don't know about OSX, but in Linux and Windows, there usually will be SVN meta data folder at ~/svn_android/.svn/. So, keep the .svn and delete other files, then copy new files from ~/dev/android/workspace/. That should work. - ozbek
To @shoerat, do you mean copying all of the current version source code or just the newly created files? - George
To @Qberticus, then should I manually delete those .project, .classpath files (see above updated post for the whole list of those meta files) - George
Once files are deleted, copy everything (existing and new) you want to commit. As for the new files, you have to first add them: TortoiseSVN GUI > Add. - ozbek

1 Answers

4
votes

Solution to the problem:

You should not be deleting everything in ~/svn_android/ folder. I don't know about OSX, but in Linux and Windows, there usually will be SVN meta data folder at ~/svn_android/.svn/. So, keep the .svn and delete other files/folders, then copy your working files from ~/dev/android/workspace/ and commit. As for the new files, you have to first add them: TortoiseSVN GUI > Add.

What I personally would do:

I would keep both local copy of SVN repository and Eclipse project at the same place so that there will be no need for copy/pasting. That's, in Eclipse

New Project > Android Project from Existing Code > Root Directory: ~/svn_android/

At this point, leave "Copy projects into workspace" unchecked.