Page 154 -
P. 154
• D for a file that was deleted
• R for a file that was replaced (meaning that the file was deleted and a new one with the
same name was added—which will be considered a new file with a distinct revision
history)
• G for a file that was changed and those changes were successfully merged into the work-
ing copy
• C for a file that could not be merged because of conflicting changes
Make changes to the code
Once the working copy is up to date with the latest revision, the programmer can make
changes. Generally, these changes will be done using whatever editor or IDE the program-
ming team has always used. Subversion does not require that the working copy is up to
date in order for the user to make changes. The repository will generally change while the
user is making changes; the programmer will merge these changes into the working copy
before committing it back to the repository.
Sometimes files need to be added. For example, the programmer might add a file called
Makefile to the hello-world project. Subversion won’t recognize the file if it is simply added,
so the programmer must also let Subversion know that the file is there:
$ cd hello-world/trunk
$ svn add Makefile
A Makefile
This tells Subversion that the file Makefile has been added to the working copy. The pro-
grammer must commit the working copy in order to add the file to the repository. The
delete, copy, and move commands all work in a similar manner (see Table 7-6).
TABLE 7-6. Commands to make changes to the working copy
(reprinted with permission from Version Control with Subversion)
svn add foo
Schedule file, directory, or symbolic link foo to be added to the repository. When you next commit, foo will become
a child of its parent directory. Note that if foo is a directory, everything underneath foo will be scheduled for addi-
tion. If you only want to add foo itself, pass the --non-recursive (-N) switch.
svn delete foo
Schedule file, directory, or symbolic link foo to be deleted from the repository. If foo is a file or link, it is immediately
deleted from your working copy. If foo is a directory, it is not deleted, but Subversion schedules it for deletion.
When you commit your changes, foo will be removed from your working copy and the repository.
svn copy foo bar
Create a new item bar as a duplicate of foo. bar is automatically scheduled for addition. When bar is added to the
repository on the next commit, its copy history is recorded (as having originally come from foo). svn copy does not
create intermediate directories.
svn move foo bar
This command is exactly the same as running svn copyfoo bar; svn delete foo. That is, bar is scheduled for addi-
tion as a copy of foo, and foo is scheduled for removal. svn move does not create intermediate directories.
146 CHAPTER SEVEN