[PATCH] color: add tests for record support
Brodie Rao
dackze at gmail.com
Thu Oct 8 13:54:16 UTC 2009
# HG changeset patch
# User Brodie Rao <me+hg at dackz.net>
# Date 1255009923 14400
# Node ID f3471a3f2dbee99fc363383edc48e970b8c423f1
# Parent 7e03423def3ca43706fb5a9a8951ba10cdb75ba0
color: add tests for record support
diff --git a/tests/test-record-color b/tests/test-record-color
new file mode 100755
--- /dev/null
+++ b/tests/test-record-color
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+echo "[ui]" >> $HGRCPATH
+echo "interactive=true" >> $HGRCPATH
+echo "[extensions]" >> $HGRCPATH
+echo "color=" >> $HGRCPATH
+echo "record=" >> $HGRCPATH
+echo "[diff]" >> $HGRCPATH
+echo "git=True" >> $HGRCPATH
+
+hg init a
+cd a
+
+cat > a <<EOF
+a
+b
+c
+d
+EOF
+chmod 0644 a
+hg ci -Am adda
+
+echo % modify text
+
+cat > a <<EOF
+a
+c
+d
+e
+EOF
+
+hg record --color=always -m moda a<<EOF
+y
+y
+y
+EOF
+
+echo % modify permissions
+
+chmod 0755 a
+hg record --color=always -m perma a <<EOF
+y
+EOF
+echo
diff --git a/tests/test-record-color.out b/tests/test-record-color.out
new file mode 100644
--- /dev/null
+++ b/tests/test-record-color.out
@@ -0,0 +1,18 @@
+adding a
+% modify text
+[0;1mdiff --git a/a b/a[0m
+2 hunks, 2 lines changed
+examine changes to 'a'? [Ynsfdaq?] [0;35m@@ -1,4 +1,3 @@[0m
+ a
+[0;31m-b[0m
+ c
+ d
+record change 1/2 to 'a'? [Ynsfdaq?] [0;35m@@ -3,2 +2,3 @@[0m
+ c
+ d
+[0;32m+e[0m
+record change 2/2 to 'a'? [Ynsfdaq?] % modify permissions
+[0;1mdiff --git a/a b/a[0m
+[0;36;1mold mode 100644[0m
+[0;36;1mnew mode 100755[0m
+examine changes to 'a'? [Ynsfdaq?]
More information about the Mercurial-devel
mailing list