From: Date: June 18 2008 3:23pm Subject: bzr commit into mysql_plugins branch (davi:114) List-Archive: http://lists.mysql.com/commits/48090 Message-Id: <20080618132320.D623223ADF@skynet> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit # At a local mysql_plugins repository of davi 114 Davi Arnaut 2008-06-18 [merge] Merge modified: __init__.py emailer.py hooks.py === modified file '__init__.py' --- a/__init__.py 2008-06-18 11:16:24 +0000 +++ b/__init__.py 2008-06-18 13:03:09 +0000 @@ -34,7 +34,7 @@ import hooks import sanity """) -version_info = (0, 3, 9) +version_info = (0, 3, 10) register_command(parent.cmd_parent) register_command(collapse.cmd_collapse) === modified file 'emailer.py' --- a/emailer.py 2008-06-18 13:01:44 +0000 +++ b/emailer.py 2008-06-18 13:23:17 +0000 @@ -437,17 +437,22 @@ class PushSender(EmailSender): if self._body is None: # We need the revno of the old revision in-the-new-tree note("Generating post-push message") - b=self.branch - b.lock_read() - g = b.repository.get_graph() - last = b.last_revision() - while True: - last_but_one = b.repository.get_revision(last).parent_ids[0] - introduced_by_last = g.find_unique_ancestors(last, [last_but_one]) - if self.old_revid in introduced_by_last: - break - last = last_but_one - self.old_revno = b.revision_id_to_revno(last) + try: + # Optimized case - if it works on the old_revid, we don't need + # to do the slow code below. + self.old_revno = self.branch.revision_id_to_revno(self.old_revid) + except: + b=self.branch + b.lock_read() + g = b.repository.get_graph() + last = b.last_revision() + while True: + last_but_one = b.repository.get_revision(last).parent_ids[0] + introduced_by_last = g.find_unique_ancestors(last, [last_but_one]) + if self.old_revid in introduced_by_last: + break + last = last_but_one + self.old_revno = b.revision_id_to_revno(last) outf = StringIO.StringIO() === modified file 'hooks.py' --- a/hooks.py 2008-06-18 10:10:15 +0000 +++ b/hooks.py 2008-06-18 13:10:28 +0000 @@ -42,8 +42,8 @@ def branch_commit_hook(local, master, ol note("WARNING: Problem with post-commit email hook. ") note("\t %s" % str(e)) note("Please see .bzr.log for more information") - finally: - master.unlock() + # Can't do finally here - some people have older python + master.unlock() def branch_push_hook(push_result):