From 69dd4954ad4007709d1c0fa0a3e38be27d28ca0a Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Fri, 31 Mar 2006 15:27:34 -0500 Subject: [PATCH] Dirty fix for new-comments not writing bug --- .be/bugs/a63bd76a-cd43-4f97-88ba-2323546d4572/values | 2 +- beweb/beweb/controllers.py | 4 ++++ libbe/bzr.py | 12 ++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.be/bugs/a63bd76a-cd43-4f97-88ba-2323546d4572/values b/.be/bugs/a63bd76a-cd43-4f97-88ba-2323546d4572/values index de74b69..7801138 100644 --- a/.be/bugs/a63bd76a-cd43-4f97-88ba-2323546d4572/values +++ b/.be/bugs/a63bd76a-cd43-4f97-88ba-2323546d4572/values @@ -15,7 +15,7 @@ severity=minor -status=open +status=closed diff --git a/beweb/beweb/controllers.py b/beweb/beweb/controllers.py index 9124116..9379e24 100644 --- a/beweb/beweb/controllers.py +++ b/beweb/beweb/controllers.py @@ -103,6 +103,10 @@ class Bug(PrestHandler): @provide_action("action", "New comment") def new_comment(self, bug_data, bug, *args, **kwargs): + try: + self.update(bug_data, bug, *args, **kwargs) + except cherrypy.HTTPRedirect: + pass return self.comment.new_comment(bug_data, comment=None, *args, **kwargs) diff --git a/libbe/bzr.py b/libbe/bzr.py index 045395d..7aa6a58 100644 --- a/libbe/bzr.py +++ b/libbe/bzr.py @@ -120,10 +120,14 @@ def commit(directory, summary, body=None): def postcommit(directory): try: invoke_client('merge', directory=directory) - except CommandError: - status = invoke_client('revert --no-backup', directory=directory) - status = invoke_client('resolve --all', directory=directory) - raise + except CommandError, e: + if 'No merge branch known or specified' in e.err_str: + pass + else: + status = invoke_client('revert', '--no-backup', + directory=directory) + status = invoke_client('resolve', '--all', directory=directory) + raise if len(invoke_client('status', directory=directory)[1]) > 0: commit(directory, 'Merge from upstream') -- 2.26.2