Chapter 6
[ 65 ]
What's the Difference?
Apart from allowing us to travel through time for any file under its control,
Subversion can also tell us exactly what changed between versions or the changes
we made to our working copy. If we make some changes to our one-and-only project
file, but don't check them in, we can look at how this works.
First we can see what has changed in our working copy compared to the latest
version (known as 'head').
1. Type svn status and press Enter.
$ svn status
M foo.py
From the previous table above we can tell that foo.py has been modified. We can see
what changes have been made to that file with the diff command.
2. Type svn diff foo.py and press Enter.
$ svn diff foo.py
Index: foo.py
===================================================================
--- foo.py (revision 3)
+++ foo.py (working copy)
@@ -1,4 +1,3 @@
#! /usr/bin/python
-print "Hello, world!"
name = raw_input('What is your name? ')
print 'Hello, %s' % name
Subversion defaults to displaying its differences using the unified diff format,
which is understood by a wide variety of tools. We can also understand it with a
little practice. The two lines after the header tell us about the files that are being
compared, in this case the head and work copy versions of the file.
Pages:
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93