Rev 2564: Allow -Dhooks to get the hooks invoked during commit logged. in sftp://rookery/~/public_html/baz2.0/commit-hook-names

Robert Collins robertc at robertcollins.net
Thu Jun 28 09:29:47 BST 2007


At sftp://rookery/~/public_html/baz2.0/commit-hook-names

------------------------------------------------------------
revno: 2564
revision-id: robertc at robertcollins.net-20070628082944-g033tsq16abxue3h
parent: robertc at robertcollins.net-20070628080025-nc7i3aax1hz39dkw
committer: Robert Collins <robertc at robertcollins.net>
branch nick: commit-hook-names
timestamp: Thu 2007-06-28 18:29:44 +1000
message:
  Allow -Dhooks to get the hooks invoked during commit logged.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/commit.py               commit.py-20050511101309-79ec1a0168e0e825
  bzrlib/debug.py                debug.py-20061102062349-vdhrw9qdpck8cl35-1
=== modified file 'NEWS'
--- a/NEWS	2007-06-28 07:50:53 +0000
+++ b/NEWS	2007-06-28 08:29:44 +0000
@@ -53,6 +53,9 @@
       library users and plugins. See the ``bzrlib.api`` module for details.
       (Robert Collins)
 
+    * -D now supports hooks to get debug tracing of hooks (though its currently
+      minimal in nature). (Robert Collins)
+
   INTERNALS:
 
     * New SMTPConnection class to unify email handling.  (Adeodato Simó)

=== modified file 'bzrlib/commit.py'
--- a/bzrlib/commit.py	2007-06-28 06:32:03 +0000
+++ b/bzrlib/commit.py	2007-06-28 08:29:44 +0000
@@ -57,6 +57,7 @@
 from cStringIO import StringIO
 
 from bzrlib import (
+    debug,
     errors,
     inventory,
     tree,
@@ -501,6 +502,8 @@
             self.pb_stage_name = "Running post commit hooks [%s]" % \
                 Branch.hooks.get_hook_name(hook)
             self._emit_progress()
+            if 'hooks' in debug.debug_flags:
+                mutter("Invoking commit hook: %r", hook)
             hook(hook_local, hook_master, old_revno, old_revid, new_revno,
                 self.rev_id)
 

=== modified file 'bzrlib/debug.py'
--- a/bzrlib/debug.py	2006-11-02 06:25:59 +0000
+++ b/bzrlib/debug.py	2007-06-28 08:29:44 +0000
@@ -18,3 +18,4 @@
 debug_flags = set()
 """Set of flags that enable different debug behaviour"""
 
+# hooks - debug activity about hooks.



More information about the bazaar-commits mailing list