##// END OF EJS Templates
wireprotov2: define and implement "manifestdata" command...
wireprotov2: define and implement "manifestdata" command The added command can be used for obtaining manifest data. Given a manifest path and set of manifest nodes, data about manifests can be retrieved. Unlike changeset data, we wish to emit deltas to describe manifest revisions. So the command uses the relatively new API for building delta requests and emitting them. The code calls into deltaparent(), which I'm not very keen of. There's still work to be done in delta generation land so implementation details of storage (e.g. exactly one delta is stored/available) don't creep into higher levels. But we can worry about this later (there is already a TODO on imanifestorage tracking this). On the subject of parent deltas, the server assumes parent revisions exist on the receiving end. This is obviously wrong for shallow clone. I've added TODOs to add a mechanism to the command to allow clients to specify desired behavior. This shouldn't be too difficult to implement. Another big change is that the client must explicitly request manifest nodes to retrieve. This is a major departure from "getbundle," where the server derives relevant manifests as it iterates changesets and sends them automatically. As implemented, the client must transmit each requested node to the server. At 20 bytes per node, we're looking at 2 MB per 100,000 nodes. Plus wire encoding overhead. This isn't ideal for clients with limited upload bandwidth. I plan to address this in the future by allowing alternate mechanisms for defining the revisions to retrieve. One idea is to define a range of changeset revisions whose manifest revisions to retrieve (similar to how "changesetdata" works). We almost certainly want an API to look up an individual manifest by node. And that's where I've chosen to start with the implementation. Again, a theme of this early exchangev2 work is I want to start by building primitives for accessing raw repository data first and see how far we can get with those before we need more complexity. Differential Revision: https://phab.mercurial-scm.org/D4488

File last commit:

