Permalink
Browse files

This changes every reference of gitosis to gitolite.

Probably kills heaps of stuff, but we'll get around to fixing that soon enough.
  • Loading branch information...
jhogendorn committed Jan 6, 2011
1 parent 501ba6a commit d4257c97add288a6121dd37a6a6f320286e4c567
Showing with 215 additions and 215 deletions.
  1. +1 −1 .project
  2. +2 −2 README.rdoc
  3. +16 −16 app/controllers/{gitosis_public_keys_controller.rb → gitolite_public_keys_controller.rb}
  4. +9 −0 app/helpers/gitolite_public_keys_helper.rb
  5. +0 −9 app/helpers/gitosis_public_keys_helper.rb
  6. +34 −0 app/models/gitolite_observer.rb
  7. +3 −3 app/models/{gitosis_public_key.rb → gitolite_public_key.rb}
  8. +0 −34 app/models/gitosis_observer.rb
  9. +2 −2 app/views/{gitosis_public_keys → gitolite_public_keys}/_form.html.erb
  10. +3 −3 app/views/{gitosis_public_keys → gitolite_public_keys}/edit.html.erb
  11. +4 −4 app/views/{gitosis_public_keys → gitolite_public_keys}/index.html.erb
  12. +2 −2 app/views/{gitosis_public_keys → gitolite_public_keys}/new.html.erb
  13. +12 −0 app/views/projects/_redmine_gitolite.rhtml
  14. +0 −12 app/views/projects/_redmine_gitosis.rhtml
  15. +2 −2 app/views/repositories/git_instructions.html.erb
  16. +4 −4 app/views/settings/{_redmine_gitosis.rhtml → _redmine_gitolite.rhtml}
  17. +2 −2 config/locales/bg.yml
  18. +2 −2 config/locales/bs.yml
  19. +2 −2 config/locales/ca.yml
  20. +2 −2 config/locales/cs.yml
  21. +2 −2 config/locales/da.yml
  22. +2 −2 config/locales/de.yml
  23. +2 −2 config/locales/el.yml
  24. +2 −2 config/locales/en.yml
  25. +2 −2 config/locales/es.yml
  26. +2 −2 config/locales/fi.yml
  27. +2 −2 config/locales/fr.yml
  28. +2 −2 config/locales/gl.yml
  29. +2 −2 config/locales/he.yml
  30. +2 −2 config/locales/hu.yml
  31. +2 −2 config/locales/id.yml
  32. +2 −2 config/locales/it.yml
  33. +2 −2 config/locales/ja.yml
  34. +2 −2 config/locales/ko.yml
  35. +2 −2 config/locales/lt.yml
  36. +2 −2 config/locales/nl.yml
  37. +2 −2 config/locales/no.yml
  38. +2 −2 config/locales/pl.yml
  39. +2 −2 config/locales/pt-BR.yml
  40. +2 −2 config/locales/pt.yml
  41. +2 −2 config/locales/ro.yml
  42. +2 −2 config/locales/ru.yml
  43. +2 −2 config/locales/sk.yml
  44. +2 −2 config/locales/sl.yml
  45. +2 −2 config/locales/sr.yml
  46. +2 −2 config/locales/sv.yml
  47. +2 −2 config/locales/th.yml
  48. +2 −2 config/locales/tr.yml
  49. +2 −2 config/locales/uk.yml
  50. +2 −2 config/locales/vi.yml
  51. +2 −2 config/locales/zh-TW.yml
  52. +2 −2 config/locales/zh.yml
  53. +2 −2 config/routes.rb
  54. +3 −3 ...te/{20091119162427_create_gitosis_public_keys.rb → 20091119162427_create_gitolite_public_keys.rb}
  55. +1 −1 extra/ssh/README.txt
  56. +15 −15 init.rb
  57. +14 −14 lib/{gitosis.rb → gitolite.rb}
  58. +2 −2 lib/{gitosis → gitolite}/patches/git_adapter_patch.rb
  59. +4 −4 lib/{gitosis → gitolite}/patches/repositories_controller_patch.rb
  60. +2 −2 lib/{gitosis → gitolite}/patches/repositories_helper_patch.rb
  61. +4 −4 tasks/{gitosis.rake → gitolite.rake}
  62. 0 test/fixtures/{gitosis_public_keys.yml → gitolite_public_keys.yml}
  63. +2 −2 test/unit/{gitosis_public_key_test.rb → gitolite_public_key_test.rb}
