11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basic Usagethe entire thing, but you'd be well served to take a look through the working copy for unversionedfiles. To find these files, run svn status and review any files that are prefixed <strong>with</strong>a ? to make certain that they're not of importance. After you're done reviewing, you cansafely delete your working copy.Recovering from an InterruptionWhen <strong>Subversion</strong> modifies your working copy (or any information <strong>with</strong>in .svn), it tries todo so as safely as possible. Before changing the working copy, <strong>Subversion</strong> writes its intentionsto a logfile. Next, it executes the commands in the logfile to apply the requestedchange, holding a lock on the relevant part of the working copy while it works—to preventother <strong>Subversion</strong> clients from accessing the working copy mid-change. Finally, <strong>Subversion</strong>removes the logfile. Architecturally, this is similar to a journaled filesystem. If a <strong>Subversion</strong>operation is interrupted (e.g, if the process is killed or if the machine crashes), the logfilesremain on disk. By reexecuting the logfiles, <strong>Subversion</strong> can complete the previously startedoperation, and your working copy can get itself back into a consistent state.And this is exactly what svn cleanup does: it searches your working copy and runs anyleftover logs, removing working copy locks in the process. If <strong>Subversion</strong> ever tells you thatsome part of your working copy is “locked,” this is the command that you should run. Also,svn status will display an L next to locked items:$ svn statusL somedirM somedir/foo.c$ svn cleanup$ svn statusM somedir/foo.cDon't confuse these working copy locks <strong>with</strong> the ordinary locks that <strong>Subversion</strong> users createwhen using the lock-modify-unlock model of concurrent version control; see the sidebarThe Three Meanings of “Lock” for clarification.SummaryNow we've covered most of the <strong>Subversion</strong> client commands. Notable exceptions arethose dealing <strong>with</strong> branching and merging (see Chapter 4, Branching and Merging) andproperties (see the section called “Properties”). However, you may want to take a momentto skim through Chapter 9, <strong>Subversion</strong> Complete Reference to get an idea of all the differentcommands that <strong>Subversion</strong> has—and how you can use them to make your work easier.39

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

Saved successfully!

Ooh no, something went wrong!