[PATCH 2 of 2] largefiles: test a push from a local repository to a remote one

Hao Lian hao at fogcreek.com
Thu Nov 3 10:02:58 CDT 2011


# HG changeset patch
# User Hao Lian <hao at fogcreek.com>
# Date 1320332406 14400
# Branch stable
# Node ID c42e75c6b58ec075cf0126d287fc44288e68b88f
# Parent  9ff44ce93d70ec8fc47e2cf56c7453e0fe58e847
largefiles: test a push from a local repository to a remote one

This patch tests two version of that push: one with a cache miss (against the
user cache $CACHE) and one with a cache hit. Server-side errors will be detected
when the serve logs, which should be empty, are printed to stdout.

diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -818,6 +818,54 @@
   $ cd ..
   $ HOME="$ORIGHOME"
 
+Push to a remote repository and then to another one
+We start with an empty cache directory.
+  $ CACHE="$TESTTMP/cache"
+  $ mkdir $CACHE
+  $ cd alice
+  $ hg init remoterepo1
+  $ hg init remoterepo2
+  $ cat >> remoterepo1/.hg/hgrc <<!
+  > [web]
+  > push_ssl = false
+  > allow_push = *
+  > !
+  $ cat >> remoterepo2/.hg/hgrc <<!
+  > [web]
+  > push_ssl = false
+  > allow_push = *
+  > !
+  $ hg serve -E err1.log -R remoterepo1 -d -p 8001 --pid-file serve1.pid --config largefiles.usercache=$CACHE
+  $ hg serve -E err2.log -R remoterepo2 -d -p 8002 --pid-file serve2.pid --config largefiles.usercache=$CACHE
+  $ cd pubrepo
+
+  $ hg push http://localhost:8001/
+  pushing to http://localhost:8001/
+  searching for changes
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+
+Now we have a primed cache.
+  $ hg push http://localhost:8002/
+  pushing to http://localhost:8002/
+  searching for changes
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+
+Clean up.
+  $ cd ..
+  $ cat err1.log
+  $ cat err2.log
+  $ kill $(cat serve1.pid)
+  $ kill $(cat serve2.pid)
+  $ cd ..
+
 Symlink to a large largefile should behave the same as a symlink to a normal file
   $ hg init largesymlink
   $ cd largesymlink


More information about the Mercurial-devel mailing list