svn log – where are the other changes?
Our CVS to Subversion conversion is complete. Now, we are in the process of settling into new working habits and learning the differences between CVS and svn. One of the questions last week was why do I not see the all of the changes when I run svn log
?
Luckily, I had anticipated this question. cvs log
will display all of the log messages for a file in both the trunk and all of the branches. svn log
will display the log messages for the current code path. You will not see changes in branches that are unrelated to the history of the file. There is a command line option, --stop-on-copy
, that will stop the log messages at the point where a branch was created. This change in behavior is a welcome change and most people find it intuitive.
Unfortunately, this was not the issue that inspired the question. The developer wanted to know why he did not see a change he knew had been checked in. cvs log
would show the change by default. What I discovered was that the developer had not done an update in his repository. By default, svn log
does not show revisions after the state of the current repository. This feels non-intuitive to me and was something I did not expect. You can get a full log (including changes made after the last update) by using the -r
option.
svn log -r 1:HEAD file |
Displays all log messages in file history from oldest to newest. | |
svn log -r HEAD:1 file |
Displays all log messages in file history from newest to oldest. | |
svn log -r BASE:HEAD file |
Displays log messages since last svn update from oldest to newest. |
|
svn log -r HEAD:BASE file |
Displays log messages since last svn update from newest to oldest. |