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