Commits

TK Soh  committed e77a915

update test suite to Mercurial's 'unify' format

old test script obsoleted since Mercurial revision 03554dfc7ced:

changeset: 17801:03554dfc7ced
user: Mads Kiilerich <mads@kiilerich.com>
date: Thu Oct 18 00:44:32 2012 +0200
summary: run-tests: remove dead code for supporting old test scripts

  • Participants
  • Parent commits 1155713

Comments (0)

Files changed (6)

File test-shelve

-#!/bin/sh
-
-HGRCPATH=$HGTMP/.hgrc
-export HGRCPATH
-echo "[ui]" >> $HGRCPATH
-echo "interactive=true" >> $HGRCPATH
-echo "[extensions]" >> $HGRCPATH
-echo "hgshelve=" >> $HGRCPATH
-
-hg init a
-cd a
-
-for i in 1 2 3 4; do
-    echo $i >> file1.txt
-done
-cp file1.txt file2.txt
-hg add file1.txt file2.txt
-hg commit -d '1 0' -m 'first file' file1.txt
-hg commit -d '2 0' -m 'second file' file2.txt
-hg bundle --base -2 tip.bundle
-hg add tip.bundle
-hg commit -d '3 0' -m 'binary file' tip.bundle
-
-rm file1.txt
-for i in a 1 2 3 4 b; do
-    echo $i >> file1.txt
-done
-cp file1.txt file2.txt
-hg bundle --base -2 tip.bundle
-hg commit -d '4 0' -m 'more changes'
-
-echo % create changes for shelving
-hg revert --rev 2 --all
-hg diff --nodates
-
-echo % do selective shelve
-hg shelve<<EOF
-y
-n
-y
-y
-y
-n
-y
-EOF
-
-echo
-echo % check remaining diffs
-hg status
-hg diff --nodates
-
-echo % append to existing shelf
-hg shelve --append --all
-
-echo % inpect shelved data
-hg shelve --list
-hg unshelve --inspect
-
-echo % unshelve and verify
-hg unshelve
-hg diff --rev 2 --git
-
-echo % check shelf names
-hg shelve --name file1 --all file1.txt
-hg shelve --name file2 --all file2.txt
-hg status
-hg shelve --list
-hg unshelve --list
-hg unshelve --name file1
-hg unshelve --name file2
-hg status
-hg unshelve
-

File test-shelve-color

-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "color=" >> $HGRCPATH
-
-hg init repo
-cd repo
-cat > a <<EOF
-c
-c
-a
-a
-b
-a
-a
-c
-c
-EOF
-hg ci -Am adda
-cat > a <<EOF
-c
-c
-a
-a
-dd
-a
-a
-c
-c
-EOF
-
-echo "[ui]" >> $HGRCPATH
-echo "interactive=true" >> $HGRCPATH
-echo "[extensions]" >> $HGRCPATH
-echo "hgshelve=" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "git=True" >> $HGRCPATH
-
-echo % shelve
-chmod 0755 a
-hg shelve --color=always a <<EOF
-y
-y
-EOF
-echo

File test-shelve-color.out

-adding a
-% shelve
-diff --git a/a b/a
-old mode 100644
-new mode 100755
-1 hunks, 2 lines changed
-shelve changes to 'a'? [Ynsfdaq?]  @@ -2,7 +2,7 @@
- c
- a
- a
--b
-+dd
- a
- a
- c
-shelve this change to 'a'? [Ynsfdaq?]  

File test-shelve-color.t

