Add missing magic_encodings. Fix blame commit select, hide blank blame. Fix git repo hooks - redo branch parse to support non-ascii branches. Refs #190, #134

This commit is contained in:
Pavel Chipiga 2012-03-22 19:11:12 +02:00
parent f54ec81734
commit 4553affa56
41 changed files with 45 additions and 9 deletions

View File

@ -21,7 +21,7 @@ gem 'rails-xmlrpc', '~> 0.3.6' # :git => 'git://github.com/chipiga/rails-xmlrpc.
# gem 'rugged', '~> 0.16.0'
gem 'grack', :git => 'git://github.com/rdblue/grack.git', :require => 'git_http'
gem "grit", :git => 'git://github.com/chipiga/grit.git'
gem "grit", :git => 'git://github.com/chipiga/grit.git' #, :path => '~/Sites/code/grit'
gem 'charlock_holmes', '~> 0.6.8' #, :git => 'git://github.com/brianmario/charlock_holmes.git', :branch => 'bundle-icu'
# Wiki

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ActivityFeedsController < ApplicationController
before_filter :authenticate_user!

View File

@ -37,7 +37,7 @@ class Git::BlobsController < Git::BaseController
end
def blame
@blame = Grit::Blob.blame(@git_repository.repo, @commit.try(:id), @path)
@blame = Grit::Blob.blame(@git_repository.repo, @commit.id, @path)
end
def raw
@ -55,10 +55,10 @@ class Git::BlobsController < Git::BaseController
def set_path_blob
@path = params[:path]
@blob = @tree / @path
@commit = @git_repository.log(@treeish, @path, :max_count => 1).first
end
def find_tree
@tree = @git_repository.tree(@treeish)
@commit = @git_repository.log(@treeish, @path, :max_count => 1).first # TODO WTF nil ?
end
end

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module ActivityFeedsHelper
def render_activity_feed(activity_feed)
render :partial => activity_feed.partial, :locals => activity_feed.data.merge(:activity_feed => activity_feed)

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
module BuildListsHelper
def build_list_status_color(status)
if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? status

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ActivityFeed < ActiveRecord::Base
CODE = ['git_delete_branch_notification', 'git_new_push_notification', 'new_comment_commit_notification']

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class ActivityFeedObserver < ActiveRecord::Observer
observe :issue, :comment, :user, :build_list
@ -70,7 +71,7 @@ class ActivityFeedObserver < ActiveRecord::Observer
when 'GitHook'
change_type = record.change_type
branch_name = record.refname.match(/\/([\w\d]+)$/)[1]
branch_name = record.refname.split('/').last
last_commits = record.project.git_repository.repo.log(branch_name, nil).first(3)
first_commiter = User.find_by_email(last_commits[0].author.email) unless last_commits.blank?

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Label < ActiveRecord::Base
has_many :labelings, :dependent => :destroy
has_many :issues, :through => :labelings

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Labeling < ActiveRecord::Base
belongs_to :issue
belongs_to :label

View File

@ -22,4 +22,4 @@
- render_way = choose_render_way(@blob)
.file
.top= render 'top', :render_way => render_way
.blame_data= render 'blame_table'
.blame_data= render 'blame_table' if @blame.first.first.present?

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CreateActivityFeeds < ActiveRecord::Migration
def self.up
create_table :activity_feeds do |t|

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddCreatorToIssue < ActiveRecord::Migration
def change
add_column :issues, :creator_id, :integer

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class CreateLabels < ActiveRecord::Migration
def change
create_table :labels do |t|

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class RemoveRepositoriesOwner < ActiveRecord::Migration
def self.up
remove_column :repositories, :owner_id

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddClosedAtToIssue < ActiveRecord::Migration
def change
add_column :issues, :closed_at, :datetime

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddClosedByToIssue < ActiveRecord::Migration
def change
add_column :issues, :closed_by, :integer

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddDescriptionToGroups < ActiveRecord::Migration
def change
add_column :groups, :description, :text

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddDefaultValuesToIsRpmForProjects < ActiveRecord::Migration
def change
Project.update_all(:is_rpm => true)

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class RemoveNameFromGroups < ActiveRecord::Migration
def up
remove_column :groups, :name

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddProfessionalExperienceToUsers < ActiveRecord::Migration
def change
add_column :users, :professional_experience, :text

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddSiteCompanyAndLocationToUsers < ActiveRecord::Migration
def change
add_column :users, :site, :string

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddAvatarToUsers < ActiveRecord::Migration
def change
change_table :users do |t|

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddProjectToComment < ActiveRecord::Migration
def up
add_column :comments, :project_id, :integer

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class DeleteDublicateSubscribes < ActiveRecord::Migration
def up
execute <<-SQL

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class TruncateActivityFeed < ActiveRecord::Migration
def up
ActivityFeed.destroy_all

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddDescriptionToProducts < ActiveRecord::Migration
def self.up
add_column :products, :description, :text

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class RemoveIsTemplateFromProducts < ActiveRecord::Migration
def up
remove_column :products, :is_template

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddBuildListPriority < ActiveRecord::Migration
def self.up
add_column :build_lists, :priority, :integer, :null => false, :default => 0

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class AddDeviseLockable < ActiveRecord::Migration
def change
add_column :users, :failed_attempts, :integer, :default => 0 # Only if lock strategy is :failed_attempts

View File

@ -1,4 +1,4 @@
# encoding: UTF-8
# -*- encoding : utf-8 -*-
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
class Object
def with_skip
begin

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# # -*- encoding : utf-8 -*-
module Gollum
class Wiki

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# -*- ruby encoding: utf-8 -*-
module Grit

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe ActivityFeedsController do

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Read about factories at http://github.com/thoughtbot/factory_girl
FactoryGirl.define do

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
# Specs in this file have access to a helper object that includes

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
# Specs in this file have access to a helper object that includes

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe ActivityFeedObserver do

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe ActivityFeed do

View File

@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
require 'spec_helper'
describe Label do