SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 82 | Next

David J Murphy

"Managing Software Development with Trac and Subversion"

The symbols
before the filenames describe the prefix the output will use to indicate the file a
particular line belongs to. Lines that are same in both files have no prefix.
Using this basic understanding, we can determine that the line -print "Hello,
world!" is present only in the head copy of the file, meaning we have deleted it from
the working copy.
Version Control 101
[ 66 ]
Changing your mind
If you decide the changes made to the working copy are not good and
you want to go back to the previous version, you can achieve it with the
revert command: svn revert foo.py
Spotting lines that have been added or removed is easy, but what about lines that
have been changed?
$ svn diff foo.py
Index: foo.py
===================================================================
--- foo.py (revision 3)
+++ foo.py (working copy)
@@ -1,4 +1,4 @@
#! /usr/bin/python
-print "Hello, world!"
+print "Hello, World!"
name = raw_input('What is your name? ')
print 'Hello, %s' % name
In this case we are shown the same line from both the files; we can see the line that
was removed and the line that it was replaced with.
A whole new line?
diff deal with files on a line-by-line basis, so even if only one character
has been changed??”as above??”it considers that the whole line as
being changed.


Pages:
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94