Platinum Partner
architects,devops,tool,version control,tools & methods

Subversion’s SVN Annotate Command

Apache Subversion’s ‘svn annotate’ command allows users to view a line-by-line breakdown of all the changes that have been applied to a human-readable file in your working copy. This information is printed alongside details on:

  • The person responsible for each change
  • The revision number where each change occurred

Note that this line-by-line attribution is based on the file as it currently appears within the working copy.

To run ‘svn annotate’ on a file, enter:

svn annotate (working-copy-location)/file-being-examined

In this example, we’re examining all the changes for the ‘Changelog’ file, which is located inside the trunk of our working copy.

svn annotate

If you need a more comprehensive printout, the -verbose (-v) switch adds the full datestamp to each line.

svn annotate 2

The –force Switch

The ‘svn annotate’ command uses Multipurpose Internet Mail Extensions (MIME) types to automatically detect whether a file is human-readable. By default, ‘svn annotate’ will block any file that’s non human-readable. If you attempt to perform an ‘svn annotate’ on a file that Subversion judges not to be readable, you’ll get an error message.

svn annotate 3

If you want to go ahead regardless, you can add the –force switch. Of course, this may result in a screen full of strange symbols if the file truly is non human-readable!

svn annotate 4

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}