diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-03-11 15:03:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-03-11 15:03:24 -0400 |
commit | 6398f205b74c158eecdf2ed6a057f77f64db0340 (patch) | |
tree | e0ad2676db44d647972ea7a3fbbccb46aaa3a798 /commit.d | |
parent | 93b0abfb666273774e3c418f31396b5b5ad1c043 (diff) |
* Add support for bzr, thanks to Mark A. Hershberger. Closes: #470515
(Note that bzr does not support etckeeper's pre-commit hook.)
Diffstat (limited to 'commit.d')
-rwxr-xr-x | commit.d/10vcs-test | 2 | ||||
-rwxr-xr-x | commit.d/40bzr-rm | 12 | ||||
-rwxr-xr-x | commit.d/45bzr-precommit | 6 | ||||
-rwxr-xr-x | commit.d/50vcs-commit | 6 |
4 files changed, 26 insertions, 0 deletions
diff --git a/commit.d/10vcs-test b/commit.d/10vcs-test index ddd4448..1fd4226 100755 --- a/commit.d/10vcs-test +++ b/commit.d/10vcs-test @@ -10,4 +10,6 @@ if [ "$VCS" = git ] && [ ! -d .git ]; then not_enabled_warning elif [ "$VCS" = hg ] && [ ! -d .hg ]; then not_enabled_warning +elif [ "$VCS" = bzr ] && [ ! -d .bzr ]; then + not_enabled_warning fi diff --git a/commit.d/40bzr-rm b/commit.d/40bzr-rm new file mode 100755 index 0000000..a13bfd7 --- /dev/null +++ b/commit.d/40bzr-rm @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +TAB=" " + +if [ "$VCS" = bzr ] && [ -d .bzr ]; then + for file in $(bzr deleted); do + if [ ! -d "$file" ]; then + bzr rm --keep --quiet "$file" + fi + done +fi diff --git a/commit.d/45bzr-precommit b/commit.d/45bzr-precommit new file mode 100755 index 0000000..3128c7a --- /dev/null +++ b/commit.d/45bzr-precommit @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +if [ "$VCS" = bzr ] && [ -d .bzr ]; then + etckeeper precommit . +fi diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit index 48fa177..86fe8fb 100755 --- a/commit.d/50vcs-commit +++ b/commit.d/50vcs-commit @@ -15,4 +15,10 @@ elif [ "$VCS" = hg ] && [ -d .hg ]; then else hg commit $HG_COMMIT_OPTIONS fi +elif [ "$VCS" = bzr ] && [ -d .bzr ]; then + if [ -n "$message" ]; then + bzr commit $BZR_COMMIT_OPTIONS -m "$message" + else + bzr commit $BZR_COMMIT_OPTIONS + fi fi |