[PATCH] tests: unify test-url-rev

Adrian Buehlmann adrian at cadifra.com
Tue Sep 14 09:47:20 CDT 2010


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1284475322 -7200
# Node ID 4ec6616f075d30b83ffc626ea132513d8f46830c
# Parent  7ab21071291296de53bafaee7cf113390446d776
tests: unify test-url-rev

diff --git a/tests/test-url-rev.out b/tests/test-url-rev.out
deleted file mode 100644
--- a/tests/test-url-rev.out
+++ /dev/null
@@ -1,148 +0,0 @@
-marked working directory as branch foo
-% clone repo#foo
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch foo
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% heads
-changeset:   1:cd2a86ecc814
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change a
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-% parents
-changeset:   1:cd2a86ecc814
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change a
-
-[paths]
-default = #foo
-
-% changing original repo
-changeset:   3:4cd725637392
-tag:         tip
-parent:      0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-changeset:   2:faba9097cad4
-branch:      foo
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-changeset:   1:cd2a86ecc814
-branch:      foo
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change a
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-
-% outgoing
-2:faba9097cad4
-
-% push
-changeset:   2:faba9097cad4
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-
-% rolling back
-rolling back to revision 1 (undo push)
-% incoming
-2:faba9097cad4
-% pull
-changeset:   2:faba9097cad4
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-
-% pull should not have updated
-1:cd2a86ecc814
-% going back to the default branch
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add a
-
-% no new revs, no update
-0:1f0dee641bb7
-% rollback
-rolling back to revision 1 (undo pull)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0:1f0dee641bb7
-% pull -u takes us back to branch foo
-changeset:   2:faba9097cad4
-branch:      foo
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
-% rollback
-rolling back to revision 1 (undo pull)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% parents
-0:1f0dee641bb7
-% heads
-1:cd2a86ecc814
-0:1f0dee641bb7
-% pull -u -r otherrev url#rev updates to rev
-% parents
-changeset:   3:4cd725637392
-tag:         tip
-parent:      0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-% heads
-changeset:   3:4cd725637392
-tag:         tip
-parent:      0:1f0dee641bb7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add bar
-
-changeset:   2:faba9097cad4
-branch:      foo
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     new head of branch foo
-
diff --git a/tests/test-url-rev b/tests/test-url-rev.t
old mode 100755
new mode 100644
rename from tests/test-url-rev
rename to tests/test-url-rev.t
--- a/tests/test-url-rev
+++ b/tests/test-url-rev.t
@@ -1,83 +1,206 @@
-#!/bin/sh
 # test basic functionality of url#rev syntax
 
-hg init repo
-cd repo
-echo a > a
-hg ci -qAm 'add a'
-hg branch foo
-echo >> a
-hg ci -m 'change a'
-cd ..
+  $ hg init repo
+  $ cd repo
+  $ echo a > a
+  $ hg ci -qAm 'add a'
+  $ hg branch foo
+  marked working directory as branch foo
+  $ echo >> a
+  $ hg ci -m 'change a'
+  $ cd ..
 
-echo '% clone repo#foo'
-hg clone 'repo#foo' clone
-echo '% heads'
-hg --cwd clone heads
-echo '% parents'
-hg --cwd clone parents
-sed -e 's/default.*#/default = #/' clone/.hg/hgrc
-echo
+  $ hg clone 'repo#foo' clone
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch foo
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-echo '% changing original repo'
-cd repo
-echo >> a
-hg ci -m 'new head of branch foo'
-hg up -qC default
-echo bar > bar
-hg ci -qAm 'add bar'
-hg log
-echo
+  $ hg --cwd clone heads
+  changeset:   1:cd2a86ecc814
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change a
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+  $ hg --cwd clone parents
+  changeset:   1:cd2a86ecc814
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change a
+  
+  $ cat clone/.hg/hgrc
+  [paths]
+  default = .*/repo#foo
 
-echo '% outgoing'
-hg -q outgoing '../clone#foo'
-echo
+Changing original repo:
 
-echo '% push'
-hg -q push '../clone#foo'
-hg --cwd ../clone heads
-cd ..
-echo
+  $ cd repo
 
-echo '% rolling back'
-cd clone
-hg rollback
+  $ echo >> a
+  $ hg ci -m 'new head of branch foo'
 
-echo '% incoming'
-hg -q incoming
+  $ hg up -qC default
+  $ echo bar > bar
+  $ hg ci -qAm 'add bar'
 
-echo '% pull'
-hg -q pull
-hg heads
-echo
+  $ hg log
+  changeset:   3:4cd725637392
+  tag:         tip
+  parent:      0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  changeset:   2:faba9097cad4
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  changeset:   1:cd2a86ecc814
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change a
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+  $ hg -q outgoing '../clone#foo'
+  2:faba9097cad4
 
-echo '% pull should not have updated'
-hg parents -q
-echo '% going back to the default branch'
-hg up -C 0
-hg parents
-echo '% no new revs, no update'
-hg pull -qu
-hg parents -q
-echo '% rollback'
-hg rollback
-hg up -C 0
-hg parents -q
-echo '% pull -u takes us back to branch foo'
-hg pull -qu
-hg parents
+  $ hg -q push '../clone#foo'
 
-echo '% rollback'
-hg rollback
-hg up -C 0
-echo '% parents'
-hg parents -q
-echo '% heads'
-hg heads -q
-echo '% pull -u -r otherrev url#rev updates to rev'
-hg pull -qur default default
-echo '% parents'
-hg parents
-echo '% heads'
-hg heads
+  $ hg --cwd ../clone heads
+  changeset:   2:faba9097cad4
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+  $ cd ..
 
+  $ cd clone
+  $ hg rollback
+  rolling back to revision 1 (undo push)
+
+  $ hg -q incoming
+  2:faba9097cad4
+
+  $ hg -q pull
+
+  $ hg heads
+  changeset:   2:faba9097cad4
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+Pull should not have updated:
+
+  $ hg parents -q
+  1:cd2a86ecc814
+
+Going back to the default branch:
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg parents
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+No new revs, no update:
+
+  $ hg pull -qu
+
+  $ hg parents -q
+  0:1f0dee641bb7
+
+  $ hg rollback
+  rolling back to revision 1 (undo pull)
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg parents -q
+  0:1f0dee641bb7
+
+Pull -u takes us back to branch foo:
+
+  $ hg pull -qu
+
+  $ hg parents
+  changeset:   2:faba9097cad4
+  branch:      foo
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+  $ hg rollback
+  rolling back to revision 1 (undo pull)
+
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+  $ hg parents -q
+  0:1f0dee641bb7
+
+  $ hg heads -q
+  1:cd2a86ecc814
+  0:1f0dee641bb7
+
+  $ hg pull -qur default default
+
+  $ hg parents
+  changeset:   3:4cd725637392
+  tag:         tip
+  parent:      0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  $ hg heads
+  changeset:   3:4cd725637392
+  tag:         tip
+  parent:      0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add bar
+  
+  changeset:   2:faba9097cad4
+  branch:      foo
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     new head of branch foo
+  
+


More information about the Mercurial-devel mailing list