[PATCH] tests: unify test-pull-r

Adrian Buehlmann adrian at cadifra.com
Mon Sep 13 04:38:32 CDT 2010


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1284369546 -7200
# Node ID 5fa354da3f2ffcd999ca5d824021243174cc8404
# Parent  094912bd5342f9c6d0360bd9ebc82910eab5ce1b
tests: unify test-pull-r

diff --git a/tests/test-pull-r.out b/tests/test-pull-r.out
deleted file mode 100644
--- a/tests/test-pull-r.out
+++ /dev/null
@@ -1,42 +0,0 @@
-changeset:   2:effea6de0384
-tag:         tip
-parent:      0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-changeset:   1:ed1b79f46b9a
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-changeset:   0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull a missing revision
-abort: unknown revision 'missing'!
-% pull multiple revisions with update
-0:bbd179dfa0a7
-rolling back to revision -1 (undo pull)
-% pull -r 0
-changeset:   0:bbd179dfa0a7
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull -r 1
-changeset:   1:ed1b79f46b9a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-changeset:   0:bbd179dfa0a7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% pull -r 1 again
diff --git a/tests/test-pull-r b/tests/test-pull-r.t
old mode 100755
new mode 100644
rename from tests/test-pull-r
rename to tests/test-pull-r.t
--- a/tests/test-pull-r
+++ b/tests/test-pull-r.t
@@ -1,35 +1,71 @@
-#!/bin/sh
+  $ hg init repo
+  $ cd repo
+  $ echo foo > foo
+  $ hg ci -qAm 'add foo'
+  $ echo >> foo
+  $ hg ci -m 'change foo'
+  $ hg up -qC 0
+  $ echo bar > bar
+  $ hg ci -qAm 'add bar'
 
-hg init repo
-cd repo
-echo foo > foo
-hg ci -qAm 'add foo'
-echo >> foo
-hg ci -m 'change foo'
-hg up -qC 0
-echo bar > bar
-hg ci -qAm 'add bar'
-hg log
-cd ..
-hg init copy
-cd copy
+  $ hg log
+  changeset:   2:effea6de0384
+  tag:         tip
+  parent:      0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  changeset:   1:ed1b79f46b9a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  changeset:   0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ cd ..
+  $ hg init copy
+  $ cd copy
 
-echo '% pull a missing revision'
-hg pull -qr missing ../repo
+Pull a missing revision:
 
-echo '% pull multiple revisions with update'
-hg pull -qu -r 0 -r 1 ../repo
-hg -q parents
-hg rollback
+  $ hg pull -qr missing ../repo
+  abort: unknown revision 'missing'!
 
-echo '% pull -r 0'
-hg pull -qr 0 ../repo
-hg log
+Pull multiple revisions with update:
 
-echo '% pull -r 1'
-hg pull -qr 1 ../repo
-hg log
+  $ hg pull -qu -r 0 -r 1 ../repo
+  $ hg -q parents
+  0:bbd179dfa0a7
+  $ hg rollback
+  rolling back to revision -1 (undo pull)
 
-# this used to abort: received changelog group is empty
-echo '% pull -r 1 again'
-hg pull -qr 1 ../repo
+  $ hg pull -qr 0 ../repo
+  $ hg log
+  changeset:   0:bbd179dfa0a7
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  $ hg pull -qr 1 ../repo
+  $ hg log
+  changeset:   1:ed1b79f46b9a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  changeset:   0:bbd179dfa0a7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+
+This used to abort: received changelog group is empty:
+
+  $ hg pull -qr 1 ../repo
+


More information about the Mercurial-devel mailing list