Commits

Anonymous committed 6610c14

add automatic repo address

  • Participants
  • Parent commits aeda027

Comments (0)

Files changed (1)

File app/models/project_observer.rb

   
   def after_create(project)
     p_file = File.open(config['projects_dir'] + '/' + project[:identifier], 'w') { |f| f.write('') } 
+    repository = Repository.factory('Mercurial')
+    repository.project = project
+
+    # repository.vendor = 'Mercurial'
+    repository.attributes = {:url => "/tank/hgrepos/#{project.identifier}"}
+    repository.save
+
+		#project.post(:repository, :vendor => 'Mercurial', :repository => {:url => "/tank/hgrepos/#{project.identifier}"})
   end
 
   def after_destroy(project)