View
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>redmine-gitosis</name>
+ <name>redmine-gitolite</name>
<comment></comment>
<projects>
</projects>
View
@@ -1,6 +1,6 @@
-= Redmine Gitosis
+= Redmine Gitolite
-A Redmine plugin which manages your gitosis configuration based on your projects and memberships in Redmine. Includes Public Key management views (extracted from http://plan.io).
+A Redmine plugin which manages your gitolite configuration based on your projects and memberships in Redmine. Includes Public Key management views (extracted from http://plan.io).
This plugin was originally developed by Jan Schulz-Hofen for http://plan.io. Several updates/fixes were provided by github users untoldwind, tingar and ericpaulbishop. These updates were merged together and expanded upon by Eric Bishop.
@@ -1,48 +1,48 @@
-class GitosisPublicKeysController < ApplicationController
+class GitolitePublicKeysController < ApplicationController
unloadable
before_filter :require_login
before_filter :set_user_variable
- before_filter :find_gitosis_public_key, :except => [:index, :new, :create]
+ before_filter :find_gitolite_public_key, :except => [:index, :new, :create]
def index
- @status = if (session[:gitosis_public_key_filter_status]=params[:status]).nil?
- GitosisPublicKey::STATUS_ACTIVE
+ @status = if (session[:gitolite_public_key_filter_status]=params[:status]).nil?
+ GitolitePublicKey::STATUS_ACTIVE
elsif params[:status].blank?
nil
else
params[:status].to_i != 0
end
c = ARCondition.new(@status ? ["active=?", @status] : nil)
- @gitosis_public_keys = @user.gitosis_public_keys.all(:order => 'active DESC, created_at DESC', :conditions => c.conditions)
+ @gitolite_public_keys = @user.gitolite_public_keys.all(:order => 'active DESC, created_at DESC', :conditions => c.conditions)
respond_to do |format|
format.html # index.html.erb
- format.json { render :json => @gitosis_public_keys }
+ format.json { render :json => @gitolite_public_keys }
end
end
def edit
end
def update
- if @gitosis_public_key.update_attributes(params[:public_key])
+ if @gitolite_public_key.update_attributes(params[:public_key])
flash[:notice] = l(:notice_public_key_updated)
- redirect_to url_for(:action => 'index', :status => session[:gitosis_public_key_filter_status])
+ redirect_to url_for(:action => 'index', :status => session[:gitolite_public_key_filter_status])
else
render :action => 'edit'
end
end
def new
- @gitosis_public_key = GitosisPublicKey.new(:user => @user)
+ @gitolite_public_key = GitolitePublicKey.new(:user => @user)
end
def create
- @gitosis_public_key = GitosisPublicKey.new(params[:public_key].merge(:user => @user))
- if @gitosis_public_key.save
+ @gitolite_public_key = GitolitePublicKey.new(params[:public_key].merge(:user => @user))
+ if @gitolite_public_key.save
flash[:notice] = l(:notice_public_key_added)
- redirect_to url_for(:action => 'index', :status => session[:gitosis_public_key_filter_status])
+ redirect_to url_for(:action => 'index', :status => session[:gitolite_public_key_filter_status])
else
render :action => 'new'
end
@@ -51,7 +51,7 @@ def create
def show
respond_to do |format|
format.html # show.html.erb
- format.json { render :json => @gitosis_public_key }
+ format.json { render :json => @gitolite_public_key }
end
end
@@ -61,10 +61,10 @@ def set_user_variable
@user = User.current
end
- def find_gitosis_public_key
- key = GitosisPublicKey.find_by_id(params[:id])
+ def find_gitolite_public_key
+ key = GitolitePublicKey.find_by_id(params[:id])
if key and key.user == @user
- @gitosis_public_key = key
+ @gitolite_public_key = key
elsif key
render_403
else
@@ -0,0 +1,9 @@
+module GitolitePublicKeysHelper
+ def gitolite_public_keys_status_options_for_select(user, selected)
+ key_count_by_active = user.gitolite_public_keys.count(:group => 'active').to_hash
+ options_for_select([[l(:label_all), nil],
+ ["#{l(:status_active)} (#{key_count_by_active[true].to_i})", GitolitePublicKey::STATUS_ACTIVE],
+ ["#{l(:status_locked)} (#{key_count_by_active[false].to_i})", GitolitePublicKey::STATUS_LOCKED]], selected)
+ end
+
+end
@@ -1,9 +0,0 @@
-module GitosisPublicKeysHelper
- def gitosis_public_keys_status_options_for_select(user, selected)
- key_count_by_active = user.gitosis_public_keys.count(:group => 'active').to_hash
- options_for_select([[l(:label_all), nil],
- ["#{l(:status_active)} (#{key_count_by_active[true].to_i})", GitosisPublicKey::STATUS_ACTIVE],
- ["#{l(:status_locked)} (#{key_count_by_active[false].to_i})", GitosisPublicKey::STATUS_LOCKED]], selected)
- end
-
-end
@@ -0,0 +1,34 @@
+class GitoliteObserver < ActiveRecord::Observer
+ observe :project, :user, :gitolite_public_key, :member, :role, :repository
+
+
+# def before_create(object)
+# if object.is_a?(Project)
+# repo = Repository::Git.new
+# repo.url = repo.root_url = File.join(Gitolite::GITOSIS_BASE_PATH,"#{object.identifier}.git")
+# object.repository = repo
+# end
+# end
+
+ def after_save(object) ; update_repositories(object) ; end
+ def after_destroy(object) ; update_repositories(object) ; end
+
+ protected
+
+ def update_repositories(object)
+ case object
+ when Repository then Gitolite::update_repositories(object.project)
+ when User then Gitolite::update_repositories(object.projects) unless is_login_save?(object)
+ when GitolitePublicKey then Gitolite::update_repositories(object.user.projects)
+ when Member then Gitolite::update_repositories(object.project)
+ when Role then Gitolite::update_repositories(object.members.map(&:project).uniq.compact)
+ end
+ end
+
+ private
+
+ # Test for the fingerprint of changes to the user model when the User actually logs in.
+ def is_login_save?(user)
+ user.changed? && user.changed.length == 2 && user.changed.include?("updated_on") && user.changed.include?("last_login_on")
+ end
+end
@@ -1,4 +1,4 @@
-class GitosisPublicKey < ActiveRecord::Base
+class GitolitePublicKey < ActiveRecord::Base
STATUS_ACTIVE = true
STATUS_LOCKED = false
@@ -7,8 +7,8 @@ class GitosisPublicKey < ActiveRecord::Base
validates_uniqueness_of :identifier, :score => :user_id
validates_presence_of :title, :key, :identifier
- named_scope :active, {:conditions => {:active => GitosisPublicKey::STATUS_ACTIVE}}
- named_scope :inactive, {:conditions => {:active => GitosisPublicKey::STATUS_LOCKED}}
+ named_scope :active, {:conditions => {:active => GitolitePublicKey::STATUS_ACTIVE}}
+ named_scope :inactive, {:conditions => {:active => GitolitePublicKey::STATUS_LOCKED}}
validate :has_not_been_changed
@@ -1,34 +0,0 @@
-class GitosisObserver < ActiveRecord::Observer
- observe :project, :user, :gitosis_public_key, :member, :role, :repository
-
-
-# def before_create(object)
-# if object.is_a?(Project)
-# repo = Repository::Git.new
-# repo.url = repo.root_url = File.join(Gitosis::GITOSIS_BASE_PATH,"#{object.identifier}.git")
-# object.repository = repo
-# end
-# end
-
- def after_save(object) ; update_repositories(object) ; end
- def after_destroy(object) ; update_repositories(object) ; end
-
- protected
-
- def update_repositories(object)
- case object
- when Repository then Gitosis::update_repositories(object.project)
- when User then Gitosis::update_repositories(object.projects) unless is_login_save?(object)
- when GitosisPublicKey then Gitosis::update_repositories(object.user.projects)
- when Member then Gitosis::update_repositories(object.project)
- when Role then Gitosis::update_repositories(object.members.map(&:project).uniq.compact)
- end
- end
-
- private
-
- # Test for the fingerprint of changes to the user model when the User actually logs in.
- def is_login_save?(user)
- user.changed? && user.changed.length == 2 && user.changed.include?("updated_on") && user.changed.include?("last_login_on")
- end
-end
@@ -1,7 +1,7 @@
<div class="box tabular">
<p><%= f.text_field :title, :required => true %></p>
- <p><%= f.text_area :key, :required => true, :disabled => !@gitosis_public_key.new_record?, :style => 'width:99%;height:140px;', :label => :field_public_key %>
- <% if !@gitosis_public_key.new_record?%>
+ <p><%= f.text_area :key, :required => true, :disabled => !@gitolite_public_key.new_record?, :style => 'width:99%;height:140px;', :label => :field_public_key %>
+ <% if !@gitolite_public_key.new_record?%>
<br/><em><%= l(:label_key_cannot_be_changed_please_create_new_key) %></em>
<% end %>
</p>
@@ -1,8 +1,8 @@
-<h2><%= link_to l(:label_public_keys), public_keys_path %> &#187; <%= h @gitosis_public_key %></h2>
+<h2><%= link_to l(:label_public_keys), public_keys_path %> &#187; <%= h @gitolite_public_key %></h2>
-<%= error_messages_for :gitosis_public_key %>
+<%= error_messages_for :gitolite_public_key %>
-<% form_for :public_key, @gitosis_public_key, :url => { :action => "update" }, :html => { :method => :put},
+<% form_for :public_key, @gitolite_public_key, :url => { :action => "update" }, :html => { :method => :put},
:builder => TabularFormBuilder,
:lang => current_language do |f| %>
@@ -3,14 +3,14 @@
<% form_tag({}, :method => :get) do %>
<fieldset><legend><%= l(:label_filter_plural) %></legend>
<label><%= l(:field_status) %>:</label>
-<%= select_tag 'status', gitosis_public_keys_status_options_for_select(@user, @status), :class => "small", :onchange => "this.form.submit(); return false;" %>
+<%= select_tag 'status', gitolite_public_keys_status_options_for_select(@user, @status), :class => "small", :onchange => "this.form.submit(); return false;" %>
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
</fieldset>
<% end %>
&nbsp;
-<% if @gitosis_public_keys.any? %>
+<% if @gitolite_public_keys.any? %>
<table class="list">
<tr>
@@ -19,13 +19,13 @@
<th style="width:15%;"><%= l(:field_active) %></th>
<th align="center" style="width:10%;"> </th>
</tr>
- <% @gitosis_public_keys.each do |key| %>
+ <% @gitolite_public_keys.each do |key| %>
<tr class="<%= cycle('odd', 'even') %>">
<td><%= link_to h(key), :action => 'edit', :id => key %></td>
<td><%= format_time(key.created_at) %></td>
<td class="center" style="width:15%;"><%= image_tag('true.png') if key.active? %></td>
<td class="buttons">
- <%= link_to l(key.active? ? :button_lock : :button_unlock), public_key_path(key, :public_key => {:active => key.active? ? GitosisPublicKey::STATUS_LOCKED : GitosisPublicKey::STATUS_ACTIVE}), :method => :put, :class => "icon #{key.active? ? 'icon-lock' : 'icon-unlock'}" %>
+ <%= link_to l(key.active? ? :button_lock : :button_unlock), public_key_path(key, :public_key => {:active => key.active? ? GitolitePublicKey::STATUS_LOCKED : GitolitePublicKey::STATUS_ACTIVE}), :method => :put, :class => "icon #{key.active? ? 'icon-lock' : 'icon-unlock'}" %>
</td>
</tr>
<% end %>
@@ -1,8 +1,8 @@
<h2><%= link_to l(:label_public_keys), public_keys_path %> &#187; <%=l(:label_public_key_new)%></h2>
-<%= error_messages_for :gitosis_public_key %>
+<%= error_messages_for :gitolite_public_key %>
-<% form_for :public_key, @gitosis_public_key, :url => { :action => "create" },
+<% form_for :public_key, @gitolite_public_key, :url => { :action => "create" },
:builder => TabularFormBuilder,
:lang => current_language do |f| %>
@@ -0,0 +1,12 @@
+<% if @project.repository && @project.repository.is_a?(Repository::Git) %>
+<div class="box">
+ <h3>Git Repository</h3>
+ <p>
+ <%= Gitolite::renderReadOnlyUrls(Setting.plugin_redmine_gitolite['readOnlyBaseUrls'], @project.identifier, @project.parent.identifier || false) %>
+ </p>
+ <p>
+ <%= Gitolite::renderUrls(Setting.plugin_redmine_gitolite['developerBaseUrls'], @project.identifier, false,@project.parent.identifier || false) %>
+
+ </p>
+</div>
+<% end %>
@@ -1,12 +0,0 @@
-<% if @project.repository && @project.repository.is_a?(Repository::Git) %>
-<div class="box">
- <h3>Git Repository</h3>
- <p>
- <%= Gitosis::renderReadOnlyUrls(Setting.plugin_redmine_gitosis['readOnlyBaseUrls'], @project.identifier, @project.parent.identifier || false) %>
- </p>
- <p>
- <%= Gitosis::renderUrls(Setting.plugin_redmine_gitosis['developerBaseUrls'], @project.identifier, false,@project.parent.identifier || false) %>
-
- </p>
-</div>
-<% end %>
@@ -18,13 +18,13 @@
git init
git add .
git commit -m 'Initializing <%= @project %> repository'
- git remote add origin <%= Setting.plugin_redmine_gitosis['developerBaseUrls'] + @project.identifier + '.git' %>
+ git remote add origin <%= Setting.plugin_redmine_gitolite['developerBaseUrls'] + @project.identifier + '.git' %>
git push origin master
</pre>
<h2>Existing Git Repo?</h2>
<pre> cd existing_git_repo
- git remote add origin <%= Setting.plugin_redmine_gitosis['developerBaseUrls'] + @project.identifier + '.git' %>
+ git remote add origin <%= Setting.plugin_redmine_gitolite['developerBaseUrls'] + @project.identifier + '.git' %>
git push origin master
</pre>
@@ -1,12 +1,12 @@
<div class="tabular settings">
<p>
- <label><%= l(:label_gitosis_url)%></label>
- <%= text_field_tag("settings[gitosisUrl]", @settings['gitosisUrl'], :size => 60) %>
+ <label><%= l(:label_gitolite_url)%></label>
+ <%= text_field_tag("settings[gitoliteUrl]", @settings['gitoliteUrl'], :size => 60) %>
<br />
</p>
<p>
- <label><%= l(:label_gitosis_identity_file)%></label>
- <%= text_field_tag("settings[gitosisIdentityFile]", @settings['gitosisIdentityFile'], :size => 60) %>
+ <label><%= l(:label_gitolite_identity_file)%></label>
+ <%= text_field_tag("settings[gitoliteIdentityFile]", @settings['gitoliteIdentityFile'], :size => 60) %>
<br />
</p>
<p>
View
@@ -1,8 +1,8 @@
'bg':
label_public_keys: Public keys
label_public_key_new: New public key
- label_gitosis_url: Gitosis URL
- label_gitosis_identity_file: Gitosis identity file
+ label_gitolite_url: Gitolite URL
+ label_gitolite_identity_file: Gitolite identity file
label_base_path: Base path
label_developer_base_urls: Developer base URL(s)
label_read_only_base_urls: Read-only base URL(s)
View
@@ -1,8 +1,8 @@
'bs':
label_public_keys: Public keys
label_public_key_new: New public key
- label_gitosis_url: Gitosis URL
- label_gitosis_identity_file: Gitosis identity file
+ label_gitolite_url: Gitolite URL
+ label_gitolite_identity_file: Gitolite identity file
label_base_path: Base path
label_developer_base_urls: Developer base URL(s)
label_read_only_base_urls: Read-only base URL(s)
View
@@ -1,8 +1,8 @@
'ca':
label_public_keys: Public keys
label_public_key_new: New public key
- label_gitosis_url: Gitosis URL
- label_gitosis_identity_file: Gitosis identity file
+ label_gitolite_url: Gitolite URL
+ label_gitolite_identity_file: Gitolite identity file
label_base_path: Base path
label_developer_base_urls: Developer base URL(s)
label_read_only_base_urls: Read-only base URL(s)
View
@@ -1,8 +1,8 @@
'cs':
label_public_keys: Public keys
label_public_key_new: New public key
- label_gitosis_url: Gitosis URL
- label_gitosis_identity_file: Gitosis identity file
+ label_gitolite_url: Gitolite URL
+ label_gitolite_identity_file: Gitolite identity file
label_base_path: Base path
label_developer_base_urls: Developer base URL(s)
label_read_only_base_urls: Read-only base URL(s)
View
@@ -1,8 +1,8 @@
'da':
label_public_keys: Public keys
label_public_key_new: New public key
- label_gitosis_url: Gitosis URL
- label_gitosis_identity_file: Gitosis identity file
+ label_gitolite_url: Gitolite URL
+ label_gitolite_identity_file: Gitolite identity file
label_base_path: Base path
label_developer_base_urls: Developer base URL(s)
label_read_only_base_urls: Read-only base URL(s)
Oops, something went wrong.

0 comments on commit d4257c9

Please sign in to comment.