Tortoise Subversion 1.9.4
Last revised/verified: 2016-04-29
is a subversion client that works inside Windows Explorer (not
Internet Explorer) letting you do your work with right clicks. It is
not quite full-featured, but it is simpler since is uses the
familiar directory displays.
gmane.comp.version-control.subversion.tortoisesvn.user
is a newsgroup to discuss TortoiseSVN. It is carried free on
newsserver news.gmane.org. You will need
a newsreader to access it, not a browser. Unfortunately, has been no
traffic on it lately.
Steps
Here are the basic TortoiseSVN operations to get set up:
- Create the repository at your Subversion
Host.
- Configure the subversion ⇒ settings
→ edit subversion configuration file. This a text file
containing comments to help you configure it.
- Configure your global-ignores.
- Configure your auto-props in
C:\Users\user\AppData\Roaming\Subversion\config., acessible via right
click TortoiseSVN ⇒ Settings ⇒ edit something
like this:
- Import a directory tree into the
repository. As with all version control systems, it takes some
experimenting so that when you import a directory or file, it goes
where you expect it to in the repository tree. One of the easiest
ways to get started is to use the repo-browser, navigate in the
repository of the parent of the directory you want to add and select
add folder.
- Checkout part of the repository, usually
to a different spot on disk from where you imported it from. This is
where you specifiy the
URL (Uniform Resource Locator)
(and protocol) of your repository on the server, e.g. https://wush.net/svn/salamander
- Make a change to some of the checked out files.
- Use Update to fetch any recent changes
to the repository made by other people. Subversion will attempt to
merge your changes with those of other people. You will have to look
its attempt over and correct any errors.
- Commit the merged changes to record them
in the repository.
- Add a file, group of files or dir to the
repository that are not represented there (perhaps out of date)
already.
- Commit the add. The files are not copied
to the repository until you do the commit of all previous adds in
one fell swoop.
- Delete a file from the checked out
files.
- Commit the deletion. This will mark the
file as deleted in the repository and it will throw away the
previous update history. You won’t be able to get it back with
Subversion.
- Use the Repo-Browser delete of a file
or directory. This will delete all history of this file or directory
from the respository.
Global Ignores
The TortoiseSVN client in 100% responsible for deciding what files and
directories will be included/excluded from the repository. The server
accepts everything. You can specify a set of global excludes, or as
Subversion calls them ignores, like this: *.class *.com *.digest *.exe *.jar *.log *.log.html *.lst
*.map *.obj *.raw *.ser *.sln *.table *.tmp *.zip */javadoc */jetpdb
Debug javadoc jetpdb Release temp.* temp?.* temp?.*. Note how
you must specify directories to exclude twice, once with and once
without the /. Otherwise,
when they are the direct child folder of the import directory they will
not match since there is no / in the name. This is the side effect of
the way Tortoise does filename pattern matching with regexes rather than
wildcards.
You can specify the excludes in the global ignore
settings, or in the Subversion configuration file with:
global-ignores =
*.class *.com *.digest *.exe *.jar *.log
*.log.html *.lst *.map *.obj *.raw *.ser *.sln *.table *.tmp *.zip
*/javadoc */jetpdb Debug javadoc jetpdb Release temp.* temp?.*
temp?.*
or after you have done a checkout, add by right clicking on a file or
directory you do not want to include and selecting add
to ignore list. Oddly, you can’t make such file-by-file
two-click exclusions prior to or during the import. Adding ignores
won’t delete any existing files or directory from the
repository. It is merely a list of what you want to ignore, not what
everyone has to ignore.
Files
TortoiseSVN will create a .svn directory in
any directory, or mother of a directory, you have checked out.
Don’t delete or modify any of the files in it. It is
considerably bigger than the equivalent .cvs
directory. In it is a pristine directory
tree where it keeps copies of all your versioned files as there were
at last checkin but renamed to be unique. It also keeps an
SQL (Standard Query Language)
databese called wc.db where it tracks what
is in all the pristine files and the
various properties.
Tips
- There are two rename commands, one
immediately visible when you right click and one inside the Tortoise
subversion sub menu. Use the second, or you may find
TortoiseSubversion later undoing your renames.
- Use cleanup and/or update
when TortoiseSubversion appears to be giving the wrong status to
your files or directories. It only works on entire directories, not
individual files.
- Use commit with the show unversioned
files option to find out which files you have failed to add or
explicitly exclude.
- Use the recent message option to find
the reason text of recent commits rather than typing it over and
over.
- Subversion has three sources of information:
- The repository. You can find out what is on file with the
repo-browser.
- The .svn subdirectories of any
directory under version control. The very existence of this
directory is evidence it is under Subversion control. These must
not be meddled with, not even redated, except as a last resort.
- The current contents of the client files.
Subversion is rather delicate for a backup tool. It is very easy to
get it out of sync, to accidentally delete or to fail to save.
- Don’t use any other tools but Tortoise Subversion and svn.exe to delete or rename files under
Subversion control.
- Use svn.exe for repetitive work. It is
bundles withTortoise Subversion. It is the command line client for
SVN (Subversion). I
found it easier to learn than Tortoise because you can type svn
help revert etc. and it will not only
explain how to use the command, it will explain what it does. Here
is how I used it paired with Take
Command to remove all *.css files
from all my Subversion repositories:
- I you get into a bind with an uncorrectable tree conflict, MKCOL
errors, crashes etc., you can use this drastic solution. Copy the
files in the damaged directory to a safe place. Use the Tortoise
Subversion delete to delete the entire troublesome directory and
commit it. Then copy the files back into the local directory and
recommit them from scratch. The catch is you will lose all your
version history.
Deleting
If you accidentally add a file to the repository, you can un-add it if
you have not committed yet.
If you want to delete the file on your disk and mark it as deleted in
the repository, use
SVN
delete then commit.
If you want to keep the file on your disk, but no longer track it in
the replository, use
SVN
delete and add to ignore list, then commit.
If you want to delete all record of the file of ever having existing
from the repository, find it is the repo-browser and delete it and use
delete to delete it from your hard disk.
Advantages of Tortoise Subversion
- Though Subversion still has add/commit, Tortoise subversion
automatically commits when you add.
- It is fairly intuitive to use. Just left click on a directory and
follow your nose.
Disadvantages of Tortoise Subversion
- Even though it is quite old, every version corrects over a dozen
bugs. There is something wrong with quality control if bugs are
still being found after all this time.
- There is a bug that has frozen one of my directories. I
can’t do anything with it. There does not seem to be a way to
start that directory over from scratch.
- TortoiseSubversion often gives you the wrong status for a
directory or file. Sometimes it is just lazy in updating. Sometimes
it gets confused. Using Cleanup and Update often clear the problem.
- Cleanup crashes TortoiseSubversion every time I use it, however,
it does its work before crashing.
- TortoiseSubversion often ignores your global includes. Running
cleanup often gets it back on track.
- You can’t sort files by status. This makes it hard to find
one needle file in the haystack that is causing trouble.
- Global ignores are not global. The value displayed at any level in
the directory differs from the value in the file.
- This is a small flaw but it is highly irritating. Its progress
meters stop half way when the work is done. I find myself waiting
for it to complete long after it actually has completed because I
have been watching the progress meter, waiting for it to complete.
- If anything happens to its svn directory, cleanup may not be
sufficient to recover. Sometimes the only way I could get it working
again was to save my files elsewhere, delete the what I no longer
wanted to track from the repository with repo-browser, then delete
the entire directory containing the directories I just attempted to
delete from my local hard disk, the do an update, then copy back in
my files and recommit. Smaller hammers include: cleanup, update,
resolve, revert. It should be able to recover loss or deletion of
the svn files without the massive spoon feeding it currently
requires.
- If you accidentally click delete and add to
ignore list even if you detect the problem before
committing that delete, there is no way I could find to undo it. Any
attempt will render your files in conflicted state.
- If you try to delete a directory, when you still have uncommitted
changes pending, it sulks.
- Even when you are the sole user of your repository, it often
secretly wants you to update before commit to update your local
files with potential changes from other users.