Flumes Subversion tutorial assignments

Flumes
Subversion - Basic Usage Tutorial
2014-01-03
You need a Flumes Subversion account to follow this tutorial and it assumes that you have
read the “Flumes Short Guide to Subversion”. In some places it assumes that you are using the
TortoiseSVN Windows client, but other clients will work too.
1. Checking out a new WorkingCopy and updating existing ones
(a) Use the SVN checkout command to create your WorkingCopy of the latest revision of
the files from the server. Use the account and test repository URL given to you. The
URL should be similar to https://flumes.iei.liu.se/svn/test/tutorial.
(b) To make sure that your files are up to date you can at any time run the SVN update
command. Try it now!
2. Adding new files and directories to subversion
(a) Navigate into the tutorial subdirectory and create a new directory with your liuId as
its name. This will be your home directory for these exercises.
Add two empty plain text files to your new directory, edit them and add a few lines
of random text. Right click your “liuId” folder and select SVN add to add the folder
and its contents. Beware! if you add large folders with lots of contents you must
uncheck those files that you do not actually want under version control. Files that are
automatically (re)generated (very often), temporary or in other ways useless should
not be added to the system. Every file that is added to subversion will be in the system
forever, even if you remove them later.
(b) To send your changes to the server use the SVN commit command. In the commit
window you should enter a log message describing the changes that you have made.
This will make it easier for other or yourself to track changes later on. The committed
files should now be marked by a green icon showing that they are in sync with the
latest known state at the server. If you encounter a message telling you that your
working copy is not up to date you need to run update, others may have made changes
to the files.
3. Handling local modifications
(a) Open your text files and make some changes to the text, save the files. The icons will
change to reflect that your local files are different from the version that was previously
fetched from the server. All files or directories who’s contents have changed will be
marked with such an icon. Note! in Windows it can sometimes take a while for the
icon graphics to update.
(b) If the files you have changed are plain text files, such as source code, scripts, or latex
documents, you will be able to use the SVN diff command to see the changes that
have occurred in the file, compared to the last version. Use the diff command on one
of your files to see the local modifications.
(c) Also try the CheckForModifications command (TortioseSVN) to see an overview of all
local changes. This is useful when you have made a lot of changes.
(d) If you want to undo local changes use the SVN revert command. Try this on the other
file, it will be restored to the previous version. Warning! all changes will be lost, be
careful so that you do not revert your entire directory as you may loose changes in
other files as well.
(e) Commit your changes
1
Flumes
Subversion - Basic Usage Tutorial
2014-01-03
4. Copying, Moving and Renaming files or directories
(a) To keep the history of files and directories you MUST NOT use the move,copy and
rename functions in your operating system. If you do, subversion will think that you
have added a new file and that the old one is missing. Rename one of your test files the
normal way and you will see that it will loose its green version control icon, the icon
will change to a question mark indicating that the file is not under version control.
If you run SVN update the old file will be restored, subversion thought that it was
missing. You will now have two different sets of the same file (this is bad).
(b) Now rename the file using the subversion command, in some clients there is no rename
command, then you can use move instead. Note that the icon changes to that of a
newly added file. Commit your changes. In the commit window you can see that the
old file has been removed and the one with the new name has been added, but note
the + next to add. It means that the newly added file is actually an internal copy of
an other file. When you commit, no files will be created or removed on the server, only
an indication that the name has change will be added.
(c) Create a new sub directory under your home directory and add it to svn. Now use the
built in SVN copy command by right click dragging and dropping a text file to the
new directory. Select subversion copy from the options that you get, (also notice the
move command). After a successful SVN copy, commit your new folder and copied file.
On newer TortoiseSVN versions you can also use the operating system copy and cut
commands, but then you must use the subversion paste command from the TortoiseSVN right click sub menu.
5. Checking file history and revision logs
(a) To track changes you should look at the revision history. In some clients this is referred
to as log. In TortoiseSVN, right click a directory or file under version control and
select “show log”. Show the log for your entire home directory, Uncheck “stop on
copy/rename”, you can now see the changes for each new revision, note your copy and
rename operations. You should be able to see the previous source of the files under
“Copy from path”. The file history has been preserved.
6. Removing files
(a) Use the SVN remove command to remove files. Try this on your copied text file. The file
will disappear from your working copy and from the latest revision when you commit
your changes. The file will not be delete on the server, however, and you can always
access it through your history. If you would only use your operating system delete
function, subversion will think that the file has gone missing and will restore it the
next time you run update.
7. Exporting a WorkingCopy to an ordinary file structure
(a) Subversion keeps duplicate copies of all your files in your working copy. These and
other helper files can be found in a hidden “.svn” directory in your working copy. If
you want to detach a copy of your project files, you do not want to include all of the
version control help files. Use the SVN export command to export your files (your
home directory) into a “ordinary” file tree. Your exported copy will not be under
version control and no hidden folders with duplicates and help files will be present.
2