changeset 6160:3ee3bc5d06c5

tests: hide the name of the branch cache file
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 21 Feb 2008 16:22:31 -0300
parents bc784304fea1
children bc1ba9124799
files tests/test-inherit-mode tests/test-inherit-mode.out tests/test-mq-caches tests/test-mq-caches.out tests/test-newbranch
diffstat 5 files changed, 16 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-inherit-mode	Thu Feb 21 16:22:31 2008 -0300
+++ b/tests/test-inherit-mode	Thu Feb 21 16:22:31 2008 -0300
@@ -54,7 +54,7 @@
 echo '% after commit'
 echo '% working dir files can only be written by the owner'
 echo '% files created in .hg can be written by the group'
-echo '% (in particular, store/**, dirstate, branch.cache, undo files)'
+echo '% (in particular, store/**, dirstate, branch cache file, undo files)'
 echo '% new directories are setgid'
 python ../printmodes.py .
 
--- a/tests/test-inherit-mode.out	Thu Feb 21 16:22:31 2008 -0300
+++ b/tests/test-inherit-mode.out	Thu Feb 21 16:22:31 2008 -0300
@@ -9,7 +9,7 @@
 % after commit
 % working dir files can only be written by the owner
 % files created in .hg can be written by the group
-% (in particular, store/**, dirstate, branch.cache, undo files)
+% (in particular, store/**, dirstate, branch cache file, undo files)
 % new directories are setgid
 00700 ./.hg/
 00600 ./.hg/00changelog.i
--- a/tests/test-mq-caches	Thu Feb 21 16:22:31 2008 -0300
+++ b/tests/test-mq-caches	Thu Feb 21 16:22:31 2008 -0300
@@ -1,18 +1,18 @@
 #!/bin/sh
 
+branches=.hg/branch.cache
 echo '[extensions]' >> $HGRCPATH
 echo 'hgext.mq=' >> $HGRCPATH
 
 show_branch_cache()
 {
-    branches=.hg/branch.cache
     # force cache (re)generation
     hg log -r does-not-exist 2> /dev/null
     hg log -r tip --template 'tip: #rev#\n'
     if [ -f $branches ]; then
 	sort $branches
     else
-	echo No $branches
+	echo No branch cache
     fi
     if [ "$1" = 1 ]; then
 	for b in foo bar; do
@@ -61,7 +61,7 @@
 
 echo
 echo '# removing the cache'
-rm .hg/branch.cache
+rm $branches
 show_branch_cache 1
 
 echo
--- a/tests/test-mq-caches.out	Thu Feb 21 16:22:31 2008 -0300
+++ b/tests/test-mq-caches.out	Thu Feb 21 16:22:31 2008 -0300
@@ -1,8 +1,8 @@
 # mq patch on an empty repo
 tip: 0
-No .hg/branch.cache
+No branch cache
 tip: 0
-No .hg/branch.cache
+No branch cache
 
 # some regular revisions
 Patch queue now empty
--- a/tests/test-newbranch	Thu Feb 21 16:22:31 2008 -0300
+++ b/tests/test-newbranch	Thu Feb 21 16:22:31 2008 -0300
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+branchcache=.hg/branch.cache
+
 hg init t
 cd t
 hg branches
@@ -32,23 +34,23 @@
 
 echo % test for invalid branch cache
 hg rollback
-cp .hg/branch.cache .hg/bc-invalid
+cp $branchcache .hg/bc-invalid
 hg log -r foo
-cp .hg/bc-invalid .hg/branch.cache
+cp .hg/bc-invalid $branchcache
 hg --debug log -r foo
-rm .hg/branch.cache
-echo corrupted > .hg/branch.cache
+rm $branchcache
+echo corrupted > $branchcache
 hg log -qr foo
-cat .hg/branch.cache
+cat $branchcache
 
 echo % push should update the branch cache
 hg init ../target
 echo % pushing just rev 0
 hg push -qr 0 ../target
-cat ../target/.hg/branch.cache
+cat ../target/$branchcache
 echo % pushing everything
 hg push -qf ../target
-cat ../target/.hg/branch.cache
+cat ../target/$branchcache
 
 echo % update with no arguments: tipmost revision of the current branch
 hg up -q -C 0