[PATCH 2 of 3 STABLE] tests: use -f when clearing largefile usercache

Matt Harbison matt_harbison at yahoo.com
Mon Oct 22 23:04:11 CDT 2012


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1350962187 14400
# Branch stable
# Node ID a233e59d55e75f810488a0c94ff2e1e17696ba23
# Parent  6269e84db360cec75cb70982079f84fba4e9bf21
tests: use -f when clearing largefile usercache

A subsequent test will cause an rm without -f to report an error, so all uses
were converted to avoid future issues like this.

diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -700,7 +700,7 @@
 
 Test cloning with --all-largefiles flag
 
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ hg clone --all-largefiles a a-backup
   updating to branch default
   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -708,7 +708,7 @@
   3 largefiles updated, 0 removed
   8 additional largefiles cached
 
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ hg clone --all-largefiles -u 0 a a-clone0
   updating to branch default
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -722,7 +722,7 @@
   commit: (clean)
   update: 7 new changesets (update)
 
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ hg clone --all-largefiles -u 1 a a-clone1
   updating to branch default
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -736,7 +736,7 @@
   commit: (clean)
   update: 6 new changesets (update)
 
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ hg clone --all-largefiles -U a a-clone-u
   11 additional largefiles cached
   $ hg -R a-clone-u sum
@@ -779,7 +779,7 @@
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ cd a-backup
   $ hg pull --all-largefiles --config paths.default-push=bogus/path
   pulling from $TESTTMP/a (glob)
@@ -1072,7 +1072,7 @@
   3 largefiles updated, 0 removed
 # Delete the largefiles in the largefiles system cache so that we have an
 # opportunity to test that caching after a pull works.
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ cd f
   $ echo "large4-merge-test" > sub/large4
   $ hg commit -m "Modify large4 to test merge"
@@ -1190,7 +1190,7 @@
   normal3-modified
   $ hg cat sub/large4
   large4-modified
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ hg cat -r a381d2c8c80e -o cat.out sub/large4
   $ cat cat.out
   large4-modified
@@ -1391,7 +1391,7 @@
   $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
   >   --config 'web.allow_push=*' --config web.push_ssl=False
   $ cat hg.pid >> $DAEMON_PIDS
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ hg push -R r8 http://localhost:$HGPORT2
   pushing to http://localhost:$HGPORT2/
   searching for changes
diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t
--- a/tests/test-lfconvert.t
+++ b/tests/test-lfconvert.t
@@ -319,13 +319,13 @@
 
 Ensure the largefile can be cached in the source if necessary
   $ hg clone -U largefiles-repo issue3519
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ hg lfconvert --to-normal issue3519 normalized3519
   initializing destination normalized3519
 
 Ensure the abort message is useful if a largefile is entirely unavailable
   $ rm -rf normalized3519
-  $ rm "${USERCACHE}"/*
+  $ rm -f "${USERCACHE}"/*
   $ rm issue3519/.hg/largefiles/*
   $ rm largefiles-repo/.hg/largefiles/*
   $ hg lfconvert --to-normal issue3519 normalized3519


More information about the Mercurial-devel mailing list