|
1 $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH |
|
2 $ export PYTHONPATH |
|
3 |
|
4 $ . "$TESTDIR/remotefilelog-library.sh" |
|
5 |
|
6 $ hginit master |
|
7 $ cd master |
|
8 $ cat >> .hg/hgrc <<EOF |
|
9 > [remotefilelog] |
|
10 > server=True |
|
11 > EOF |
|
12 $ echo x > x |
|
13 $ echo y > y |
|
14 $ echo z > z |
|
15 $ hg commit -qAm xy |
|
16 |
|
17 $ cd .. |
|
18 |
|
19 $ hgcloneshallow ssh://user@dummy/master shallow -q |
|
20 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) |
|
21 $ cd shallow |
|
22 |
|
23 # status |
|
24 |
|
25 $ clearcache |
|
26 $ echo xx > x |
|
27 $ echo yy > y |
|
28 $ touch a |
|
29 $ hg status |
|
30 M x |
|
31 M y |
|
32 ? a |
|
33 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
34 $ hg add a |
|
35 $ hg status |
|
36 M x |
|
37 M y |
|
38 A a |
|
39 |
|
40 # diff |
|
41 |
|
42 $ hg debugrebuilddirstate # fixes dirstate non-determinism |
|
43 $ hg add a |
|
44 $ clearcache |
|
45 $ hg diff |
|
46 diff -r f3d0bb0d1e48 x |
|
47 --- a/x* (glob) |
|
48 +++ b/x* (glob) |
|
49 @@ -1,1 +1,1 @@ |
|
50 -x |
|
51 +xx |
|
52 diff -r f3d0bb0d1e48 y |
|
53 --- a/y* (glob) |
|
54 +++ b/y* (glob) |
|
55 @@ -1,1 +1,1 @@ |
|
56 -y |
|
57 +yy |
|
58 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) |
|
59 |
|
60 # local commit |
|
61 |
|
62 $ clearcache |
|
63 $ echo a > a |
|
64 $ echo xxx > x |
|
65 $ echo yyy > y |
|
66 $ hg commit -m a |
|
67 ? files fetched over 1 fetches - (? misses, 0.00% hit ratio) over *s (glob) |
|
68 |
|
69 # local commit where the dirstate is clean -- ensure that we do just one fetch |
|
70 # (update to a commit on the server first) |
|
71 |
|
72 $ hg --config debug.dirstate.delaywrite=1 up 0 |
|
73 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
74 $ clearcache |
|
75 $ hg debugdirstate |
|
76 n 644 2 * x (glob) |
|
77 n 644 2 * y (glob) |
|
78 n 644 2 * z (glob) |
|
79 $ echo xxxx > x |
|
80 $ echo yyyy > y |
|
81 $ hg commit -m x |
|
82 created new head |
|
83 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
84 |
|
85 # restore state for future tests |
|
86 |
|
87 $ hg -q strip . |
|
88 $ hg -q up tip |
|
89 |
|
90 # rebase |
|
91 |
|
92 $ clearcache |
|
93 $ cd ../master |
|
94 $ echo w > w |
|
95 $ hg commit -qAm w |
|
96 |
|
97 $ cd ../shallow |
|
98 $ hg pull |
|
99 pulling from ssh://user@dummy/master |
|
100 searching for changes |
|
101 adding changesets |
|
102 adding manifests |
|
103 adding file changes |
|
104 added 1 changesets with 0 changes to 0 files (+1 heads) |
|
105 new changesets fed61014d323 |
|
106 (run 'hg heads' to see heads, 'hg merge' to merge) |
|
107 |
|
108 $ hg rebase -d tip |
|
109 rebasing 1:9abfe7bca547 "a" |
|
110 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/9abfe7bca547-8b11e5ff-rebase.hg (glob) |
|
111 3 files fetched over 2 fetches - (3 misses, 0.00% hit ratio) over *s (glob) |
|
112 |
|
113 # strip |
|
114 |
|
115 $ clearcache |
|
116 $ hg debugrebuilddirstate # fixes dirstate non-determinism |
|
117 $ hg strip -r . |
|
118 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
119 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/19edf50f4de7-df3d0f74-backup.hg (glob) |
|
120 4 files fetched over 2 fetches - (4 misses, 0.00% hit ratio) over *s (glob) |
|
121 |
|
122 # unbundle |
|
123 |
|
124 $ clearcache |
|
125 $ ls |
|
126 w |
|
127 x |
|
128 y |
|
129 z |
|
130 |
|
131 $ hg debugrebuilddirstate # fixes dirstate non-determinism |
|
132 $ hg unbundle .hg/strip-backup/19edf50f4de7-df3d0f74-backup.hg |
|
133 adding changesets |
|
134 adding manifests |
|
135 adding file changes |
|
136 added 1 changesets with 0 changes to 0 files |
|
137 new changesets 19edf50f4de7 (1 drafts) |
|
138 (run 'hg update' to get a working copy) |
|
139 |
|
140 $ hg up |
|
141 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
142 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over *s (glob) |
|
143 $ cat a |
|
144 a |
|
145 |
|
146 # revert |
|
147 |
|
148 $ clearcache |
|
149 $ hg revert -r .~2 y z |
|
150 no changes needed to z |
|
151 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
152 $ hg checkout -C -r . -q |
|
153 |
|
154 # explicit bundle should produce full bundle file |
|
155 |
|
156 $ hg bundle -r 2 --base 1 ../local.bundle |
|
157 1 changesets found |
|
158 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
159 $ cd .. |
|
160 |
|
161 $ hgcloneshallow ssh://user@dummy/master shallow2 -q |
|
162 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
163 $ cd shallow2 |
|
164 $ hg unbundle ../local.bundle |
|
165 adding changesets |
|
166 adding manifests |
|
167 adding file changes |
|
168 added 1 changesets with 3 changes to 3 files |
|
169 new changesets 19edf50f4de7 (1 drafts) |
|
170 (run 'hg update' to get a working copy) |
|
171 |
|
172 $ hg log -r 2 --stat |
|
173 changeset: 2:19edf50f4de7 |
|
174 tag: tip |
|
175 user: test |
|
176 date: Thu Jan 01 00:00:00 1970 +0000 |
|
177 summary: a |
|
178 |
|
179 a | 1 + |
|
180 x | 2 +- |
|
181 y | 2 +- |
|
182 3 files changed, 3 insertions(+), 2 deletions(-) |
|
183 |
|
184 # Merge |
|
185 |
|
186 $ echo merge >> w |
|
187 $ hg commit -m w |
|
188 created new head |
|
189 $ hg merge 2 |
|
190 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
191 (branch merge, don't forget to commit) |
|
192 $ hg commit -m merge |
|
193 $ hg strip -q -r ".^" |
|
194 |
|
195 # commit without producing new node |
|
196 |
|
197 $ cd $TESTTMP |
|
198 $ hgcloneshallow ssh://user@dummy/master shallow3 -q |
|
199 $ cd shallow3 |
|
200 $ echo 1 > A |
|
201 $ hg commit -m foo -A A |
|
202 $ hg log -r . -T '{node}\n' |
|
203 383ce605500277f879b7460a16ba620eb6930b7f |
|
204 $ hg update -r '.^' -q |
|
205 $ echo 1 > A |
|
206 $ hg commit -m foo -A A |
|
207 $ hg log -r . -T '{node}\n' |
|
208 383ce605500277f879b7460a16ba620eb6930b7f |