An Extremely Hackish bzr Web Interface

    Because I want to host my bzr repos on my site, I have setup http://bzr.snuxoll.com, the problem was I wanted people to be able to browse my code without needing to check it out. Since the only decent web interface (loggerhead) required an additional server running (something I can't do on shared hosting), it was out of the question. As such, I give you snuxbzrweb, a revolution in web interfaces for VCS systems!

#!/usr/bin/ruby
# An extremely hackish 'bzr repo browser'
# All it does is make sure the working tree is up to date
# and hope that apache serves the directory listing :P
 
repos = Dir["bzr.snuxoll.com/*/*"]
repos.map{ |x| File.expand_path(x) }.each do |dir|
  Dir.chdir(dir)
  if Dir["#{dir}/**"] != []
    system("bzr update")
  else
    system("bzr checkout")
  end
end

    Yes, you saw that right, all it does is iterate through my repositories, and either runs 'bzr update' or 'bzr checkout' based on whether they have a working tree already or not. Since I'm not worried about conflicts since I don't do merges on dreamhost, and instead push my branch to it, I don't care about checking anything else. While this isn't pretty, or very functional, at least apache will spit out a directory listing with the files in my branches now :)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

supplynflshop

thank you for sharing
http://www.supplynflshop.com discount nfl jeserys

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options