# HG changeset patch # User Marcin Kuzminski # Date 1304528816 -7200 # Node ID 70a5a9a57864a6de42b4a60e71b89b748259b34f # Parent 6705eeebc41bce5626cfa254f0046b8bc7438d31 logged local commit with special action via action_logger, diff -r 6705eeebc41b -r 70a5a9a57864 rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py Wed May 04 18:37:32 2011 +0200 +++ b/rhodecode/controllers/files.py Wed May 04 19:06:56 2011 +0200 @@ -246,6 +246,7 @@ 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), diff -r 6705eeebc41b -r 70a5a9a57864 rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py Wed May 04 18:37:32 2011 +0200 +++ b/rhodecode/lib/helpers.py Wed May 04 19:06:56 2011 +0200 @@ -453,6 +453,7 @@ '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 @@ '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', diff -r 6705eeebc41b -r 70a5a9a57864 rhodecode/model/scm.py --- a/rhodecode/model/scm.py Wed May 04 18:37:32 2011 +0200 +++ b/rhodecode/model/scm.py Wed May 04 19:06:56 2011 +0200 @@ -378,7 +378,7 @@ 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 @@ 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)