Mercurial > hg
changeset 12300:ca31b0b2ac16
tests: unify test-url-rev
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Tue, 14 Sep 2010 16:42:02 +0200 |
parents | a73684df0f8a |
children | 3a082866422a |
files | tests/test-url-rev tests/test-url-rev.out tests/test-url-rev.t |
diffstat | 3 files changed, 206 insertions(+), 231 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-url-rev Tue Sep 14 15:37:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -#!/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 .. - -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 - -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 - -echo '% outgoing' -hg -q outgoing '../clone#foo' -echo - -echo '% push' -hg -q push '../clone#foo' -hg --cwd ../clone heads -cd .. -echo - -echo '% rolling back' -cd clone -hg rollback - -echo '% incoming' -hg -q incoming - -echo '% pull' -hg -q pull -hg heads -echo - -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 - -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 -
--- a/tests/test-url-rev.out Tue Sep 14 15:37:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -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 -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-url-rev.t Tue Sep 14 16:42:02 2010 +0200 @@ -0,0 +1,206 @@ +# test basic functionality of url#rev syntax + + $ 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 .. + + $ 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 + + $ 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 + +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 + 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 + + $ hg -q push '../clone#foo' + + $ 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 + +