[PATCH] color: add tests for record support
Brodie Rao
dackze at gmail.com
Fri Oct 9 02:24:59 UTC 2009
# HG changeset patch
# User Brodie Rao <me+hg at dackz.net>
# Date 1255054753 14400
# Node ID 188cd986740bd6fb60c9a3e3b53848ec2f55e079
# Parent 7e03423def3ca43706fb5a9a8951ba10cdb75ba0
color: add tests for record support
diff --git a/tests/test-diff-color b/tests/test-diff-color
--- a/tests/test-diff-color
+++ b/tests/test-diff-color
@@ -33,4 +33,42 @@ echo '% default context'
hg diff --nodates --color=always
echo '% --unified=2'
-hg diff --nodates -U 2 --color=always
\ No newline at end of file
+hg diff --nodates -U 2 --color=always
+
+echo "record=" >> $HGRCPATH
+echo "[ui]" >> $HGRCPATH
+echo "interactive=true" >> $HGRCPATH
+echo "[diff]" >> $HGRCPATH
+echo "git=True" >> $HGRCPATH
+
+cat > b <<EOF
+a
+b
+c
+d
+EOF
+chmod 0644 b
+hg ci -Am addb
+
+echo % modify text
+
+cat > b <<EOF
+a
+c
+d
+e
+EOF
+
+hg record --color=always -m modb b <<EOF
+y
+y
+y
+EOF
+
+echo % modify permissions
+
+chmod 0755 b
+hg record --color=always -m permb b <<EOF
+y
+EOF
+echo
diff --git a/tests/test-diff-color.out b/tests/test-diff-color.out
--- a/tests/test-diff-color.out
+++ b/tests/test-diff-color.out
@@ -23,3 +23,21 @@ adding a
[0;32m+dd[0m
a
a
+adding b
+% modify text
+[0;1mdiff --git a/b b/b[0m
+2 hunks, 2 lines changed
+examine changes to 'b'? [Ynsfdaq?] [0;35m@@ -1,4 +1,3 @@[0m
+ a
+[0;31m-b[0m
+ c
+ d
+record change 1/2 to 'b'? [Ynsfdaq?] [0;35m@@ -3,2 +2,3 @@[0m
+ c
+ d
+[0;32m+e[0m
+record change 2/2 to 'b'? [Ynsfdaq?] % modify permissions
+[0;1mdiff --git a/b b/b[0m
+[0;36;1mold mode 100644[0m
+[0;36;1mnew mode 100755[0m
+examine changes to 'b'? [Ynsfdaq?]
More information about the Mercurial-devel
mailing list