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



More information about the Mercurial-devel mailing list