##// 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:

r39147:46da52f4 default
r39673:c7a7c7e8 default
Show More
test-convert-svn-branches.t
128 lines | 3.1 KiB | text/troff | Tads3Lexer
/ tests / test-convert-svn-branches.t
Matt Mackall
tests: replace exit 80 with #require
r22046 #require svn svn-bindings
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370
Martin Geisler
tests: don't overwrite HGRCPATH...
r13519 $ cat >> $HGRCPATH <<EOF
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370 > [extensions]
Mads Kiilerich
check-code: fix check for trailing whitespace on continued lines too...
r17347 > convert =
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370 > EOF
$ svnadmin create svn-repo
$ svnadmin load -q svn-repo < "$TESTDIR/svn/branches.svndump"
Convert trunk and branches
$ cat > branchmap <<EOF
> old3 newbranch
Mads Kiilerich
check-code: fix check for trailing whitespace on continued lines too...
r17347 >
Patrick Mezard
convert: ignore blank lines in mapfiles (issue3286)
r16190 >
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370 > EOF
$ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
initializing destination A-hg repository
scanning source...
sorting...
converting...
10 init projA
9 hello
8 branch trunk, remove c and dir
7 change a
6 change b
5 move and update c
4 move and update c
3 change b again
2 move to old2
1 move back to old
0 last change to a
Patrick Mezard
convert: add svnrev, svnpath and svnuuid template keywords...
r13691 Test template keywords
$ hg -R A-hg log --template '{rev} {svnuuid}{svnpath}@{svnrev}\n'
10 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@10
9 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@9
8 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old2@8
7 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@7
6 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@6
5 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@6
4 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@5
3 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@4
2 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@3
1 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@2
0 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@1
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370 Convert again
$ hg convert --branchmap=branchmap --datesort svn-repo A-hg
scanning source...
sorting...
converting...
0 branch trunk@1 into old3
$ cd A-hg
Martin Geisler
tests: don't load unnecessary graphlog extension...
r20117 $ hg log -G --template 'branch={branches} {rev} {desc|firstline} files: {files}\n'
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370 o branch=newbranch 11 branch trunk@1 into old3 files:
|
| o branch= 10 last change to a files: a
| |
| | o branch=old 9 move back to old files:
| | |
| | o branch=old2 8 move to old2 files:
| | |
| | o branch=old 7 change b again files: b
| | |
| o | branch= 6 move and update c files: b
| | |
| | o branch=old 5 move and update c files: c
| | |
| | o branch=old 4 change b files: b
| | |
| o | branch= 3 change a files: a
| | |
| | o branch=old 2 branch trunk, remove c and dir files: c
| |/
| o branch= 1 hello files: a b c dir/e
|/
o branch= 0 init projA files:
$ hg branches
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 newbranch 11:a6d7cc050ad1
default 10:6e2b33404495
Yuya Nishihara
commit: try hard to reuse p1 manifest if nothing changed...
r39147 old 9:1b494af68c0b
old2 8:5be40b8dcbf6 (inactive)
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370 $ hg tags -q
tip
$ cd ..
Test hg failing to call itself
Patrick Mezard
test-convert-svn-branches.t: fix self call failure on Windows...
r17447 $ HG=foobar hg convert svn-repo B-hg 2>&1 | grep abort
Dan Villiom Podlaski Christiansen
tests: unify test-convert-svn-*
r12370 abort: Mercurial failed to run itself, check hg executable is in PATH
lstewart
convert: use branchmap to change default branch in destination (issue3469)...
r20331
Convert 'trunk' to branch other than 'default'
$ cat > branchmap <<EOF
Eugene Baranov
convert: use 'default' for specifying branch name in branchmap (issue4753)...
r25805 > default hgtrunk
lstewart
convert: use branchmap to change default branch in destination (issue3469)...
r20331 >
>
> EOF
$ hg convert --branchmap=branchmap --datesort -r 10 svn-repo C-hg
initializing destination C-hg repository
scanning source...
sorting...
converting...
10 init projA
9 hello
8 branch trunk, remove c and dir
7 change a
6 change b
5 move and update c
4 move and update c
3 change b again
2 move to old2
1 move back to old
0 last change to a
$ cd C-hg
Eugene Baranov
convert: use 'default' for specifying branch name in branchmap (issue4753)...
r25805 $ hg branches --template '{branch}\n'
hgtrunk
old
old2
lstewart
convert: use branchmap to change default branch in destination (issue3469)...
r20331 $ cd ..