Patchwork [4,of,4,V2] schemas: add tests to cover schema transmission

login
register
mail settings
Submitter Durham Goode
Date Aug. 8, 2013, 11:31 p.m.
Message ID <bec5b841f08e4b372545.1376004708@dev350.prn1.facebook.com>
Download mbox | patch
Permalink /patch/2100/
State Deferred
Headers show

Comments

Durham Goode - Aug. 8, 2013, 11:31 p.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1375827639 25200
#      Tue Aug 06 15:20:39 2013 -0700
# Node ID bec5b841f08e4b372545a97d31818fba3dfaec23
# Parent  104bd137ee26983d7ea77ffbc5e265657c21365c
schemas: add tests to cover schema transmission

Adds tests for how schema transmission happens during clone and pull.

Patch

diff --git a/tests/test-schemas.t b/tests/test-schemas.t
new file mode 100644
--- /dev/null
+++ b/tests/test-schemas.t
@@ -0,0 +1,43 @@ 
+  $ hg init one
+  $ cd one
+
+  $ echo a > a
+  $ hg add a
+  $ hg commit -ma
+  $ echo "test = test:foo" >> .hg/schemas
+  $ cd ..
+
+# Schemas are transmitted on clone
+
+  $ hg clone -q one two
+  $ cd two
+  $ cat .hg/schemas
+  test = test:foo
+
+# Schemas are updated on pull
+
+  $ echo "test2 = test:bar" >> ../one/.hg/schemas
+  $ hg pull -q
+  $ cat .hg/schemas
+  test = test:foo
+  test2 = test:bar
+
+# Existing schemas are not deleted if remote doesn't have them
+
+  $ echo "test3 = test:zoo" > ../one/.hg/schemas
+  $ hg pull -q
+  $ cat .hg/schemas
+  test = test:foo
+  test3 = test:zoo
+  test2 = test:bar
+
+# Empty schema is ok
+
+  $ rm ../one/.hg/schemas
+  $ hg pull -q
+  $ cat .hg/schemas
+  test = test:foo
+  test3 = test:zoo
+  test2 = test:bar
+
+  $ cd ..