The Artima Developer Community
Sponsored Link

Python Buzz Forum
Bazaar Project Templates

0 replies.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a flat view of this topic  Flat View
Previous Topic   Next Topic
Threaded View: This topic has 0 replies on 1 page
Ryan Tomayko

Posts: 408
Nickname: rtomayko
Registered: Nov, 2004

Ryan Tomayko is an instance of a human being...
Bazaar Project Templates Posted: Oct 2, 2007 8:55 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ryan Tomayko.
Original Post: Bazaar Project Templates
Feed Title: Ryan Tomayko (weblog/python)
Feed URL: http://tomayko.com/feed/
Feed Description: Entries classified under Python.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ryan Tomayko
Latest Posts From Ryan Tomayko (weblog/python)

Bill de hÓra:

It occurred to me that by setting up a local hg, I had in fact branched, but without the overhead and ceremony associated with branches. Driving the cost of branches to zero is transformational.

Indeed.

I've been experimenting with Bazaar for a little while and had a strange idea: why not use branches as a project template mechanism?

$ bzr branch http://tomayko.com/src/ruby-project devel/hello-bill
$ cd devel/hello-bill
$ cat <<. > lib/hello.rb
#!/usr/bin/env ruby
puts 'Hello, Bill'"
.
$ chmod +x bin/hello
$ bzr add && bzr commit -m "say hi to bill"
added bin/hello-bill
added lib/hello.rb
Committed revision 23.
$ cat < Rakefile
load 'misc/asciidoc.rake'
load 'misc/project.rake'
Project.new 'Hello, Bill' do |p|
  p.package_name = 'hello-bill'
  p.version = '3.14159'
  p.summary = 'Just saying hi'
  p.author = 'Ryan Tomayko '
  p.description = <<-end
    A program that writes "Hello, Bill" to STDOUT and exits.
    Just because.
  end
  p.project_url = "http://tomayko.com/src/#{p.package_name}"
  p.remote_dist_location = "tomayko.com:/dist/#{p.package_name}"
  p.remote_doc_location = "tomayko.com:/src/#{p.package_name}"
  p.remote_branch_location = "tomayko.com:/src/#{p.package_name}"
end
EOF
$ cat < doc/index.txt
= Hello, Bill {package-version}

The +hello-bill+ program writes "Hello, Bill" to STDOUT and exits.
EOF
$ bzr ci -m "update project info and docs"
$ rake doc package publish
asciidoc -d article -o ./index.html ./index.txt
asciidoc -d article -o ./license.html ./license.txt
source-highlight -s ruby --line-number-ref='' ... 
Processing 'lib/hello.rb' ... created doc/src/lib/hello.rb.html
Generating RDoc API Documentation.
tar zcvf hello-bill-3.14159.tar.gz hello-bill-3.14159 ...
zip -r hello-bill-3.14159.zip hello-bill-3.14159
rsync -aP ... rtomayko@tomayko.com:/dist/hello-bill
rsync -azP --delete --hard-links .bzr rtomayko@tomayko.com:/src/hello-bill
rsync -azP doc/ rtomayko@tomayko.com:/src/hello-bill
$ sudo gem install hello-bill --source=http://tomayko.com
$ hello-bill
Hello, Bill

Project documentation and bzr branch now here.

Cool, eh?

I've thought through the downside a bit and most of what I come up with is made irrelevant by cheap, distributed branches. For instance, if you want a different doc / test / package / distribution tool, fine: create a branch and make it do whatever you want; then, branch from there instead for your new projects.

I've only merged upstream changes from the template project into a downstream project once or twice but I'm expecting to run into silly and potentially annoying conflicts. So far it's been smooth sailing but we'll see.

Read: Bazaar Project Templates


Topic: Save your software project by telling better stories! Previous Topic   Next Topic Topic: Note to self: exc_info is only available after except handler

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use