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.

Advanced Topics$ svn info banana.jpgPath: banana.jpgName: banana.jpgURL: http://svn.example.com/repos/project/banana.jpgRepository UUID: edb2f264-5ef2-0310-a47a-87b0ce17a8ecRevision: 2198Node Kind: fileSchedule: normalLast Changed Author: frankLast Changed Rev: 1950Last Changed Date: 2006-03-15 12:43:04 -0600 (Wed, 15 Mar 2006)Text Last Updated: 2006-06-08 19:23:07 -0500 (Thu, 08 Jun 2006)Properties Last Updated: 2006-06-08 19:23:07 -0500 (Thu, 08 Jun 2006)Checksum: 3b110d3b10638f5d1f4fe0f436a5a2a5Lock Token: opaquelocktoken:0c0f600b-88f9-0310-9e48-355b44d4a58eLock Owner: harryLock Created: 2006-06-14 17:20:31 -0500 (Wed, 14 Jun 2006)Lock Comment (1 line):Editing file for tomorrow's release.$The fact that the svn info command, which does not contact the repository when runagainst working copy paths, can display the lock token reveals an important piece of informationabout those tokens: they are cached in the working copy. The presence of thelock token is critical. It gives the working copy authorization to make use of the lock lateron. Also, the svn status command shows a K next to the file (short for locKed), indicatingthat the lock token is present.Regarding Lock TokensA lock token isn't an authentication token, so much as an authorization token. Thetoken isn't a protected secret. In fact, a lock's unique token is discoverable by anyonewho runs svn info URL. A lock token is special only when it lives inside a workingcopy. It's proof that the lock was created in that particular working copy, and notsomewhere else by some other client. Merely authenticating as the lock owner isn'tenough to prevent accidents.For example, suppose you lock a file using a computer at your office, but leave workfor the day before you finish your changes to that file. It should not be possible to accidentallycommit changes to that same file from your home computer later that eveningsimply because you've authenticated as the lock's owner. In other words, the locktoken prevents one piece of <strong>Subversion</strong>-related software from undermining the workof another. (In our example, if you really need to change the file from an alternativeworking copy, you would need to break the lock and relock the file.)Now that Harry has locked banana.jpg, Sally is unable to change or delete that file:$ svn delete banana.jpgDbanana.jpg$ svn commit -m "Delete useless file."Deleting banana.jpgsvn: Commit failed (details follow):svn: Server sent unexpected return value (423 Locked) in response to DELETE\request for '/repos/project/!svn/wrk/64bad3a9-96f9-0310-818a-df4224ddc35d/\banana.jpg'$But Harry, after touching up the banana's shade of yellow, is able to commit his changes tothe file. That's because he authenticates as the lock owner and also because his working65

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

Saved successfully!

Ooh no, something went wrong!