| 1 |
#require serve |
| 2 |
|
| 3 |
$ hg init server |
| 4 |
$ cd server |
| 5 |
$ cat >> .hg/hgrc << EOF |
| 6 |
> [extensions] |
| 7 |
> strip= |
| 8 |
> EOF |
| 9 |
|
| 10 |
$ echo 1 > foo |
| 11 |
$ hg commit -A -m 'first' |
| 12 |
adding foo |
| 13 |
$ echo 2 > bar |
| 14 |
$ hg commit -A -m 'second' |
| 15 |
adding bar |
| 16 |
|
| 17 |
Produce a bundle to use |
| 18 |
|
| 19 |
$ hg strip -r 1 |
| 20 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 21 |
saved backup bundle to $TESTTMP/server/.hg/strip-backup/ed602e697e0f-cc9fff6a-backup.hg |
| 22 |
|
| 23 |
Serve from a bundle file |
| 24 |
|
| 25 |
$ hg serve -R .hg/strip-backup/ed602e697e0f-cc9fff6a-backup.hg -d -p $HGPORT \ |
| 26 |
> --pid-file=hg.pid \ |
| 27 |
> --errorlog=../server-errors.log |
| 28 |
$ cat hg.pid >> $DAEMON_PIDS |
| 29 |
|
| 30 |
Ensure we're serving from the bundle |
| 31 |
|
| 32 |
$ (get-with-headers.py localhost:$HGPORT 'file/tip/?style=raw') |
| 33 |
200 Script output follows |
| 34 |
|
| 35 |
|
| 36 |
-rw-r--r-- 2 bar |
| 37 |
-rw-r--r-- 2 foo |
| 38 |
|
| 39 |
|
| 40 |
$ cat ../server-errors.log |