r39579:41ac8ea1 stable
r39673:c7a7c7e8 default
Show More
test-subrepo-relative-path.t
219 lines | 6.8 KiB | text/troff | Tads3Lexer
/ tests / test-subrepo-relative-path.t
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 Preparing the subrepository 'sub'
$ hg init sub
$ echo sub > sub/sub
$ hg add -R sub
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 adding sub/sub
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 $ hg commit -R sub -m "sub import"
Preparing the 'main' repo which depends on the subrepo 'sub'
$ hg init main
$ echo main > main/main
$ echo "sub = ../sub" > main/.hgsub
$ hg clone sub main/sub
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg add -R main
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 adding main/.hgsub
adding main/main
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 $ hg commit -R main -m "main import"
Cleaning both repositories, just as a clone -U
$ hg up -C -R sub null
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg up -C -R main null
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
$ rm -rf main/sub
Mads Kiilerich
tests: add missing no-outer-repo requirements...
r17015 hide outer repo
$ hg init
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 Serving them both using hgweb
$ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
$ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
> -A /dev/null -E /dev/null --pid-file hg.pid -d
$ cat hg.pid >> $DAEMON_PIDS
Clone main from hgweb
Matt Harbison
subrepo: mask out passwords embedded in the messages displaying a URL...
r39579 $ hg clone "http://user:pass@localhost:$HGPORT/main" cloned
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 3 changes to 3 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets fdfeeb3e979e
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 updating to branch default
Matt Harbison
subrepo: mask out passwords embedded in the messages displaying a URL...
r39579 cloning subrepo sub from http://user@localhost:$HGPORT/sub
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 863c1745b441
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
outgoing: pay attention to `default:pushurl` for bookmarks and subrepos...
r38188 Ensure that subrepos pay attention to default:pushurl
$ cat > cloned/.hg/hgrc << EOF
> [paths]
Matt Harbison
subrepo: mask out passwords embedded in the messages displaying a URL...
r39579 > default:pushurl = http://user:pass@localhost:$HGPORT/main
Matt Harbison
outgoing: pay attention to `default:pushurl` for bookmarks and subrepos...
r38188 > EOF
$ hg -R cloned out -S --config paths.default=bogus://invalid
Matt Harbison
subrepo: mask out passwords embedded in the messages displaying a URL...
r39579 comparing with http://user:***@localhost:$HGPORT/main
Matt Harbison
outgoing: pay attention to `default:pushurl` for bookmarks and subrepos...
r38188 searching for changes
no changes found
Matt Harbison
subrepo: mask out passwords embedded in the messages displaying a URL...
r39579 comparing with http://user:***@localhost:$HGPORT/sub
Matt Harbison
outgoing: pay attention to `default:pushurl` for bookmarks and subrepos...
r38188 searching for changes
no changes found
[1]
Matt Harbison
subrepo: mask out passwords embedded in the messages displaying a URL...
r39579 TODO: Figure out why, if the password is left out of the default:pushurl URL,
this says "no changes made to subrepo sub since last push". It looks like from
the original clone command above, the password is getting stripped off, not
just masked out, and that would make the hashed URL different.
Matt Harbison
outgoing: pay attention to `default:pushurl` for bookmarks and subrepos...
r38188 $ hg -R cloned push --config paths.default=bogus://invalid
Matt Harbison
subrepo: mask out passwords embedded in the messages displaying a URL...
r39579 pushing to http://user:***@localhost:$HGPORT/main
pushing subrepo sub to http://user:***@localhost:$HGPORT/sub
searching for changes
no changes found
Matt Harbison
outgoing: pay attention to `default:pushurl` for bookmarks and subrepos...
r38188 searching for changes
no changes found
abort: HTTP Error 403: ssl required
[255]
Martin Geisler
tests: unify test-subrepo-relative-path
r11915 Checking cloned repo ids
$ hg id -R cloned
fdfeeb3e979e tip
$ hg id -R cloned/sub
863c1745b441 tip
subrepo debug for 'main' clone
$ hg debugsub -R cloned
path sub
source ../sub
revision 863c1745b441bd97a8c4a096e87793073f4fb215
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704 Test sharing with a remote URL reference
$ hg init absolute_subrepo
$ cd absolute_subrepo
$ echo foo > foo.txt
$ hg ci -Am 'initial commit'
adding foo.txt
$ echo "sub = http://localhost:$HGPORT/sub" > .hgsub
$ hg ci -Am 'add absolute subrepo'
adding .hgsub
$ cd ..
Matt Harbison
subrepo: activate clone pooling to enable sharing with remote URLs...
r36706 Clone pooling works for local clones with a remote subrepo reference. The
subrepo is cloned to the pool and shared from there, so that all clones will
share the same subrepo.
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704
$ hg --config extensions.share= --config share.pool=$TESTTMP/pool \
> clone absolute_subrepo cloned_from_abs
(sharing from new pooled repository 8d6a2f1e993b34b6557de0042cfe825ae12a8dae)
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 3 changes to 3 files
Matt Harbison
test-subrepo: glob away an unstable hash...
r36707 new changesets 8d6a2f1e993b:* (glob)
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704 searching for changes
no changes found
updating working directory
Matt Harbison
subrepo: don't attempt to share remote sources (issue5793)...
r36705 cloning subrepo sub from http://localhost:$HGPORT/sub
Matt Harbison
subrepo: activate clone pooling to enable sharing with remote URLs...
r36706 (sharing from new pooled repository 863c1745b441bd97a8c4a096e87793073f4fb215)
Matt Harbison
subrepo: don't attempt to share remote sources (issue5793)...
r36705 requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets 863c1745b441
Matt Harbison
subrepo: activate clone pooling to enable sharing with remote URLs...
r36706 searching for changes
no changes found
Matt Harbison
subrepo: don't attempt to share remote sources (issue5793)...
r36705 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
Vanilla sharing with a subrepo remote path reference will clone the subrepo.
Each share of these top level repos will end up with independent subrepo copies
(potentially leaving the shared parent with dangling cset references).
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704
$ hg --config extensions.share= share absolute_subrepo shared_from_abs
updating working directory
Matt Harbison
subrepo: don't attempt to share remote sources (issue5793)...
r36705 cloning subrepo sub from http://localhost:$HGPORT/sub
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets 863c1745b441
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704
$ hg --config extensions.share= share -U absolute_subrepo shared_from_abs2
$ hg -R shared_from_abs2 update -r tip
Matt Harbison
subrepo: don't attempt to share remote sources (issue5793)...
r36705 cloning subrepo sub from http://localhost:$HGPORT/sub
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets 863c1745b441
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704
Matt Harbison
subrepo: don't attempt to share remote sources (issue5793)...
r36705 A parent repo without its subrepo available locally can be shared if the
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704 subrepo is referenced by absolute path.
$ hg clone -U absolute_subrepo cloned_null_from_abs
$ hg --config extensions.share= share cloned_null_from_abs shared_from_null_abs
updating working directory
Matt Harbison
subrepo: don't attempt to share remote sources (issue5793)...
r36705 cloning subrepo sub from http://localhost:$HGPORT/sub
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
new changesets 863c1745b441
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
test-subrepo: demonstrate problems with subrepo sharing and absolute paths...
r36704
Matt Mackall
tests: drop DAEMON_PIDS from killdaemons calls
r25474 $ killdaemons.py
Mads Kiilerich
tests: test subrepos with ssh urls
r14187
subrepo paths with ssh urls
Matt Harbison
tests: quote $PYTHON for Windows...
r33335 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/cloned sshclone
Mads Kiilerich
tests: test subrepos with ssh urls
r14187 requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 3 changes to 3 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets fdfeeb3e979e
Mads Kiilerich
tests: test subrepos with ssh urls
r14187 updating to branch default
Martin Geisler
subrepo: create subrepos using clone instead of pull...
r14281 cloning subrepo sub from ssh://user@dummy/sub
Mads Kiilerich
tests: test subrepos with ssh urls
r14187 requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 863c1745b441
Mads Kiilerich
tests: test subrepos with ssh urls
r14187 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
tests: quote $PYTHON for Windows...
r33335 $ hg -R sshclone push -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/cloned
Mads Kiilerich
tests: test subrepos with ssh urls
r14187 pushing to ssh://user@dummy/$TESTTMP/cloned
pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub
searching for changes
no changes found
searching for changes
no changes found
Matt Mackall
push: return 1 if no changes found (issue3228)...
r16023 [1]
Mads Kiilerich
tests: test subrepos with ssh urls
r14187
$ cat dummylog
Mads Kiilerich
sshrepo: don't quote obviously safe strings (issue2983)...
r15622 Got arguments 1:user@dummy 2:hg -R cloned serve --stdio
Got arguments 1:user@dummy 2:hg -R sub serve --stdio
Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio
Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio