##// END OF EJS Templates
wireprotov2: implement commands as a generator of objects...
wireprotov2: implement commands as a generator of objects Previously, wire protocol version 2 inherited version 1's model of having separate types to represent the results of different wire protocol commands. As I implemented more powerful commands in future commits, I found I was using a common pattern of returning a special type to hold a generator. This meant the command function required a closure to do most of the work. That made logic flow more difficult to follow. I also noticed that many commands were effectively a sequence of objects to be CBOR encoded. I think it makes sense to define version 2 commands as generators. This way, commands can simply emit the data structures they wish to send to the client. This eliminates the need for a closure in command functions and removes encoding from the bodies of commands. As part of this commit, the handling of response objects has been moved into the serverreactor class. This puts the reactor in the driver's seat with regards to CBOR encoding and error handling. Having error handling in the function that emits frames is particularly important because exceptions in that function can lead to things getting in a bad state: I'm fairly certain that uncaught exceptions in the frame generator were causing deadlocks. I also introduced a dedicated error type for explicit error reporting in command handlers. This will be used in subsequent commits. There's still a bit of work to be done here, especially around formalizing the error handling "protocol." I've added yet another TODO to track this so we don't forget. Test output changed because we're using generators and no longer know we are at the end of the data until we hit the end of the generator. This means we can't emit the end-of-stream flag until we've exhausted the generator. Hence the introduction of 0-sized end-of-stream frames. Differential Revision: https://phab.mercurial-scm.org/D4472

File last commit:

