author | Martin Geisler <mg@lazybytes.net> |
Wed, 09 Nov 2011 18:26:54 +0100 | |
branch | stable |
changeset 15465 | d8238600265d |
parent 15101 | a21ccf4412d5 |
child 15446 | c5c9ca3719f9 |
permissions | -rw-r--r-- |
9990 | 1 |
|
12487 | 2 |
$ echo "[extensions]" >> $HGRCPATH |
3 |
$ echo "share = " >> $HGRCPATH |
|
4 |
||
5 |
prepare repo1 |
|
9990 | 6 |
|
12487 | 7 |
$ hg init repo1 |
8 |
$ cd repo1 |
|
9 |
$ echo a > a |
|
10 |
$ hg commit -A -m'init' |
|
11 |
adding a |
|
12 |
||
13 |
share it |
|
9990 | 14 |
|
12487 | 15 |
$ cd .. |
16 |
$ hg share repo1 repo2 |
|
17 |
updating working directory |
|
18 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
19 |
||
20 |
share shouldn't have a store dir |
|
21 |
||
22 |
$ cd repo2 |
|
23 |
$ test -d .hg/store |
|
24 |
[1] |
|
9990 | 25 |
|
12487 | 26 |
Some sed versions appends newline, some don't, and some just fails |
27 |
||
28 |
$ cat .hg/sharedpath; echo |
|
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12487
diff
changeset
|
29 |
$TESTTMP/repo1/.hg |
12487 | 30 |
|
15101
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
31 |
trailing newline on .hg/sharedpath is ok |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
32 |
$ hg tip -q |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
33 |
0:d3873e73d99e |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
34 |
$ echo '' >> .hg/sharedpath |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
35 |
$ cat .hg/sharedpath |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
36 |
$TESTTMP/repo1/.hg |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
37 |
$ hg tip -q |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
38 |
0:d3873e73d99e |
a21ccf4412d5
share: allow trailing newline on .hg/sharedpath.
Greg Ward <greg@gerg.ca>
parents:
15080
diff
changeset
|
39 |
|
12487 | 40 |
commit in shared clone |
41 |
||
42 |
$ echo a >> a |
|
43 |
$ hg commit -m'change in shared clone' |
|
44 |
||
45 |
check original |
|
9990 | 46 |
|
12487 | 47 |
$ cd ../repo1 |
48 |
$ hg log |
|
49 |
changeset: 1:8af4dc49db9e |
|
50 |
tag: tip |
|
51 |
user: test |
|
52 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
53 |
summary: change in shared clone |
|
54 |
||
55 |
changeset: 0:d3873e73d99e |
|
56 |
user: test |
|
57 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
58 |
summary: init |
|
59 |
||
60 |
$ hg update |
|
61 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
62 |
$ cat a # should be two lines of "a" |
|
63 |
a |
|
64 |
a |
|
9990 | 65 |
|
12487 | 66 |
commit in original |
67 |
||
68 |
$ echo b > b |
|
69 |
$ hg commit -A -m'another file' |
|
70 |
adding b |
|
71 |
||
72 |
check in shared clone |
|
9990 | 73 |
|
12487 | 74 |
$ cd ../repo2 |
75 |
$ hg log |
|
76 |
changeset: 2:c2e0ac586386 |
|
77 |
tag: tip |
|
78 |
user: test |
|
79 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
80 |
summary: another file |
|
81 |
||
82 |
changeset: 1:8af4dc49db9e |
|
83 |
user: test |
|
84 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
85 |
summary: change in shared clone |
|
86 |
||
87 |
changeset: 0:d3873e73d99e |
|
88 |
user: test |
|
89 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
90 |
summary: init |
|
91 |
||
92 |
$ hg update |
|
93 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
94 |
$ cat b # should exist with one "b" |
|
95 |
b |
|
9990 | 96 |
|
12487 | 97 |
hg serve shared clone |
9990 | 98 |
|
12487 | 99 |
$ hg serve -n test -p $HGPORT -d --pid-file=hg.pid |
100 |
$ cat hg.pid >> $DAEMON_PIDS |
|
101 |
$ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-file/' |
|
102 |
200 Script output follows |
|
103 |
||
104 |
||
105 |
-rw-r--r-- 4 a |
|
106 |
-rw-r--r-- 2 b |
|
107 |
||
108 |
||
15080
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
109 |
|
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
110 |
test unshare command |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
111 |
|
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
112 |
$ hg unshare |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
113 |
$ test -d .hg/store |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
114 |
$ test -f .hg/sharedpath |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
115 |
[1] |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
116 |
$ hg unshare |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
117 |
abort: this is not a shared repo |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
118 |
[255] |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
119 |
|
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
120 |
check that a change does not propagate |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
121 |
|
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
122 |
$ echo b >> b |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
123 |
$ hg commit -m'change in unshared' |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
124 |
$ cd ../repo1 |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
125 |
$ hg id -r tip |
574dc5d74f9b
test: test unshare command
Simon Heimberg <simohe@besonet.ch>
parents:
12640
diff
changeset
|
126 |
c2e0ac586386 tip |