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 UsageShow the list of all possible commands you can use in interactive conflict resolution.We'll cover these commands in more detail now, grouping them together by related functionality.Viewing conflict differences interactivelyBefore deciding how to attack a conflict interactively, odds are that you'd like to see exactlywhat is in conflict, and the diff command (d) is what you'll use for this:…Select: (p) postpone, (df) diff-full, (e) edit,(h)elp for more options : df--- .svn/text-base/sandwich.txt.svn-base Tue Dec 11 21:33:57 2007+++ .svn/tmp/tempfile.32.tmp Tue Dec 11 21:34:33 2007@@ -1 +1,5 @@-Just buy a sandwich.+> .r32…The first line of the diff content shows the previous contents of the working copy (the BASErevision), the next content line is your change, and the last content line is the change thatwas just received from the server (usually the HEAD revision). With this information in hand,you're ready to move on to the next action.Resolving conflict differences interactivelyThere are four different ways to resolve conflicts interactively—two of which allow you toselectively merge and edit changes, and two of which allow you to simply pick a version ofthe file and move along.If you wish to choose some combination of your local changes, you can use the “edit” command(e) to manually edit the file <strong>with</strong> conflict markers in a text editor (determined by theEDITOR environment variable). Editing the file by hand in your favorite text editor is asomewhat low-tech way of remedying conflicts (see the section called “Merging conflicts byhand” for a walkthrough), so some people like to use fancy graphical merge tools instead.To use a merge tool, you need to either set the SVN_MERGE environment variable or definethe merge-tool-cmd option in your <strong>Subversion</strong> configuration file (see the section called“Configuration Options” for more details). <strong>Subversion</strong> will pass four arguments to themerge tool: the BASE revision of the file, the revision of the file received from the server aspart of the update, the copy of the file containing your local edits, and the merged copy ofthe file (which contains conflict markers). If your merge tool is expecting arguments in a differentorder or format, you'll need to write a wrapper script for <strong>Subversion</strong> to invoke. Afteryou've edited the file, if you're satisfied <strong>with</strong> the changes you've made, you can tell <strong>Subversion</strong>that the edited file is no longer in conflict by using the “resolve” command (r).If you decide that you don't need to merge any changes, but just want to accept one versionof the file or the other, you can either choose your changes (a.k.a. “mine”) by usingthe “mine-full” command (mf) or choose theirs by using the “theirs-full” command (tf).Postponing conflict resolutionThis may sound like an appropriate section for avoiding marital disagreements, but it's actuallystill about <strong>Subversion</strong>, so read on. If you're doing an update and encounter a conflictthat you're not prepared to review or resolve, you can type p to postpone resolving a con-28

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

Saved successfully!

Ooh no, something went wrong!