Mercurial > hg
changeset 12253:e5aee120287b
tests: unify test-manifest*
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Fri, 10 Sep 2010 23:13:59 +0200 |
parents | 20f011311212 |
children | 852f10a15a6d |
files | tests/test-manifest tests/test-manifest-merging tests/test-manifest-merging.out tests/test-manifest-merging.t tests/test-manifest.out tests/test-manifest.t |
diffstat | 6 files changed, 105 insertions(+), 106 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-manifest Sat Sep 11 16:17:43 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -#!/bin/sh - -# Source bundle was generated with the following script. -# -# hg init -# echo a > a -# ln -s a l -# hg ci -Ama -d'0 0' -# mkdir b -# echo a > b/a -# chmod +x b/a -# hg ci -Amb -d'1 0' - -hg init -hg -q pull "$TESTDIR/test-manifest.hg" - -echo % should be empty -hg manifest - -hg co -hg manifest -hg manifest -v -hg manifest --debug -hg manifest -r 0 -hg manifest -r 1 -hg manifest -r tip - -echo % should fail -hg manifest -r 2 -hg manifest -r tip tip - -hg manifest tip
--- a/tests/test-manifest-merging Sat Sep 11 16:17:43 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#!/bin/sh - -echo % init foo-base -hg init foo-base - -echo % create alpha in first repo -cd foo-base -echo 'alpha' > alpha -hg ci -A -m 'add alpha' -d '1 0' -cd .. - -echo % clone foo-base to foo-work -hg clone foo-base foo-work - -echo % create beta in second repo -cd foo-work -echo 'beta' > beta -hg ci -A -m 'add beta' -d '2 0' -cd .. - -echo % create gamma in first repo -cd foo-base -echo 'gamma' > gamma -hg ci -A -m 'add gamma' -d '3 0' -cd .. - -echo % pull into work and merge -cd foo-work -hg pull -q -hg merge - -echo % revert to changeset 1 to simulate a failed merge -rm alpha beta gamma -hg up -C 1
--- a/tests/test-manifest-merging.out Sat Sep 11 16:17:43 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -% init foo-base -% create alpha in first repo -adding alpha -% clone foo-base to foo-work -updating to branch default -1 files updated, 0 files merged, 0 files removed, 0 files unresolved -% create beta in second repo -adding beta -% create gamma in first repo -adding gamma -% pull into work and merge -1 files updated, 0 files merged, 0 files removed, 0 files unresolved -(branch merge, don't forget to commit) -% revert to changeset 1 to simulate a failed merge -2 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-manifest-merging.t Fri Sep 10 23:13:59 2010 +0200 @@ -0,0 +1,36 @@ + $ hg init base + + $ cd base + $ echo 'alpha' > alpha + $ hg ci -A -m 'add alpha' + adding alpha + $ cd .. + + $ hg clone base work + updating to branch default + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + + $ cd work + $ echo 'beta' > beta + $ hg ci -A -m 'add beta' + adding beta + $ cd .. + + $ cd base + $ echo 'gamma' > gamma + $ hg ci -A -m 'add gamma' + adding gamma + $ cd .. + + $ cd work + $ hg pull -q + $ hg merge + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + +Update --clean to revision 1 to simulate a failed merge: + + $ rm alpha beta gamma + $ hg update --clean 1 + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved +
--- a/tests/test-manifest.out Sat Sep 11 16:17:43 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -% should be empty -3 files updated, 0 files merged, 0 files removed, 0 files unresolved -a -b/a -l -644 a -755 * b/a -644 @ l -b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a -b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a -047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l -a -l -a -b/a -l -a -b/a -l -% should fail -abort: unknown revision '2'! -abort: please specify just one revision -a -b/a -l
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-manifest.t Fri Sep 10 23:13:59 2010 +0200 @@ -0,0 +1,69 @@ +# Source bundle was generated with the following script. +# +# hg init +# echo a > a +# ln -s a l +# hg ci -Ama -d'0 0' +# mkdir b +# echo a > b/a +# chmod +x b/a +# hg ci -Amb -d'1 0' + + $ hg init + $ hg -q pull "$TESTDIR/test-manifest.hg" + + +The next call is expected to return nothing: + + $ hg manifest + + + $ hg co + 3 files updated, 0 files merged, 0 files removed, 0 files unresolved + + $ hg manifest + a + b/a + l + + $ hg manifest -v + 644 a + 755 * b/a + 644 @ l + + $ hg manifest --debug + b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a + b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a + 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l + + $ hg manifest -r 0 + a + l + + $ hg manifest -r 1 + a + b/a + l + + $ hg manifest -r tip + a + b/a + l + + $ hg manifest tip + a + b/a + l + + +The next two calls are expected to abort: + + $ hg manifest -r 2 + abort: unknown revision '2'! + + $ hg manifest -r tip tip + abort: please specify just one revision + + + $ true +