| 1 |
Testing interaction of sparse and narrow when both are enabled on the client |
| 2 |
side and we do a non-ellipsis clone |
| 3 |
|
| 4 |
#testcases tree flat |
| 5 |
$ . "$TESTDIR/narrow-library.sh" |
| 6 |
$ cat << EOF >> $HGRCPATH |
| 7 |
> [extensions] |
| 8 |
> sparse = |
| 9 |
> EOF |
| 10 |
|
| 11 |
#if tree |
| 12 |
$ cat << EOF >> $HGRCPATH |
| 13 |
> [experimental] |
| 14 |
> treemanifest = 1 |
| 15 |
> EOF |
| 16 |
#endif |
| 17 |
|
| 18 |
$ hg init master |
| 19 |
$ cd master |
| 20 |
|
| 21 |
$ mkdir inside |
| 22 |
$ echo 'inside' > inside/f |
| 23 |
$ hg add inside/f |
| 24 |
$ hg commit -m 'add inside' |
| 25 |
|
| 26 |
$ mkdir widest |
| 27 |
$ echo 'widest' > widest/f |
| 28 |
$ hg add widest/f |
| 29 |
$ hg commit -m 'add widest' |
| 30 |
|
| 31 |
$ mkdir outside |
| 32 |
$ echo 'outside' > outside/f |
| 33 |
$ hg add outside/f |
| 34 |
$ hg commit -m 'add outside' |
| 35 |
|
| 36 |
$ cd .. |
| 37 |
|
| 38 |
narrow clone the inside file |
| 39 |
|
| 40 |
$ hg clone --narrow ssh://user@dummy/master narrow --include inside/f |
| 41 |
requesting all changes |
| 42 |
adding changesets |
| 43 |
adding manifests |
| 44 |
adding file changes |
| 45 |
added 3 changesets with 1 changes to 1 files |
| 46 |
new changesets *:* (glob) |
| 47 |
updating to branch default |
| 48 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 49 |
$ cd narrow |
| 50 |
$ hg tracked |
| 51 |
I path:inside/f |
| 52 |
$ hg files |
| 53 |
inside/f |
| 54 |
|
| 55 |
XXX: we should have a flag in `hg debugsparse` to list the sparse profile |
| 56 |
$ test -f .hg/sparse |
| 57 |
[1] |
| 58 |
|
| 59 |
$ hg debugrequires |
| 60 |
dotencode |
| 61 |
dirstate-v2 (dirstate-v2 !) |
| 62 |
fncache |
| 63 |
generaldelta |
| 64 |
narrowhg-experimental |
| 65 |
persistent-nodemap (rust !) |
| 66 |
revlog-compression-zstd (zstd !) |
| 67 |
revlogv1 |
| 68 |
share-safe |
| 69 |
sparserevlog |
| 70 |
store |
| 71 |
treemanifest (tree !) |
| 72 |
|
| 73 |
$ hg debugrebuilddirstate |
| 74 |
|
| 75 |
We only make the following assertions for the flat test case since in the |
| 76 |
treemanifest test case debugsparse fails with "path ends in directory |
| 77 |
separator: outside/" which seems like a bug unrelated to the regression this is |
| 78 |
testing for. |
| 79 |
|
| 80 |
#if flat |
| 81 |
widening with both sparse and narrow is possible |
| 82 |
|
| 83 |
$ cat >> .hg/hgrc <<EOF |
| 84 |
> [extensions] |
| 85 |
> sparse = |
| 86 |
> narrow = |
| 87 |
> EOF |
| 88 |
|
| 89 |
$ hg debugsparse -X outside/f -X widest/f |
| 90 |
$ hg tracked -q --addinclude outside/f |
| 91 |
$ find . -name .hg -prune -o -type f -print | sort |
| 92 |
./inside/f |
| 93 |
|
| 94 |
$ hg debugsparse -d outside/f |
| 95 |
$ find . -name .hg -prune -o -type f -print | sort |
| 96 |
./inside/f |
| 97 |
./outside/f |
| 98 |
#endif |