60 likes | 230 Views
Version Control with Subversion. When multiple developers are working on the same software, there is a danger that one developer might overwrite the changes made by another developer. Version control systems like Subversion are designed to eliminate such dangers from collaborative efforts.
E N D
Version Control with Subversion When multiple developers are working on the same software, there is a danger that one developer might overwrite the changes made by another developer. Version control systems like Subversion are designed to eliminate such dangers from collaborative efforts. Subversion Page 115
The Lock-Modify-Unlock Solution One means of protecting everyone’s changes is to only permit one developer to have write access to any file at a time. This approach is hard to administer, compels unnecessary serialization (i.e., what if Harry and Sally are working on independent parts of the same file?), and might ignore needed serialization (what if Harry and Sally are working on separate, but dependent files?). Subversion Page 116
The Code-Modify-Merge Solution Subversion emphasizes an alternative approach, allowing developers to edit whatever files they want and then merge their respective versions. When the versions are merged, a determination is made about whether they potentially conflict with each other, in which case the developers must manually resolve the conflicts themselves. Subversion Page 117
Apache Subversion The Subversion approach utilizes a “trunk” as the main line of software development. Developers initiate separate lines of development, known as “branches”, in order to safeguard the trunk’s integrity. Periodically, the developer will “merge” the changes to the trunk made by other developers via an update command. Conversely, after resolving any conflicts, the developer’s branch can be merged into the trunk via a commit command. Occasionally, the developers will preserve a snapshot of the repository, called a “tag”, which can serve as an actual release of the software, with no further commits to it permitted. Subversion Page 118
Subversion on Windows: TortoiseSVN After editing to resolve conflicts, modifications can be marked as resolved. Undoing all changes since your last update, you can revert to a previous working version of the code. Updating what you’re working on by merging all other committed changes to your branch. After resolving any conflicts, committing your changes to the trunk. Setting up a new copy of your working copy of the system, to be used either as a branch (for further editing) or a tag (as a preserved, unchangeable copy). Subversion Page 119
Day-to-Day Subversion Activities While Subversion has dozens of commands available, for our purposes, we’ll only need the following basic commands for our CS 325 group projects. Subversion Page 120