tests/test-clone
author mpm@selenic.com
Tue, 16 Aug 2005 14:53:47 -0800
changeset 917 7f3f55903496
parent 839 9c918287d10b
child 1926 ba198d17eea9
permissions -rwxr-xr-x
Fix hg clone race with writer Most read operations in hg don't need locks because we order reads and writes for consistency. Clone is an exception to this as we're copying entire file histories and could end up with more file history copied than we have commits. For now, make clone take a lock on the source repo. Non-hardlinked clone should eventually be changed to use lockless pull.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
834
78a9f95766dc Use sh instead of bash in tests.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 814
diff changeset
     1
#!/bin/sh
550
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
     2
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
     3
mkdir a
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
     4
cd a
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
     5
hg init
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
     6
echo a > a
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
     7
hg add a
749
7e4843b7efd2 Update tests to use commit -m and default -u
mpm@selenic.com
parents: 550
diff changeset
     8
hg commit -m test -d '0 0'
550
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
     9
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    10
# Default operation
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    11
hg clone . ../b
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    12
cd ../b
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    13
cat a
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    14
hg verify
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    15
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    16
# No update
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    17
hg clone -U . ../c
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    18
cd ../c
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    19
cat a
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    20
hg verify
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    21
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    22
# Default destination
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    23
mkdir ../d
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    24
cd ../d
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    25
hg clone ../a
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    26
cd a
96ff7dae94f7 [PATCH] Tests for clone command
mpm@selenic.com
parents:
diff changeset
    27
hg cat a