11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Branching and Merging$ svn checkout http://svn.example.com/repos/calc/branches/my-calc-branchA my-calc-branch/MakefileA my-calc-branch/integer.cA my-calc-branch/button.cChecked out revision 341.There's nothing special about this working copy; it simply mirrors a different directory in therepository. When you commit changes, however, Sally won't see them when she updates,because her working copy is of /calc/trunk. (Be sure to read the section called“Traversing Branches” later in this chapter: the svn switch command is an alternative wayof creating a working copy of a branch.)Let's pretend that a week goes by, and the following commits happen:• You make a change to /calc/branches/my-calc-branch/button.c, which createsrevision 342.• You make a change to /calc/branches/my-calc-branch/integer.c, which createsrevision 343.• Sally makes a change to /calc/trunk/integer.c, which creates revision 344.Now two independent lines of development (shown in Figure 4.4, “The branching of onefile's history”) are happening on integer.c.Figure 4.4. The branching of one file's historyThings get interesting when you look at the history of changes made to your copy of integer.c:$ pwd/home/user/my-calc-branch$ svn log -v integer.c------------------------------------------------------------------------r343 | user | 2002-11-07 15:27:56 -0600 (Thu, 07 Nov 2002) | 2 linesChanged paths:M /calc/branches/my-calc-branch/integer.c* integer.c: frozzled the wazjub.------------------------------------------------------------------------r341 | user | 2002-11-03 15:27:56 -0600 (Thu, 07 Nov 2002) | 2 lines89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!