Changes

331 bytes added ,  01:57, 12 November 2010
Line 62: Line 62:  
  Mailer.deliver_forgotten_password(user, password_key)
 
  Mailer.deliver_forgotten_password(user, password_key)
 
   
 
   
  # add new repository committer
+
  # add repository committer
 
  committer = User.find_by_login("user")
 
  committer = User.find_by_login("user")
 
  repo = Repository::find_by_path("sugar/mainline")
 
  repo = Repository::find_by_path("sugar/mainline")
Line 71: Line 71:  
  repo = Repository::find_by_path("sugar/mainline")
 
  repo = Repository::find_by_path("sugar/mainline")
 
  repo.committerships = repo.committerships.select {|i| !i.members.include? committer }
 
  repo.committerships = repo.committerships.select {|i| !i.members.include? committer }
 +
 +
# change repository owner
 +
new_owner = User.find_by_login("user")
 +
repo = Repository::find_by_path("sugar/mainline")
 +
cs = repo.committerships.select {|i| i.committer == new_owner}.pop
 +
cs.permissions = (Committership::CAN_ADMIN | Committership::CAN_COMMIT | Committership::CAN_REVIEW)
 +
cs.save!
 +
repo.owner = new_owner
 +
repo.save!
    
== Upgrade notes ==
 
== Upgrade notes ==
    
Upgrade will be triggered on every puppet session (if there is such need), vcs repository will be rebased to the HEAD commit with all related changes like database migration.
 
Upgrade will be triggered on every puppet session (if there is such need), vcs repository will be rebased to the HEAD commit with all related changes like database migration.