[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
 +dd
  a
  a
+adding b
+% modify text
+diff --git a/b b/b
+2 hunks, 2 lines changed
+examine changes to 'b'? [Ynsfdaq?]  @@ -1,4 +1,3 @@
+ a
+-b
+ c
+ d
+record change 1/2 to 'b'? [Ynsfdaq?]  @@ -3,2 +2,3 @@
+ c
+ d
++e
+record change 2/2 to 'b'? [Ynsfdaq?]  % modify permissions
+diff --git a/b b/b
+old mode 100644
+new mode 100755
+examine changes to 'b'? [Ynsfdaq?]  



More information about the Mercurial-devel mailing list