Commits

Mathieu Clabaut committed ba39da7

post-apt.d : Translation into mercurial idiom

  • Participants
  • Parent commits 26f0ae5

Comments (0)

Files changed (5)

File hg/post-apt.d/10hg-test

 #!/bin/sh
 set -e
-if [ ! -d .git ]; then
+if [ ! -d .hg ]; then
 	echo "etckeeper warning: etckeeper is not yet enabled for $(pwd)" >&2
 	echo "etckeeper warning: run etckeeper init to enable it" >&2
 fi

File hg/post-apt.d/30hg-add

-#!/bin/sh
-set -e
-if [ -d .git ]; then
-	if ! git-add .; then
-		echo "etckeeper warning: git-add failed" >&2
-	fi
-fi

File hg/post-apt.d/30hg-addremove

+#!/bin/sh
+set -e
+if [ -d .hg ]; then
+	if ! hg addremove .; then
+		echo "etckeeper warning: hg addremove failed" >&2
+	fi
+fi

File hg/post-apt.d/40hg-rm

-#!/bin/sh
-set -e
-
-TAB="	"
-
-if [ -d .git ]; then
-	for file in $(git ls-files --deleted); do
-		if [ ! -d "$file" ]; then 
-			git rm --quiet "$file"
-		fi
-	done
-fi

File hg/post-apt.d/50hg-commit

 #!/bin/sh
 set -e
 
-if [ -d .git ]; then
+if [ -d .hg ]; then
 
 	# TODO: figure out what packages were acted on by the apt run, and
 	# include that info in the commit message
 	message="committing changes after apt run"
 
 	# ignore exit code since it exits nonzero if there is nothing to do
-	git commit $GIT_COMMIT_OPTIONS -m "$message" || true
+	hg commit $GIT_COMMIT_OPTIONS -m "$message" || true
 fi