[PATCH 1 of 4] largefiles: testcase to simulate inter-user clone on local machine

Benjamin Pollack benjamin at bitquabit.com
Thu Oct 20 12:24:55 CDT 2011


# HG changeset patch
# User Eli Carter <eli.carter at tektronix.com>
# Date 1319121337 18000
# Branch stable
# Node ID d6a2b30a5952e9b5def411e763ba9c12928d55e7
# Parent  a4a6d5fc4b48261f73f91148c0465ffc9033f238
largefiles: testcase to simulate inter-user clone on local machine

diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -701,3 +701,32 @@
   $ cd ..
   $ rm -rf bigfile-repo largefiles-repo
 
+Clone a local repository owned by another user
+We have to simulate that here by setting $HOME and removing write permissions
+  $ ORIGHOME="$HOME"
+  $ mkdir alice
+  $ HOME="`pwd`/alice"
+  $ cd alice
+  $ hg init pubrepo
+  $ cd pubrepo
+  $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null
+  $ hg add --large a-large-file
+  $ hg commit -m "Add a large file"
+  $ cd ..
+  $ chmod -R a-w pubrepo
+  $ cd ..
+  $ mkdir bob
+  $ HOME="`pwd`/bob"
+  $ cd bob
+  $ hg clone ../alice/pubrepo pubrepo
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cd ..
+  $ HOME="$ORIGHOME"


More information about the Mercurial-devel mailing list