Still no 'svn annotate' support?

Subscribe to Still no 'svn annotate' support? 6 post(s), 2 voice(s)

 
Avatar Morgan Schweers 16 post(s)

Greetings,
I recall in the early days of Warehouse, there was talk of maybe getting ‘svn annotate’ support in 1.1, but it doesn’t look like it’s in the Warehouse implementations I’ve run into. (And if it is, it’s hard to find.)

It’s very valuable to know when (and by whom) a given line was modified, especially when you’re dealing with a larger number of developers, all of whom are encouraged to actively fix/refactor things as they come across them.

Even in one person projects, though, being able to click on a line of code and at least see the svn log message associated with the change that last affected that line would be a very helpful capability.

Is this something you’re expecting plugin developers to do? It seems like some tight integration would be necessary to do it right.

— Morgan

 
Avatar rick Administator 546 post(s)

We actually created the interface for it, but SVN doesn’t let you get annotation info from the actual repo. It only works from a working copy of the repo, which your server probably won’t have. It is possible that I may still add it, adding another task to the warehouse sync task. So, in addition to updating the database with the latest changeset info, it also updates the working copy that’s used for annotations.

 
Avatar Morgan Schweers 16 post(s)

Greetings,
That’s interesting, and unfortunate… It’s probably the Ruby SVN bindings that don’t let you, actually.

The command:

svn ann http: //ar-code.svn.engineyard.com/lighthouse-api/lib/lighthouse.rb

works pretty well, and there’s a—xml parameter which could help extract the info you’d need. (Note the space after http:, because I can’t figure out how to make it not auto link the URL, and just leave it in text form.)

It’d be better if you can rely on subversion, but you may (understandably) not want to fix the Ruby/Subversion bindings.

— Morgan

 
Avatar Morgan Schweers 16 post(s)

Greetings,
I’m probably misunderstanding you, though… For example:

require 'svn/client'

c = Svn::Client::Context.new
c.blame("http://ar-code.svn.engineyard.com/lighthouse-api/lib/lighthouse.rb") do |lineno, rev, username, changed_at, line|
   printf "%3d (%10s): %s\n", rev, username, line
end

Is that not what you mean?

For local repositories, I think you can also put file:///usr/svn/{svn path} in place of the http:// style URL, where /usr/svn is the path to the local svn repo and {svn path} is the actual project, trunk/branch/tags/whatever path… e.g. file:///usr/svn/lighthouse-api/lib/lighthouse.rb

— Morgan

 
Avatar rick Administator 546 post(s)

Oh really? Hmm, I’ll have to give that another shot. I’d personally love to get this in there. Thanks for the help.

 
Avatar rick Administator 546 post(s)

So, not only does this work, it seems to be fast too (since it’s being called from the actual repo and not a working copy). We’re just figuring out how to do all this efficiently, provide fallbacks for those not using Ultraviolet. We should have a release out very soon.