Setting up and how to use a SVN Repository on Windows Setting up and how to use a SVN Repository on Windows

SVN Stands for SubVersion. "A version control system initiated in 2000 by CollabNet Inc. It is used to maintain current and historical versions of files such as source code, web pages, and documentation."

Seting up your Client, and Downloading from the repository

The first step for you as a user, is to download a client to connect to the repository.
TortoiseSVN is the Recommended Client, and what this tutorial will be based on http://tortoisesvn.tigris.org/
  1. Download Tortoise from http://tortoisesvn.tigris.org/
  2. Install Tortoise.
  3. After installing, in a location of your choice Create a Folder called "Cotonti" (or a name of your choice)
  4. Right Click on the Folder and Select "SVN Checkout.."
  5. Insert svn://svn.cotonti.com/trunk/ as the "URL of repository:" Leave all options as they are, leave it on "HEAD revision" This will grab the latest version, If you need a certain revision, you may specify that number in the other option (This is not the Cotonti Version Number).
    • /trunk/ is the development version of Cotonti, these are upcomming builds, please note this is not recommended for use on live/production sites.
    • If you want a stable build, grab it using the same method, just point to the /releases/version/ you need.
    • If you want the entire repository, this includes trunk/brances/releases just keep the url as sv://svn.cotonti.com/ (please note this is quite large).
    • If you want anything specific or need to find a path name for releases or something, you may brows the svn at http://trac.cotonti.com/browser/ and may use the svn paths here to checkout any sepcific folder you want.
    • It is recommended to, upgrade to the latest version of Cotonti, or conflicts may occur when running patches.
  6. Download Process will being downloading the latest files from the Repository.
  7. Done!
Updating

Updating to the newest version, is simple.
  1. Right Click on the folder you made above.
  2. Click "SVN Update".
  3. Download Process will being updating to all the latest files from the Repository.
  4. Done!

  5. Patching with patch files
    This is actually a pretty simple process.
    1. Download the patch file(s) you wish to use.
    2. It is recommended, to patch only if your files are clean(unmodified). To clean them you may delete all the files in your folder, and Update/Checkout again, or Right click, Hover to "TortiseSV", and choose Revert. Then Revert all files that are modified. Also, it is best usually if you use the latest most up to date files.
    3. Right Click on the folder you made above.
    4. Hover over "TortoiseSVN".
    5. On the new menu Click "Apply Patch.."
    6. Browse to the patch file you want to use, and open it up.
    7. A new window will open up.
      • The window on the far left, will contain the names, of the files that will be patched.
        • Black Name means your version of the file matches the version the patch was created for.
        • Red Name means your version of the file does not matches the version the patch was created for. If this is the case, Tortoise will download the version of the file the patch was made for, and in short compare it with yours, and will keep what is in your new file, while adding the patch correctly still where it was supposed to go.
        • Grey Name means you have already ran the patch on this file.
      • The left section of the main window (After you click on a file name or Right click "Preview patch file") contains your file (before its modified) (see the note below regarding a patch that was made for an old version)
        • If you had a red file name, This window will contain the orginal file the patch was made for.
      • The right section of the main window (After you click on a file name or Right click "Preview patch file") contains your file, along with what is being added (+ symbol and colored lines) or removed (- symbol and colored lines). This will be the file after the patch is applied. (see the note below regarding a patch that was made for an old version)
        • If you had a red file name, This window will contain the patched version of (your orginal) file.
      • In the case that you have a bottom section (when you had a red file name). This window will contain the final output of the 2 files being merged together, with what is being added (+ symbol and colored lines) or removed (- symbol and colored lines). This will be the Final output your file is saved as.
    8. Here, you may manually insepect each file before its is patched. If you wish to patch the file your currently looking at, in the File Name Window, Right Click on it an choose "Patch selected". If you have no Red file names, You can just go on and Right Click, and choose "Patch All". It is recommended if you had Red file names, to manually inspect the files, for conflicts, but you may just patch all without doing this.
    9. After you have patched all files (each file name will be Grey) You the window.
    10. Done! Your files have been patched with the file you selected, you may repeat this for any other patches you wish to apply.

    How to create patches
    Again this is actually a pretty simple process.
    1. Before creating a patch be sure that your files are clean(unmodified) or this may cause problems, or do unwanted things for other users.. To clean them you may delete all the files in your folder, and Update/Checkout again, or Right click, Hover to "TortiseSV", and choose Revert. Then Revert all files that are modified.Also, it is best usually if you use the latest most up to date files.
    2. Modify any files necessary for your patch, in the SVN folder.
    3. Right Click on the folder you made above.
    4. Hover over "TortoiseSVN".
    5. Click "Create Patch..."
    6. A new windows open which will list all modified files, select the files(should be all likely) that you wish to include in your patch, and press "Ok"
    7. Pick a Name for your patch file, its recommended to make things easier for everyone to use a similar filename to the the following. My_Patch_Name_v#_#
      • "My_Patch_Name" Is what you will call your patch. Please replace spaces with underscores "_".
      • v# Is your version number for this patch EX v1, or v0.1, v2.4
      • The final # is the Current SVN Revision Number, (Right now is its just started the current Revision number is 1
      • So Your final filename would be something like, "My_Patch_Name_v2.4_1"
    8. After the File is saved, Archive it, in a zip or rar file. Then upload it to the site of your choice.
    9. Share it! And your done!

    General Notes
    • A Green Checkmark on a file/folder means that it is unmodified file, for your current revision.
    • A Red X on a file/folder means that is is a modified version, for your current revision.
    • A Yellow ! on a file/folder means that there is a conflict (it was unable to merge changes you made), for your current revision.
    • There is a hidden folder in every folder, called .svn, this just contains, information used by Tortoise regarding version info etc.


No comments yet
Only registered users can post new comments