[PATCH 4 of 4] schemas: add tests to cover schema transmission

Durham Goode durham at fb.com
Wed Aug 7 00:28:29 UTC 2013


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1375827639 25200
#      Tue Aug 06 15:20:39 2013 -0700
# Node ID 30ed64131bf76a55ed9dbc6e4aebf4c90f413624
# Parent  693af582853bc61a1fee181d047e944fa93da490
schemas: add tests to cover schema transmission

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

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 ..



More information about the Mercurial-devel mailing list