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

r39321:a3fd84f4 default
r39673:c7a7c7e8 default
Show More
test-merge-subrepos.t
140 lines | 3.4 KiB | text/troff | Tads3Lexer
/ tests / test-merge-subrepos.t
Oleg Stepanov
Do not allow merging with uncommitted changes in a subrepo
r13437 $ hg init
$ echo a > a
$ hg ci -qAm 'add a'
$ hg init subrepo
$ echo 'subrepo = http://example.net/libfoo' > .hgsub
$ hg ci -qAm 'added subrepo'
$ hg up -qC 0
$ echo ax > a
$ hg ci -m 'changed a'
created new head
$ hg up -qC 1
$ cd subrepo
$ echo b > b
$ hg add b
$ cd ..
Should fail, since there are added files to subrepo:
$ hg merge
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: uncommitted changes in subrepository "subrepo"
Oleg Stepanov
Do not allow merging with uncommitted changes in a subrepo
r13437 [255]
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
Deleted files trigger a '+' marker in top level repos. Deleted files are also
noticed by `update --check` in the top level repo.
$ hg ci -Sqm 'add b'
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 $ echo change > subrepo/b
$ hg ci -Sm 'change b'
committing subrepository subrepo
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 $ rm a
$ hg id
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 9bfe45a197d7+ tip
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 $ hg sum
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 parent: 4:9bfe45a197d7 tip
change b
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 branch: default
commit: 1 deleted (clean)
update: 1 new changesets, 2 branch heads (merge)
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 phases: 5 draft
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
$ hg up --check -r '.^'
abort: uncommitted changes
[255]
$ hg st -S
! a
$ hg up -Cq .
Test that dirty is consistent through subrepos
$ rm subrepo/b
Matt Harbison
subrepo: consider the parent repo dirty when a file is missing...
r33364 A deleted subrepo file is flagged as dirty, like the top level repo
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 $ hg id --config extensions.blackbox= --config blackbox.dirty=True
Matt Harbison
subrepo: consider the parent repo dirty when a file is missing...
r33364 9bfe45a197d7+ tip
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 $ cat .hg/blackbox.log
Saurabh Singh
test-merge-subrepos: make test compatible with chg...
r34451 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --cmdserver chgunix * (glob) (chg !)
Yuya Nishihara
dispatch: verify result of early command parsing...
r35063 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* (glob)
Matt Harbison
subrepo: consider the parent repo dirty when a file is missing...
r33364 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob)
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
TODO: a deleted file should be listed as such, like the top level repo
$ hg sum
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 parent: 4:9bfe45a197d7 tip
change b
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 branch: default
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 phases: 5 draft
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
Modified subrepo files are noticed by `update --check` and `summary`
$ echo mod > subrepo/b
$ hg st -S
M subrepo/b
$ hg up -r '.^' --check
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: uncommitted changes in subrepository "subrepo"
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 [255]
$ hg sum
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 parent: 4:9bfe45a197d7 tip
change b
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 branch: default
commit: 1 subrepos
update: 1 new changesets, 2 branch heads (merge)
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 phases: 5 draft
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
TODO: why is -R needed here? If it's because the subrepo is treated as a
discrete unit, then this should probably warn or something.
$ hg revert -R subrepo --no-backup subrepo/b -r .
$ rm subrepo/b
$ hg st -S
! subrepo/b
Matt Harbison
subrepo: consider the parent repo dirty when a file is missing...
r33364 `hg update --check` notices a subrepo with a missing file, like it notices a
missing file in the top level repo.
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
Matt Harbison
subrepo: consider the parent repo dirty when a file is missing...
r33364 $ hg up -r '.^' --check
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: uncommitted changes in subrepository "subrepo"
Matt Harbison
subrepo: consider the parent repo dirty when a file is missing...
r33364 [255]
$ hg up -r '.^' --config ui.interactive=True << EOF
Matt Harbison
test-subrepo: demonstrate a status problem when merge deletes a file...
r33366 > d
Matt Harbison
tests: tweak the subrepo dirty state tests...
r33359 > EOF
Pulkit Goyal
filemerge: fix the wrong placements of messages in prompt...
r39321 file 'b' was deleted in local [working copy] but was modified in other [destination].
Augie Fackler
merge: improve interactive one-changed one-deleted message (issue5550)...
r39313 What do you want to do?
Matt Harbison
test-subrepo: demonstrate a status problem when merge deletes a file...
r33366 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
test-subrepo: demonstrate a status problem when merge deletes a file...
r33366 XXX: There's a difference between wdir() and '.', so there should be a status.
`hg files -S` from the top is also missing 'subrepo/b'.
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 $ hg st -S
Matt Harbison
test-subrepo: demonstrate a status problem when merge deletes a file...
r33366 $ hg st -R subrepo
$ hg files -R subrepo
[1]
$ hg files -R subrepo -r '.'
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 subrepo/b
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193
$ hg bookmark -r tip @other
$ echo xyz > subrepo/c
$ hg ci -SAm 'add c'
adding subrepo/c
committing subrepository subrepo
created new head
$ rm subrepo/c
Merge sees deleted subrepo files as an uncommitted change
$ hg merge @other
Matt Harbison
subrepo: make the output references to subrepositories consistent...
r33365 abort: uncommitted changes in subrepository "subrepo"
Matt Harbison
tests: demonstrate inconsistencies with dirty state in various commands...
r33193 [255]