[PATCH 08 of 13] tests: unify test-merge5

in3xes at gmail.com in3xes at gmail.com
Thu Aug 19 03:56:54 CDT 2010


# HG changeset patch
# User Pradeepkumar Gayam <in3xes at gmail.com>
# Date 1282088749 -19800
# Node ID a3c5fcbb14623f387cdd5fb2a23e83b267c346b8
# Parent  2bb9742c2acd0238080f59cb19d4f0bdf9f17862
tests: unify test-merge5

diff --git a/tests/test-merge5.out b/tests/test-merge5.out
deleted file mode 100644
--- a/tests/test-merge5.out
+++ /dev/null
@@ -1,7 +0,0 @@
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-removing b
-created new head
-% should abort
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
-% should succeed
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
diff --git a/tests/test-merge5 b/tests/test-merge5.t
old mode 100755
new mode 100644
rename from tests/test-merge5
rename to tests/test-merge5.t
--- a/tests/test-merge5
+++ b/tests/test-merge5.t
@@ -1,25 +1,29 @@
-#!/bin/sh
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo This is file a1 > a
+  $ echo This is file b1 > b
+  $ hg add a b
+  $ hg commit -m "commit #0" -d "1000000 0"
+  $ echo This is file b22 > b
+  $ hg commit -m"comment #1" -d "1000000 0"
+  $ hg update 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ rm b
+  $ hg commit -A -m"comment #2" -d "1000000 0"
+  removing b
+  created new head
+  $ mv a c
+in theory, we shouldn't need the "-y" below, but it prevents
+this test from hanging when "hg update" erroneously prompts the
+user for "keep or delete"
 
-mkdir t
-cd t
-hg init
-echo This is file a1 > a
-echo This is file b1 > b
-hg add a b
-hg commit -m "commit #0" -d "1000000 0"
-echo This is file b22 > b
-hg commit -m"comment #1" -d "1000000 0"
-hg update 0
-rm b
-hg commit -A -m"comment #2" -d "1000000 0"
-mv a c
-# in theory, we shouldn't need the "-y" below, but it prevents
-# this test from hanging when "hg update" erroneously prompts the
-# user for "keep or delete"
-echo % should abort
-hg update -y 1
-mv c a
-echo % should succeed
-hg update -y 1
+should abort
+  $ hg update -y 1
+  abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+  $ mv c a
+should succeed
+  $ hg update -y 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-exit 0
+  $ exit 0


More information about the Mercurial-devel mailing list