[PATCH] color: add tests for hg record

Brodie Rao dackze at gmail.com
Tue Feb 17 13:34:38 CST 2009


# HG changeset patch
# User Brodie Rao <me+hg at dackz.net>
# Date 1234899202 18000
# Node ID 0df7cda23dc2364c317f59322720eaf56a037c6f
# Parent  809663f3a8a8db41af134321aabeab6c83941966
color: add tests for hg record

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 this change to 'a'? [Ynsfdaq?]  @@ -3,2 +2,3 @@
+ c
+ d
++e
+record this change 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