r39321:a3fd84f4 default
r39595:07b58266 default
Show More
test-copy-move-merge.t
172 lines | 4.0 KiB | text/troff | Tads3Lexer
/ tests / test-copy-move-merge.t
Pulkit Goyal
copytrace: move the default copytracing algorithm in a new function...
r34080 Test for the full copytracing algorithm
=======================================
Martin Geisler
tests: remove redundant mkdir...
r13956 $ hg init t
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972 $ cd t
$ echo 1 > a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -qAm "first"
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972
$ hg cp a b
$ hg mv a c
$ echo 2 >> b
$ echo 2 >> c
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -qAm "second"
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972
$ hg co -C 0
1 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ echo 0 > a
$ echo 1 >> a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -qAm "other"
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972
$ hg merge --debug
searching for copies back to rev 1
unmatched files in other:
b
c
Thomas Arendsen Hein
merge: show renamed on one and deleted on the other side in debug output
r16795 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
Mads Kiilerich
copies: report found copies sorted
r18362 src: 'a' -> dst: 'b' *
Siddharth Agarwal
copies: make debug messages more sensible...
r18135 src: 'a' -> dst: 'c' *
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972 checking for directory renames
resolving manifests
Siddharth Agarwal
manifestmerge: pass in branchmerge and force separately...
r18605 branchmerge: True, force: False, partial: False
Martin Geisler
merge: make debug output easier to read...
r15625 ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
Mads Kiilerich
merge: change debug logging - test output changes but no real changes...
r21391 preserving a for resolve of b
preserving a for resolve of c
removing a
Matt Harbison
tests: flag Windows specific lines about background closing as optional
r28318 starting 4 threads for background file closing (?)
Siddharth Agarwal
merge.mergestate: perform all premerges before any merges (BC)...
r26618 b: remote moved from a -> m (premerge)
Siddharth Agarwal
filemerge: add debug output for whether this is a change/delete conflict...
r27161 picked tool ':merge' for b (binary False symlink False changedelete False)
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972 merging a and b to b
Martin Geisler
tests: remove unneeded -d flags...
r12156 my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972 premerge successful
Siddharth Agarwal
merge.mergestate: perform all premerges before any merges (BC)...
r26618 c: remote moved from a -> m (premerge)
Siddharth Agarwal
filemerge: add debug output for whether this is a change/delete conflict...
r27161 picked tool ':merge' for c (binary False symlink False changedelete False)
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972 merging a and c to c
Martin Geisler
tests: remove unneeded -d flags...
r12156 my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc
Pradeepkumar Gayam
tests: unify test-copy-move-merge
r11972 premerge successful
0 files updated, 2 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
file b
$ cat b
0
1
2
file c
$ cat c
0
1
2
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913
Durham Goode
copy: add flag for disabling copy tracing...
r26013 Test disabling copy tracing
- first verify copy metadata was kept
$ hg up -qC 2
$ hg rebase --keep -d 1 -b 2 --config extensions.rebase=
rebasing 2:add3f11052fa "other" (tip)
merging b and a to b
merging c and a to c
$ cat b
0
1
2
- next verify copy metadata is lost when disabled
$ hg strip -r . --config extensions.strip=
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg
Durham Goode
copy: add flag for disabling copy tracing...
r26013 $ hg up -qC 2
Pulkit Goyal
copytrace: replace experimental.disablecopytrace config with copytrace (BC)...
r34079 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.copytrace=off --config ui.interactive=True << EOF
Siddharth Agarwal
test-copy-move-merge.t: explicitly request changed version...
r27596 > c
> EOF
Durham Goode
copy: add flag for disabling copy tracing...
r26013 rebasing 2:add3f11052fa "other" (tip)
Pulkit Goyal
filemerge: fix the wrong placements of messages in prompt...
r39321 file 'a' was deleted in local [dest] but was modified in other [source].
Augie Fackler
merge: improve interactive one-changed one-deleted message (issue5550)...
r39313 What do you want to do?
Siddharth Agarwal
filemerge: add a 'leave unresolved' option to change/delete prompts...
r27163 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
Durham Goode
copy: add flag for disabling copy tracing...
r26013
$ cat b
1
2
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..
Durham Goode
copy: add flag for disabling copy tracing...
r26013
Verify disabling copy tracing still keeps copies from rebase source
$ hg init copydisable
$ cd copydisable
$ touch a
$ hg ci -Aqm 'add a'
$ touch b
$ hg ci -Aqm 'add b, c'
$ hg cp b x
$ echo x >> x
$ hg ci -qm 'copy b->x'
$ hg up -q 1
$ touch z
$ hg ci -Aqm 'add z'
$ hg log -G -T '{rev} {desc}\n'
@ 3 add z
|
| o 2 copy b->x
|/
o 1 add b, c
|
o 0 add a
Pulkit Goyal
copytrace: replace experimental.disablecopytrace config with copytrace (BC)...
r34079 $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.copytrace=off
Durham Goode
copy: add flag for disabling copy tracing...
r26013 rebasing 2:6adcf8c12e7d "copy b->x"
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-rebase.hg
Durham Goode
copy: add flag for disabling copy tracing...
r26013 $ hg up -q 3
$ hg log -f x -T '{rev} {desc}\n'
3 copy b->x
1 add b, c
$ cd ../
Verify we duplicate existing copies, instead of detecting them
$ hg init copydisable3
$ cd copydisable3
$ touch a
$ hg ci -Aqm 'add a'
$ hg cp a b
$ hg ci -Aqm 'copy a->b'
$ hg mv b c
$ hg ci -Aqm 'move b->c'
$ hg up -q 0
$ hg cp a b
$ echo b >> b
$ hg ci -Aqm 'copy a->b (2)'
$ hg log -G -T '{rev} {desc}\n'
@ 3 copy a->b (2)
|
| o 2 move b->c
| |
| o 1 copy a->b
|/
o 0 add a
Pulkit Goyal
copytrace: replace experimental.disablecopytrace config with copytrace (BC)...
r34079 $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.copytrace=off
Durham Goode
copy: add flag for disabling copy tracing...
r26013 rebasing 3:47e1a9e6273b "copy a->b (2)" (tip)
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-rebase.hg
Durham Goode
copy: add flag for disabling copy tracing...
r26013
$ hg log -G -f b
@ changeset: 3:76024fb4b05b
Martijn Pieters
graphmod: set default edge styles for ascii graphs (BC)...
r28627 : tag: tip
: user: test
: date: Thu Jan 01 00:00:00 1970 +0000
: summary: copy a->b (2)
:
Durham Goode
copy: add flag for disabling copy tracing...
r26013 o changeset: 0:ac82d8b1f7c4
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: add a