Skip to content

Commit

Permalink
Mirroring hg changes. License notifications everywhere. Server code i…
Browse files Browse the repository at this point in the history
…s working foreals. Making 'stats' an official extension. Tightening up code everywhere I can.
  • Loading branch information
Michael Edgar committed May 5, 2010
1 parent 5aab78f commit cd3a6a8
Show file tree
Hide file tree
Showing 186 changed files with 3,395 additions and 378 deletions.
32 changes: 30 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
Amp is in a bit of limbo as it directs where its license will go. We want the code to fall under
the Ruby license. However, we didn't think about that before we looked at the Mercurial source code.
Mercurial (as noted below) is GPLv2+, and thus any code we derived from its codebase is also GPLv2. Any
code which then interacts with, links against, calls, etc. that derived code is also considered GPLv2.

So: each file is marked with a *standalone license*. If that code were to be extracted and treated as
one unit, it would be under the license it is marked under. Almost all files will be marked as the
Ruby license, but some quite substantial portions will be marked as a derived work and is thus GPLv2.

Our goal is to find developers to clean-room those GPLv2 parts and re-license them as the Ruby license.
Until then, Amp as a project and distributed as one unit is licensed GPLv2.

This project includes a large amount of source code from a number of different resources.
They are listed, in no particular order, along with the license ascribed to the code
associated with it.

1. Mercurial (GPLv2)
A large number of algorithms in Amp are inspired by, or in some cases, direct translations,
of code in the Mercurial source. This makes this our code a derivative work, and thus GPLv2.
of code in the Mercurial source. This makes this that code a derivative work, and thus GPLv2.
2. BZ2 (Ruby License) - Guy Decoux
This code has been copied verbatim into our repository.

Expand Down Expand Up @@ -37,4 +49,20 @@ associated with it.
5. Minitar - Copyright 2004 Mauricio Julio Fernández Pradier and Austin Ziegler
This code has been copied verbatim into our repository.

"This program is free software. It may be redistributed and/or modified under the terms of the GPL version 2 (or later) or Ruby’s licence. " -- http://raa.ruby-lang.org/project/minitar/
"This program is free software. It may be redistributed and/or modified under the terms of the GPL version 2 (or later) or Ruby’s licence. " -- http://raa.ruby-lang.org/project/minitar/

6. Difflib - this library from Python's standard library has been directly ported to Ruby.
It falls under the PSF license, which allows redistribution under a license of our choice. We
choose to redistribute it under the Ruby License.

7. HighLine - this library provides some cross-platform terminal methods. The license is included below.

"= License Terms

Distributed under the user's choice of the {GPL Version 2}[http://www.gnu.org/licenses/old-licenses/gpl-2.0.html] (see COPYING for details) or the
{Ruby software license}[http://www.ruby-lang.org/en/LICENSE.txt] by
James Edward Gray II and Greg Brown.

Please email James[mailto:james@grayproductions.net] with any questions."

We choose to use HighLine's code under the Ruby License.
28 changes: 13 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# -*- ruby -*-
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

require 'rake'
require 'rake/tasklib'
Expand Down Expand Up @@ -85,21 +98,6 @@ task :prepare do
`tar -C test/localrepo_tests/ -xzf test/localrepo_tests/testrepo.tar.gz`
end

# liberally modified from Hoe's
# desc 'Test the amp AWESOMENESS.'
# task :test do
# framework = "test/unit"
# test_globs = ['test/**/test_*.rb']
# ruby_flags = ENV['RUBY_FLAGS'] || "-w -I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}" +
# (ENV['RUBY_DEBUG'] ? " #{ENV['RUBY_DEBUG']}" : '')
# tests = [ framework] +
# test_globs.map { |g| Dir.glob(g) }.flatten
# tests.map! {|f| %(require "#{f}")}
# cmd = "#{ruby_flags} -e '$amp_testing = true; #{tests.join("; ")}' "
#
# ruby cmd
# end

desc "Compile Site"
task :"build-website" do
require 'site/src/helpers.rb'
Expand Down
18 changes: 1 addition & 17 deletions ampfile.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'amp/extensions/stats'
# need { 'lib/amp/extensions/ditz' }
# need { 'lib/amp/extensions/lighthouse' }

Expand All @@ -20,23 +21,6 @@
<%= change_node.hexlify %> <%= revision %>
EOF

command "stats" do |c|
c.workflow :hg
c.desc "Prints how many commits each user has contributed"
c.on_run do |opts, args|
repo = opts[:repository]
users = Hash.new {|h, k| h[k] = 0}
repo.each do |changeset|
users[changeset.user.split("@").first] += 1 #
end
users.to_a.sort {|a,b| b[1] <=> a[1]}.each do |u,c|
puts "#{u}: #{c}"
end
end
end

# bisect_command

namespace :docs do

command "gen" do |c|
Expand Down
16 changes: 16 additions & 0 deletions lib/amp.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

module Amp; end
# The root directory of this application
Amp::CODE_ROOT = File.expand_path File.dirname(__FILE__)
Expand Down Expand Up @@ -36,6 +50,7 @@ module Amp
autoload :Match, "amp/support/match.rb"
autoload :AmpConfig, "amp/support/amp_config.rb"
autoload :UI, "amp/support/amp_ui.rb"
autoload :Statistics, "amp/support/statistics.rb"

module Git
autoload :Changeset, "amp/repository/git/repo_format/changeset.rb"
Expand Down Expand Up @@ -196,6 +211,7 @@ module Sinatra
require "amp/dependencies/amp_support.rb"
require "amp/support/ruby_19_compatibility.rb"
require "amp/support/support.rb"
require "amp/dependencies/highline_extensions.rb"
require "amp/templates/template.rb"
require "amp/repository/mercurial/repository.rb" # we're just loading in
require 'amp/repository/git/repository.rb' # all of the base repositories
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/command.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

require 'amp/commands/command_support.rb'

module Amp
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/command_support.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

module Amp

module CommandSupport
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :config do |c|
c.workflow :all
c.desc "Configure amp interactively."
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/help.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :help do |c|
c.workflow :all
c.desc "Prints the help for the program."
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/init.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :init do |c|
c.workflow :all

Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/templates.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

# Create an anonymous module so that the extra methods in the templates aren't
# entered into the global namespace
#
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :version do |c|
c.workflow :all

Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/workflow.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :workflow do |c|
c.workflow :all
c.maybe_repo
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/workflows/git/add.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :add do |c|
c.workflow :git
c.desc "Add a file to the repository (it will be tracked from here on)"
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/workflows/git/copy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :copy do |c|
c.workflow :git
c.desc "Copies a file from one location to another, while maintaining history"
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/workflows/git/mv.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :mv do |c|
c.workflow :git
c.desc "Moves a file from one place to another"
Expand Down
14 changes: 14 additions & 0 deletions lib/amp/commands/commands/workflows/git/rm.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##################################################################
# Licensing Information #
# #
# The following code is licensed, as standalone code, under #
# the Ruby License, unless otherwise directed within the code. #
# #
# For information on the license of this code when distributed #
# with and used in conjunction with the other modules in the #
# Amp project, please see the root-level LICENSE file. #
# #
# © Michael J. Edgar and Ari Brown, 2009-2010 #
# #
##################################################################

command :rm do |c|
c.workflow :git
c.desc "Removes files from the repository on next commit"
Expand Down
Loading

0 comments on commit cd3a6a8

Please sign in to comment.