diff options
-rwxr-xr-x | commit.d/30bzr-add | 2 | ||||
-rw-r--r-- | debian/changelog | 4 | ||||
-rwxr-xr-x | etckeeper-bzr/__init__.py | 8 |
3 files changed, 11 insertions, 3 deletions
diff --git a/commit.d/30bzr-add b/commit.d/30bzr-add index 62e4bac..3e7e95d 100755 --- a/commit.d/30bzr-add +++ b/commit.d/30bzr-add @@ -2,7 +2,7 @@ set -e if [ "$VCS" = bzr ] && [ -d .bzr ]; then - if ! bzr add .; then + if ! bzr add -q .; then echo "etckeeper warning: bzr add failed" >&2 fi fi diff --git a/debian/changelog b/debian/changelog index f638670..eb1664f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,10 @@ etckeeper (0.17) unstable; urgency=low etckeeper (0.16) unstable; urgency=low + [ Jelmer Vernooij ] + * Use new Bazaar API. + + [ Joey Hess] * Add a AVOID_COMMIT_BEFORE_INSTALL option in the config file to make it easy to configure etckeeper to abort an installation if there are uncommitted changes in /etc. Closes: #478754 diff --git a/etckeeper-bzr/__init__.py b/etckeeper-bzr/__init__.py index a656dc5..54d160d 100755 --- a/etckeeper-bzr/__init__.py +++ b/etckeeper-bzr/__init__.py @@ -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 |