+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "color=" >> $HGRCPATH
+
+Create repo for testing
+
+  $ hg init repo
+  $ cd repo
+  $ cat > a <<EOF
+  > c
+  > c
+  > a
+  > a
+  > b
+  > a
+  > a
+  > c
+  > c
+  > EOF
+  $ hg ci -Am adda
+  adding a
+  $ cat > a <<EOF
+  > c
+  > c
+  > a
+  > a
+  > dd
+  > a
+  > a
+  > c
+  > c
+  > EOF
+
+  $ echo "[ui]" >> $HGRCPATH
+  $ echo "interactive=true" >> $HGRCPATH
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "hgshelve=" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "git=True" >> $HGRCPATH
+
+Test shelve
+
+  $ chmod 0755 a
+  $ hg shelve --color=always a <<EOF
+  > y
+  > y
+  > EOF
+  \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
+  \x1b[0;36;1mold mode 100644\x1b[0m (esc)
+  \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
+  1 hunks, 2 lines changed
+  \x1b[0;33mshelve changes to 'a'? [Ynsfdaq?] \x1b[0m \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
+   c
+   a
+   a
+  \x1b[0;31m-b\x1b[0m (esc)
+  \x1b[0;32m+dd\x1b[0m (esc)
+   a
+   a
+   c
+  \x1b[0;33mshelve this change to 'a'? [Ynsfdaq?] \x1b[0m  (no-eol) (esc)
+  $ echo
+  

File test-shelve.out

-1 changesets found
-1 changesets found
-% create changes for shelving
-reverting file1.txt
-reverting file2.txt
-reverting tip.bundle
-diff -r a71f3ef38ad4 file1.txt
---- a/file1.txt
-+++ b/file1.txt
-@@ -1,6 +1,4 @@
--a
- 1
- 2
- 3
- 4
--b
-diff -r a71f3ef38ad4 file2.txt
---- a/file2.txt
-+++ b/file2.txt
-@@ -1,6 +1,4 @@
--a
- 1
- 2
- 3
- 4
--b
-diff -r a71f3ef38ad4 tip.bundle
-Binary file tip.bundle has changed
-% do selective shelve
-diff --git a/file1.txt b/file1.txt
-2 hunks, 2 lines changed
-shelve changes to 'file1.txt'? [Ynsfdaq?]  @@ -1,5 +1,4 @@
--a
- 1
- 2
- 3
- 4
-shelve this change to 'file1.txt'? [Ynsfdaq?]  @@ -2,5 +1,4 @@
- 1
- 2
- 3
- 4
--b
-shelve this change to 'file1.txt'? [Ynsfdaq?]  diff --git a/file2.txt b/file2.txt
-2 hunks, 2 lines changed
-shelve changes to 'file2.txt'? [Ynsfdaq?]  @@ -1,5 +1,4 @@
--a
- 1
- 2
- 3
- 4
-shelve this change to 'file2.txt'? [Ynsfdaq?]  @@ -2,5 +1,4 @@
- 1
- 2
- 3
- 4
--b
-shelve this change to 'file2.txt'? [Ynsfdaq?]  diff --git a/tip.bundle b/tip.bundle
-this modifies a binary file (all or nothing)
-shelve changes to 'tip.bundle'? [Ynsfdaq?]  
-% check remaining diffs
-M file1.txt
-M file2.txt
-diff -r a71f3ef38ad4 file1.txt
---- a/file1.txt
-+++ b/file1.txt
-@@ -1,4 +1,3 @@
--a
- 1
- 2
- 3
-diff -r a71f3ef38ad4 file2.txt
---- a/file2.txt
-+++ b/file2.txt
-@@ -3,4 +3,3 @@
- 2
- 3
- 4
--b
-% append to existing shelf
-% inpect shelved data
-default
-diff --git a/file1.txt b/file1.txt
---- a/file1.txt
-+++ b/file1.txt
-@@ -2,5 +2,4 @@
- 1
- 2
- 3
- 4
--b
-diff --git a/tip.bundle b/tip.bundle
-index 7360ca0c61fa832e44b5e5c936b87701de8bda12..225d2fbb02d47c2162cda09e9e3332f88ec4069a
-GIT binary patch
-literal 396
-zc$@)@0dxLHM=>x$T4*^jL0KkKStX{nX#fBX|NrgVUcpx-fA>nDw?IGjzt|Zn3<N+R
-z|BwcW6wm;i1fZ}0`xXsS6B7VTCYof)fCw2eF$|3|VLbw1nl!>=N$Aw|KPWX!r1qxN
-z^$Fr58kz=%Mg+nGH3ox5h7d3&k5fjP82~jVplFx@3<;)9G{#6607em$6DC2lXdu%9
-zWWtIPid_|~ry%P%q~tW$!Qw;eFEkK<6vCK+fG?6(b&ooFr>96-LNf@JgmnR>9F0i>
-ze{=>YwaT|6O3VY*<7P<REtEl|{eVVw$`}c<quJ8ZJB1CNd*EPLA;Y87RE9EZxpoTg
-zP`oJpG$rVyq{E>DEZNDG$>}T!HpVbAF4V<{0^jlDd5^jXR;#7pJv}%>Mf#_26KF$$
-z01Qg)6*km`Z;!B^0@j~Kfn)~2GXWMpfFcFFL^RD?et!VbV9$*?K&7}2Bv2(pTRHo>
-qar#atNvM%#;0jJt&??Xnqyaz5Pzsh+06idB-Y(>daG@YeO>ELh`lWmT
-
-diff --git a/file2.txt b/file2.txt
---- a/file2.txt
-+++ b/file2.txt
-@@ -1,5 +1,4 @@
--a
- 1
- 2
- 3
- 4
-diff --git a/file1.txt b/file1.txt
---- a/file1.txt
-+++ b/file1.txt
-@@ -1,4 +1,3 @@
--a
- 1
- 2
- 3
-diff --git a/file2.txt b/file2.txt
---- a/file2.txt
-+++ b/file2.txt
-@@ -3,4 +3,3 @@
- 2
- 3
- 4
--b
-% unshelve and verify
-unshelve completed
-% check shelf names
-M tip.bundle
-file2
-file1
-file2
-file1
-unshelve completed
-unshelve completed
-M file1.txt
-M file2.txt
-M tip.bundle
-nothing to unshelve

File test-shelve.t

+  $ HGRCPATH=$HGTMP/.hgrc
+  $ export HGRCPATH
+  $ echo "[ui]" >> $HGRCPATH
+  $ echo "interactive=true" >> $HGRCPATH
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "hgshelve=" >> $HGRCPATH
+
+Create repo for testing
+
+  $ hg init a
+  $ cd a
+  $ for i in 1 2 3 4; do
+  >    echo $i >> file1.txt
+  > done
+  $ cp file1.txt file2.txt
+  $ hg add file1.txt file2.txt
+  $ hg commit -d '1 0' -m 'first file' file1.txt
+  $ hg commit -d '2 0' -m 'second file' file2.txt
+  $ hg bundle --base -2 tip.bundle
+  1 changesets found
+  $ hg add tip.bundle
+  $ hg commit -d '3 0' -m 'binary file' tip.bundle
+  $ rm file1.txt
+  $ for i in a 1 2 3 4 b; do
+  >     echo $i >> file1.txt
+  > done
+  $ cp file1.txt file2.txt
+  $ hg bundle --base -2 tip.bundle
+  1 changesets found
+  $ hg commit -d '4 0' -m 'more changes'
+
+Create changes for shelving
+
+  $ hg revert --rev 2 --all
+  reverting file1.txt
+  reverting file2.txt
+  reverting tip.bundle
+  $ hg diff --nodates
+  diff -r a71f3ef38ad4 file1.txt
+  --- a/file1.txt
+  +++ b/file1.txt
+  @@ -1,6 +1,4 @@
+  -a
+   1
+   2
+   3
+   4
+  -b
+  diff -r a71f3ef38ad4 file2.txt
+  --- a/file2.txt
+  +++ b/file2.txt
+  @@ -1,6 +1,4 @@
+  -a
+   1
+   2
+   3
+   4
+  -b
+  diff -r a71f3ef38ad4 tip.bundle
+  Binary file tip.bundle has changed
+
+Do selective shelve
+  $ hg shelve<<EOF
+  > y
+  > n
+  > y
+  > y
+  > y
+  > n
+  > y
+  > EOF
+  diff --git a/file1.txt b/file1.txt
+  2 hunks, 2 lines changed
+  shelve changes to 'file1.txt'? [Ynsfdaq?]  @@ -1,5 +1,4 @@
+  -a
+   1
+   2
+   3
+   4
+  shelve this change to 'file1.txt'? [Ynsfdaq?]  @@ -2,5 +1,4 @@
+   1
+   2
+   3
+   4
+  -b
+  shelve this change to 'file1.txt'? [Ynsfdaq?]  diff --git a/file2.txt b/file2.txt
+  2 hunks, 2 lines changed
+  shelve changes to 'file2.txt'? [Ynsfdaq?]  @@ -1,5 +1,4 @@
+  -a
+   1
+   2
+   3
+   4
+  shelve this change to 'file2.txt'? [Ynsfdaq?]  @@ -2,5 +1,4 @@
+   1
+   2
+   3
+   4
+  -b
+  shelve this change to 'file2.txt'? [Ynsfdaq?]  diff --git a/tip.bundle b/tip.bundle
+  this modifies a binary file (all or nothing)
+  shelve changes to 'tip.bundle'? [Ynsfdaq?]   (no-eol)
+
+  $ echo
+  
+Check remaining diffs
+
+  $ hg status
+  M file1.txt
+  M file2.txt
+  $ hg diff --nodates
+  diff -r a71f3ef38ad4 file1.txt
+  --- a/file1.txt
+  +++ b/file1.txt
+  @@ -1,4 +1,3 @@
+  -a
+   1
+   2
+   3
+  diff -r a71f3ef38ad4 file2.txt
+  --- a/file2.txt
+  +++ b/file2.txt
+  @@ -3,4 +3,3 @@
+   2
+   3
+   4
+  -b
+
+Append to existing shelf
+
+  $ hg shelve --append --all
+
+Inpect shelved data
+
+  $ hg shelve --list
+  default
+  $ hg unshelve --inspect
+  diff --git a/file1.txt b/file1.txt
+  --- a/file1.txt
+  +++ b/file1.txt
+  @@ -2,5 +2,4 @@
+   1
+   2
+   3
+   4
+  -b
+  diff --git a/tip.bundle b/tip.bundle
+  index 7360ca0c61fa832e44b5e5c936b87701de8bda12..225d2fbb02d47c2162cda09e9e3332f88ec4069a
+  GIT binary patch
+  literal 396
+  zc$@)@0dxLHM=>x$T4*^jL0KkKStX{nX#fBX|NrgVUcpx-fA>nDw?IGjzt|Zn3<N+R
+  z|BwcW6wm;i1fZ}0`xXsS6B7VTCYof)fCw2eF$|3|VLbw1nl!>=N$Aw|KPWX!r1qxN
+  z^$Fr58kz=%Mg+nGH3ox5h7d3&k5fjP82~jVplFx@3<;)9G{#6607em$6DC2lXdu%9
+  zWWtIPid_|~ry%P%q~tW$!Qw;eFEkK<6vCK+fG?6(b&ooFr>96-LNf@JgmnR>9F0i>
+  ze{=>YwaT|6O3VY*<7P<REtEl|{eVVw$`}c<quJ8ZJB1CNd*EPLA;Y87RE9EZxpoTg
+  zP`oJpG$rVyq{E>DEZNDG$>}T!HpVbAF4V<{0^jlDd5^jXR;#7pJv}%>Mf#_26KF$$
+  z01Qg)6*km`Z;!B^0@j~Kfn)~2GXWMpfFcFFL^RD?et!VbV9$*?K&7}2Bv2(pTRHo>
+  qar#atNvM%#;0jJt&??Xnqyaz5Pzsh+06idB-Y(>daG@YeO>ELh`lWmT
+  
+  diff --git a/file2.txt b/file2.txt
+  --- a/file2.txt
+  +++ b/file2.txt
+  @@ -1,5 +1,4 @@
+  -a
+   1
+   2
+   3
+   4
+  diff --git a/file1.txt b/file1.txt
+  --- a/file1.txt
+  +++ b/file1.txt
+  @@ -1,4 +1,3 @@
+  -a
+   1
+   2
+   3
+  diff --git a/file2.txt b/file2.txt
+  --- a/file2.txt
+  +++ b/file2.txt
+  @@ -3,4 +3,3 @@
+   2
+   3
+   4
+  -b
+
+Unshelve and verify
+
+  $ hg unshelve
+  unshelve completed
+  $ hg diff --rev 2 --git
+
+
+Check shelf names
+
+  $ hg shelve --name file1 --all file1.txt
+  $ hg shelve --name file2 --all file2.txt
+  $ hg status
+  M tip.bundle
+  $ hg shelve --list
+  file2
+  file1
+  $ hg unshelve --list
+  file2
+  file1
+  $ hg unshelve --name file1
+  unshelve completed
+  $ hg unshelve --name file2
+  unshelve completed
+  $ hg status
+  M file1.txt
+  M file2.txt
+  M tip.bundle
+  $ hg unshelve
+  nothing to unshelve