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:
parent
f54ec81734
commit
4553affa56
2
Gemfile
2
Gemfile
|
@ -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
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class ActivityFeedsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
|
|
|
@ -67,4 +67,4 @@ class Admin::UsersController < ApplicationController
|
|||
|
||||
render :partial =>'users_ajax', :layout => false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
module BuildListsHelper
|
||||
def build_list_status_color(status)
|
||||
if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? status
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class ActivityFeed < ActiveRecord::Base
|
||||
|
||||
CODE = ['git_delete_branch_notification', 'git_new_push_notification', 'new_comment_commit_notification']
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class Label < ActiveRecord::Base
|
||||
has_many :labelings, :dependent => :destroy
|
||||
has_many :issues, :through => :labelings
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class Labeling < ActiveRecord::Base
|
||||
belongs_to :issue
|
||||
belongs_to :label
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class CreateActivityFeeds < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :activity_feeds do |t|
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddCreatorToIssue < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :issues, :creator_id, :integer
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class CreateLabels < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :labels do |t|
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class RemoveRepositoriesOwner < ActiveRecord::Migration
|
||||
def self.up
|
||||
remove_column :repositories, :owner_id
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddClosedAtToIssue < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :issues, :closed_at, :datetime
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddClosedByToIssue < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :issues, :closed_by, :integer
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddDescriptionToGroups < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :groups, :description, :text
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddDefaultValuesToIsRpmForProjects < ActiveRecord::Migration
|
||||
def change
|
||||
Project.update_all(:is_rpm => true)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class RemoveNameFromGroups < ActiveRecord::Migration
|
||||
def up
|
||||
remove_column :groups, :name
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddProfessionalExperienceToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :professional_experience, :text
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddSiteCompanyAndLocationToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :site, :string
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddAvatarToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
change_table :users do |t|
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddProjectToComment < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :comments, :project_id, :integer
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class DeleteDublicateSubscribes < ActiveRecord::Migration
|
||||
def up
|
||||
execute <<-SQL
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class TruncateActivityFeed < ActiveRecord::Migration
|
||||
def up
|
||||
ActivityFeed.destroy_all
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddDescriptionToProducts < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :products, :description, :text
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class RemoveIsTemplateFromProducts < ActiveRecord::Migration
|
||||
def up
|
||||
remove_column :products, :is_template
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class AddBuildListPriority < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :build_lists, :priority, :integer, :null => false, :default => 0
|
||||
|
@ -6,4 +7,4 @@ class AddBuildListPriority < ActiveRecord::Migration
|
|||
def self.down
|
||||
remove_column :build_lists, :priority
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
class Object
|
||||
def with_skip
|
||||
begin
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
# # -*- encoding : utf-8 -*-
|
||||
module Gollum
|
||||
class Wiki
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
# -*- ruby encoding: utf-8 -*-
|
||||
|
||||
module Grit
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
require 'spec_helper'
|
||||
|
||||
describe ActivityFeedsController do
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
# Read about factories at http://github.com/thoughtbot/factory_girl
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :activity_feed do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
require 'spec_helper'
|
||||
|
||||
# Specs in this file have access to a helper object that includes
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
require 'spec_helper'
|
||||
|
||||
describe ActivityFeedObserver do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
require 'spec_helper'
|
||||
|
||||
describe ActivityFeed do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
require 'spec_helper'
|
||||
|
||||
describe Label do
|
||||
|
|
Loading…
Reference in New Issue