Changeset - 70a5a9a57864
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2011-05-04 19:06:56
marcin@python-works.com
logged local commit with special action via action_logger,
3 files changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -246,6 +246,7 @@ class FilesController(BaseRepoController
 
            try:
 
                self.scm_model.commit_change(repo=c.rhodecode_repo,
 
                                             repo_name=repo_name, cs=c.cs,
 
                                             user=self.rhodecode_user,
 
                                             author=author, message=message,
 
                                             content=content, f_path=f_path)
 
                h.flash(_('Successfully committed to %s' % f_path),
rhodecode/lib/helpers.py
Show inline comments
 
@@ -453,6 +453,7 @@ def action_parser(user_log, feed=False):
 
           'admin_forked_repo':(_('[forked] repository'), None),
 
           'admin_updated_repo':(_('[updated] repository'), None),
 
           'push':(_('[pushed] into'), get_cs_links),
 
           'push_local':(_('[committed via RhodeCode] into'), get_cs_links),
 
           'push_remote':(_('[pulled from remote] into'), get_cs_links),
 
           'pull':(_('[pulled] from'), None),
 
           'started_following_repo':(_('[started following] repository'), None),
 
@@ -491,6 +492,7 @@ def action_parser_icon(user_log):
 
           'admin_forked_repo':'arrow_divide.png',
 
           'admin_updated_repo':'database_edit.png',
 
           'push':'script_add.png',
 
           'push_local':'script_edit.png',
 
           'push_remote':'connect.png',
 
           'pull':'down_16.png',
 
           'started_following_repo':'heart_add.png',
rhodecode/model/scm.py
Show inline comments
 
@@ -378,7 +378,7 @@ class ScmModel(BaseModel):
 
            raise
 

	
 

	
 
    def commit_change(self, repo, repo_name, cs, author, message, content,
 
    def commit_change(self, repo, repo_name, cs, user, author, message, content,
 
                      f_path):
 

	
 
        if repo.alias == 'hg':
 
@@ -394,10 +394,15 @@ class ScmModel(BaseModel):
 
        author = author.encode('utf8')
 
        m = IMC(repo)
 
        m.change(FileNode(path, content))
 
        m.commit(message=message,
 
        tip = m.commit(message=message,
 
                 author=author,
 
                 parents=[cs], branch=cs.branch)
 

	
 
        new_cs = tip.short_id
 
        action = 'push_local:%s' % new_cs
 

	
 
        action_logger(user, action, repo_name)
 

	
 
        self.mark_for_invalidation(repo_name)
 

	
 

	
0 comments (0 inline, 0 general)