Use newer API in bzr plugin. bzrplugin
authorJelmer Vernooij <jelmer@samba.org>
Thu, 15 May 2008 17:27:34 +0000 (19:27 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 15 May 2008 17:27:34 +0000 (19:27 +0200)
debian/changelog
etckeeper-bzr/__init__.py

index 3670a91e04d4c675a7b1d18fc3935197a0bd8844..8ab9a7073cd6eeb1d21cf1498f5002253b4dc83c 100644 (file)
@@ -1,3 +1,9 @@
+etckeeper (0.16) UNRELEASED; urgency=low
+
+  * Use new API in bzr plugin.
+
+ -- Jelmer Vernooij <jelmer@samba.org>  Thu, 15 May 2008 19:26:00 +0200
+
 etckeeper (0.15) unstable; urgency=low
 
   [ Daniel Hahler ]
index a656dc5b35f17a96550f1cdbd667ed15634ce1ca..54d160d757473039c7ec276ac0a1b9218285a9ec 100755 (executable)
@@ -20,8 +20,12 @@ def etckeeper_startcommit_hook(tree):
     if ret != 0:
         raise BzrError("etckeeper pre-commit failed")
 
-MutableTree.hooks.install_hook('start_commit', etckeeper_startcommit_hook)
-MutableTree.hooks.name_hook(etckeeper_startcommit_hook, "etckeeper")
+install_named_hook = getattr(MutableTree.hooks, 'install_named_hook', None)
+if install_named_hook is not None:
+    install_named_hook('start_commit', etckeeper_startcommit_hook, 'etckeeper')
+else:
+    MutableTree.hooks.install_hook('start_commit', etckeeper_startcommit_hook)
+    MutableTree.hooks.name_hook(etckeeper_startcommit_hook, "etckeeper")
 
 if __name__ == "__main__":
     from distutils.core import setup