diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 024d5fdde..995c45e9b 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -254,7 +254,10 @@ update #if( !User.current.member_of?(@project) || @project.hidden_repo) @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? - + g = Gitlab.client + # r = g.get("/users?search=#{user.mail}").first + # rr = g.trees(@project.id, @path) + # r = g.get ("/projects/#{@project}/repository/tree") # :name, :path, :kind, :size, :lastrev, :changeset @entries = @repository.entries(@path, @rev) @changeset = @repository.find_changeset_by_name(@rev) diff --git a/app/models/project.rb b/app/models/project.rb index 8fe02b29f..6d24fa4ed 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -768,7 +768,8 @@ class Project < ActiveRecord::Base 'project_type', 'dts_test', 'attachmenttype', - 'enterprise_name' + 'enterprise_name', + 'gpid' diff --git a/db/migrate/20151013023237_add_gpid_to_project.rb b/db/migrate/20151013023237_add_gpid_to_project.rb new file mode 100644 index 000000000..bfa535253 --- /dev/null +++ b/db/migrate/20151013023237_add_gpid_to_project.rb @@ -0,0 +1,5 @@ +class AddGpidToProject < ActiveRecord::Migration + def change + add_column :projects, :gpid, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 8cc69e7f1..78e280e43 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150930011457) do +ActiveRecord::Schema.define(:version => 20151013023237) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1146,6 +1146,7 @@ ActiveRecord::Schema.define(:version => 20150930011457) do t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" + t.integer "gpid" end add_index "projects", ["lft"], :name => "index_projects_on_lft" diff --git a/lib/tasks/gitlab.rake b/lib/tasks/gitlab.rake index 5795ae4f4..0f6f78bb6 100644 --- a/lib/tasks/gitlab.rake +++ b/lib/tasks/gitlab.rake @@ -60,7 +60,9 @@ namespace :gitlab do user_id: gid, import_url: 'https://github.com/gitlabhq/gitlab-cli.git' ) - + project.gpid = gproject.id + project.save! + puts "Successfully created #{project.name}" # add team members # GUEST = 10