[PATCH] largefiles: test interaction between largefiles and vanilla clients and servers

Andrew Pritchard awpritchard at gmail.com
Fri Oct 21 15:47:14 CDT 2011


# HG changeset patch
# User Andrew Pritchard <awpritchard at gmail.com>
# Date 1319227773 18000
# Node ID 425045145a47bb86133334a3b15853f0dc1b20bb
# Parent  d4addef0ec74370fbf75b138d06f8ad93d3038ff
largefiles: test interaction between largefiles and vanilla clients and servers

This reintroduces tests for the case described by issue3066, among others:
- vanilla clients and servers should still be able to talk to largefiles
  clients and servers about vanilla repos
- vanilla clients should not attempt to clone largefiles repos over http and
  should report a useful error message (issue3066; this appears to work
  correctly)
- vanilla clients should not attempt to clone largefiles repos over ssh, again
  with a useful error message
- largefiles clients should not attempt to push largefile changes to vanilla
  servers

diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -443,3 +443,92 @@
   large6-modified
   $ cat sub2/large7
   large7
+  $ cd ..
+
+vanilla clients not locked out from largefiles servers on vanilla repos
+  $ mkdir r1
+  $ cd r1
+  $ hg init
+  $ echo c1 > f1
+  $ hg add f1
+  $ hg com -m "m1"
+  $ cd ..
+  $ hg serve -R r1 -d -p 8001 --pid-file serve.pid
+  $ hg --config extensions.largefiles=! clone http://localhost:8001 r2
+  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
+  $ kill $(cat serve.pid)
+
+largefiles clients still work with vanilla servers
+  $ hg --config extensions.largefiles=! serve -R r1 -d -p 8001 --pid-file serve.pid
+  $ hg clone http://localhost:8001 r3
+  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
+  $ kill $(cat serve.pid)
+
+vanilla clients locked out from largefiles http repos
+  $ mkdir r4
+  $ cd r4
+  $ hg init
+  $ echo c1 > f1
+  $ hg add --large f1
+  $ hg com -m "m1"
+  $ cd ..
+  $ hg serve -R r4 -d -p 8001 --pid-file serve.pid
+  $ hg --config extensions.largefiles=! clone http://localhost:8001 r5
+  abort: remote error:
+  
+  This repository uses the largefiles extension.
+  
+  Please enable it in your Mercurial config file.
+  [255]
+  $ kill $(cat serve.pid)
+
+vanilla clients locked out from largefiles ssh repos
+  $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5
+  abort: remote error:
+  
+  This repository uses the largefiles extension.
+  
+  Please enable it in your Mercurial config file.
+  [255]
+
+largefiles clients refuse to push largefiles repos to vanilla servers
+  $ mkdir r6
+  $ cd r6
+  $ hg init
+  $ echo c1 > f1
+  $ hg add f1
+  $ hg com -m "m1"
+  $ cat >> .hg/hgrc <<!
+  > [web]
+  > push_ssl = false
+  > allow_push = *
+  > !
+  $ cd ..
+  $ hg clone r6 r7
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd r7
+  $ echo c2 > f2
+  $ hg add --large f2
+  $ hg com -m "m2"
+  $ hg --config extensions.largefiles=! -R ../r6 serve -d -p 8001 --pid-file ../serve.pid
+  $ hg push http://localhost:8001
+  pushing to http://localhost:8001/
+  searching for changes
+  abort: ('%s does not appear to be a largefile store', 'http://localhost:8001/')
+  [255]
+  $ cd ..
+  $ kill $(cat serve.pid)
+


More information about the Mercurial-devel mailing list