Mercurial > hg > hg-git
changeset 581:52461f71a782
tests: convert echos to comments
Now that we're in the unified test format, there isn't a need to use echo
to provide context to command output. This technique actually ends up resulting
in redundant output. To preserve the original context, but eliminate the
redundancy, such echo statements have been converted into comment lines.
author | David M. Carr <david@carrclan.us> |
---|---|
date | Sat, 03 Nov 2012 19:14:17 -0400 |
parents | 6cc99298b69e |
children | 819e46cffc84 |
files | tests/test-clone.t tests/test-conflict-1.t tests/test-conflict-2.t tests/test-convergedmerge.t tests/test-file-removal.t tests/test-git-clone.t tests/test-git-submodules.t tests/test-git-workflow.t tests/test-hg-tags.t tests/test-incoming.t tests/test-merge.t tests/test-outgoing.t tests/test-pull-after-strip.t tests/test-push.t tests/test-subrepos.t |
diffstat | 15 files changed, 41 insertions(+), 99 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -18,8 +18,7 @@ $ cd .. - $ echo % clone a tag - % clone a tag +clone a tag $ hg clone -r alpha gitrepo hgrepo-a | grep -v '^updating' importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -32,8 +31,7 @@ date: Mon Jan 01 00:00:10 2007 +0000 summary: add alpha - $ echo % clone a branch - % clone a branch +clone a branch $ hg clone -r beta gitrepo hgrepo-b | grep -v '^updating' importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-conflict-1.t +++ b/tests/test-conflict-1.t @@ -55,8 +55,7 @@ $ hg clone gitrepo hgrepo2 | grep -v '^updating' importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ echo % expect the same revision ids as above - % expect the same revision ids as above +expect the same revision ids as above $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g' @ 3:1,2 6c53bc0f062f 1970-01-01 00:00 +0000 test |\ merge to C
--- a/tests/test-conflict-2.t +++ b/tests/test-conflict-2.t @@ -55,8 +55,7 @@ $ hg clone gitrepo hgrepo2 | grep -v '^updating' importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ echo % expect the same revision ids as above - % expect the same revision ids as above +expect the same revision ids as above $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g' @ 3:1,2 120385945d08 1970-01-01 00:00 +0000 test |\ merge to B
--- a/tests/test-convergedmerge.t +++ b/tests/test-convergedmerge.t @@ -56,8 +56,7 @@ $ hg clone gitrepo hgrepo2 | grep -v '^updating' importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ echo % expect the same revision ids as above - % expect the same revision ids as above +expect the same revision ids as above $ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g' @ 4:1,3 eaa21d002113 1970-01-01 00:00 +0000 test |\ merge
--- a/tests/test-file-removal.t +++ b/tests/test-file-removal.t @@ -20,8 +20,7 @@ $ git rm foo/bar rm 'foo/bar' $ fn_git_commit -m 'remove foo/bar' - $ echo % final manifest in git is just beta - % final manifest in git is just beta +final manifest in git is just beta $ git ls-files beta @@ -62,18 +61,12 @@ summary: add alpha - $ echo - - $ echo % make sure alpha is not in this manifest - % make sure alpha is not in this manifest +make sure alpha is not in this manifest $ hg manifest -r 3 beta foo/bar - $ echo - - $ echo % make sure that only beta is in the manifest - % make sure that only beta is in the manifest +make sure that only beta is in the manifest $ hg manifest beta
--- a/tests/test-git-clone.t +++ b/tests/test-git-clone.t @@ -30,7 +30,6 @@ summary: add alpha - $ echo % we should have some bookmarks - % we should have some bookmarks +we should have some bookmarks $ hg -R hgrepo book * master 1:7bcd915dc873
--- a/tests/test-git-submodules.t +++ b/tests/test-git-submodules.t @@ -71,7 +71,6 @@ summary: add alpha - $ echo % we should have some bookmarks - % we should have some bookmarks +we should have some bookmarks $ hg -R hgrepo book * master 2:76fda365fbbb
--- a/tests/test-git-workflow.t +++ b/tests/test-git-workflow.t @@ -23,8 +23,7 @@ $ cd .. - $ echo % configure for use from git - % configure for use from git +configure for use from git $ hg clone hgrepo gitrepo updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -36,8 +35,7 @@ $ echo "intree = True" >> .hg/hgrc $ hg gexport - $ echo % do some work - % do some work +do some work $ git config core.bare false $ git checkout master 2>&1 | sed s/\'/\"/g Already on "master" @@ -45,8 +43,7 @@ $ git add beta $ fn_git_commit -m 'add beta' - $ echo % get things back to hg - % get things back to hg +get things back to hg $ hg gimport importing git objects into hg $ hg log --graph --debug | grep -v ': *master' | grep -v phase: @@ -75,7 +72,6 @@ add alpha - $ echo % gimport should have updated the bookmarks as well - % gimport should have updated the bookmarks as well +gimport should have updated the bookmarks as well $ hg bookmarks master 1:7108ae7bd184
--- a/tests/test-hg-tags.t +++ b/tests/test-hg-tags.t @@ -41,8 +41,7 @@ $ cd .. $ cd gitrepo - $ echo % git should have the tag alpha - % git should have the tag alpha +git should have the tag alpha $ git tag -l alpha @@ -66,7 +65,6 @@ summary: add alpha - $ echo % the tag should be in .hgtags - % the tag should be in .hgtags +the tag should be in .hgtags $ cat hgrepo2/.hgtags 3442585be8a60c6cd476bbc4e45755339f2a23ef alpha
--- a/tests/test-incoming.t +++ b/tests/test-incoming.t @@ -86,8 +86,7 @@ +gamma 2 - $ echo % incoming -r - % incoming -r +incoming -r $ hg incoming -r master | grep -v 'no changes found' | grep -v 'bookmark:' comparing with $TESTTMP/gitrepo changeset: 1:9497a4ee62e1 @@ -117,8 +116,7 @@ summary: add d/gamma - $ echo % nothing incoming after pull - % nothing incoming after pull +nothing incoming after pull "adding remote bookmark" message was added in Mercurial 2.3 $ hg pull | grep -v "adding remote bookmark" pulling from $TESTTMP/gitrepo @@ -126,6 +124,3 @@ (run 'hg heads' to see heads, 'hg merge' to merge) $ hg incoming | grep -v 'no changes found' | grep -v 'bookmark:' comparing with $TESTTMP/gitrepo - - $ echo 'done' - done
--- a/tests/test-merge.t +++ b/tests/test-merge.t @@ -36,8 +36,7 @@ 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd hgrepo - $ echo % clear the cache to be sure it is regenerated correctly - % clear the cache to be sure it is regenerated correctly +clear the cache to be sure it is regenerated correctly $ hg gclear clearing out the git cache data $ hg push ../gitrepo2 @@ -45,8 +44,7 @@ searching for changes $ cd .. - $ echo % git log in repo pushed from hg - % git log in repo pushed from hg +git log in repo pushed from hg $ git --git-dir=gitrepo2 log --pretty=medium master | sed 's/\.\.\.//g' commit 5806851511aaf3bfe813ae3a86c5027165fa9b96 Merge: e5023f9 9497a4e
--- a/tests/test-outgoing.t +++ b/tests/test-outgoing.t @@ -71,8 +71,7 @@ $ cd .. - $ echo % some more work on master from git - % some more work on master from git +some more work on master from git $ cd gitrepo Check state of refs after outgoing @@ -89,14 +88,12 @@ $ cd .. $ cd hgrepo - $ echo % this will fail # maybe we should try to make it work - % this will fail +this will fail # maybe we should try to make it work $ hg outgoing comparing with */gitrepo (glob) abort: refs/heads/master changed on the server, please pull and merge before pushing [255] - $ echo % let\'s pull and try again - % let's pull and try again +let's pull and try again $ hg pull 2>&1 | grep -v 'divergent bookmark' pulling from */gitrepo (glob) importing git objects into hg
--- a/tests/test-pull-after-strip.t +++ b/tests/test-pull-after-strip.t @@ -29,8 +29,7 @@ $ cd .. - $ echo % clone a tag - % clone a tag +clone a tag $ hg clone -r alpha gitrepo hgrepo-a | grep -v '^updating' importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -43,8 +42,7 @@ date: Mon Jan 01 00:00:10 2007 +0000 summary: add alpha - $ echo % clone a branch - % clone a branch +clone a branch $ hg clone -r beta gitrepo hgrepo-b | grep -v '^updating' importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -79,8 +77,7 @@ [255] $ hg git-cleanup git commit map cleaned - $ echo % pull works after \'hg git-cleanup\' - % pull works after 'hg git-cleanup' +pull works after 'hg git-cleanup' "adding remote bookmark" message was added in Mercurial 2.3 $ hg pull -r beta | grep -v "adding remote bookmark" pulling from $TESTTMP/gitrepo
--- a/tests/test-push.t +++ b/tests/test-push.t @@ -32,16 +32,14 @@ $ cd .. - $ echo % should have two different branches - % should have two different branches +should have two different branches $ cd gitrepo $ git branch -v beta cffa0e8 add beta master 7eeab2e add alpha * not-master 7eeab2e add alpha - $ echo % some more work on master from git - % some more work on master from git +some more work on master from git $ git checkout master 2>&1 | sed s/\'/\"/g Switched to branch "master" $ echo delta > delta @@ -53,16 +51,14 @@ $ cd .. $ cd hgrepo - $ echo % this should fail - % this should fail +this should fail $ hg push -r master pushing to $TESTTMP/gitrepo searching for changes abort: refs/heads/master changed on the server, please pull and merge before pushing [255] - $ echo % ... even with -f - % ... even with -f +... even with -f $ hg push -fr master pushing to $TESTTMP/gitrepo searching for changes @@ -76,8 +72,7 @@ TODO shouldn't need to do this since we're (in theory) pushing master explicitly, which should not implicitly also push the not-master ref. $ hg book not-master -r default/not-master --force - $ echo % master and default/master should be diferent - % master and default/master should be diferent +master and default/master should be diferent $ hg log -r master | grep -v ': *master' changeset: 2:72f56395749d user: test @@ -94,22 +89,19 @@ summary: add delta - $ echo % this should also fail - % this should also fail +this should also fail $ hg push -r master pushing to $TESTTMP/gitrepo searching for changes abort: pushing refs/heads/master overwrites 72f56395749d [255] - $ echo % ... but succeed with -f - % ... but succeed with -f +... but succeed with -f $ hg push -fr master pushing to $TESTTMP/gitrepo searching for changes - $ echo % this should fail, no changes to push - % this should fail, no changes to push +this should fail, no changes to push The exit code for this was broken in Mercurial (incorrectly returning 0) until issue3228 was fixed in 2.1 $ hg push -r master && false
--- a/tests/test-subrepos.t +++ b/tests/test-subrepos.t @@ -27,10 +27,7 @@ allow commits despite working copy presense $ git config receive.denyCurrentBranch ignore $ cd .. - $ echo - - $ echo % Ensure gitlinks are transformed to .hgsubstate on hg pull from git - % Ensure gitlinks are transformed to .hgsubstate on hg pull from git +Ensure gitlinks are transformed to .hgsubstate on hg pull from git $ hg clone gitrepo1 hgrepo importing git objects into hg updating to branch default @@ -40,27 +37,20 @@ $ cd hgrepo $ hg bookmarks -f -r default master 1. Ensure gitlinks are transformed to .hgsubstate on hg <- git pull - $ echo % .hgsub shall list two [git] subrepos - % .hgsub shall list two [git] subrepos +.hgsub shall list two [git] subrepos $ cat .hgsub subrepo1 = [git]../gitsubrepo xyz/subrepo2 = [git]../gitsubrepo - $ echo % .hgsubstate shall list two idenitcal revisions - % .hgsubstate shall list two idenitcal revisions +.hgsubstate shall list two idenitcal revisions $ cat .hgsubstate 56f0304c5250308f14cfbafdc27bd12d40154d17 subrepo1 56f0304c5250308f14cfbafdc27bd12d40154d17 xyz/subrepo2 - $ echo % hg status shall NOT report .hgsub and .hgsubstate as untracked - either ignored or unmodified - % hg status shall NOT report .hgsub and .hgsubstate as untracked - either ignored or unmodified +hg status shall NOT report .hgsub and .hgsubstate as untracked - either ignored or unmodified $ hg status --unknown .hgsub .hgsubstate $ hg status --modified .hgsub .hgsubstate $ cd .. - $ echo - 2. Check gitmodules are preserved during hg -> git push - $ echo % Check gitmodules are preserved during hg push to git - % Check gitmodules are preserved during hg push to git $ cd gitsubrepo $ echo gamma > gamma $ git add gamma @@ -84,8 +74,7 @@ searching for changes $ cd .. $ cd gitrepo1 - $ echo % there shall be two gitlink entries, with values matching that in .hgsubstate - % there shall be two gitlink entries, with values matching that in .hgsubstate +there shall be two gitlink entries, with values matching that in .hgsubstate $ git ls-tree -r HEAD^{tree} | grep 'commit' 160000 commit 56f0304c5250308f14cfbafdc27bd12d40154d17 subrepo1 160000 commit aabf7cd015089aff0b84596e69aa37b24a3d090a xyz/subrepo2 @@ -93,12 +82,8 @@ $ git reset --hard HEAD is now at 4663c49 Update subrepo2 from hg $ cd .. - $ echo - 3. Check .hgsub and .hgsubstate from git repository are merged, not overwritten - $ echo Check .hgsub and .hgsubstate from git repository are merged, not overwritten - Check .hgsub and .hgsubstate from git repository are merged, not overwritten $ hg init hgsub $ cd hgsub $ echo delta > delta @@ -118,14 +103,12 @@ cloning subrepo hgsub from $TESTTMP/hgsub 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. - $ echo % pull shall bring .hgsub entry which was added to the git repo - % pull shall bring .hgsub entry which was added to the git repo +pull shall bring .hgsub entry which was added to the git repo $ cat hgrepo/.hgsub hgsub = $TESTTMP/hgsub subrepo1 = [git]../gitsubrepo xyz/subrepo2 = [git]../gitsubrepo - $ echo % .hgsubstate shall list revision of the subrepo added through git repo - % .hgsubstate shall list revision of the subrepo added through git repo +.hgsubstate shall list revision of the subrepo added through git repo $ cat hgrepo/.hgsubstate 481ec30d580f333ae3a77f94c973ce37b69d5bda hgsub 56f0304c5250308f14cfbafdc27bd12d40154d17 subrepo1