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

r34291:4f969b9e default
r39595:07b58266 default
Show More
test-bookmarks-rebase.t
105 lines | 2.4 KiB | text/troff | Tads3Lexer
/ tests / test-bookmarks-rebase.t
Martin Geisler
tests: unify test-bookmarks-rebase
r11863 $ echo "[extensions]" >> $HGRCPATH
$ echo "rebase=" >> $HGRCPATH
initialize repository
$ hg init
$ echo 'a' > a
$ hg ci -A -m "0"
adding a
$ echo 'b' > b
$ hg ci -A -m "1"
adding b
$ hg up 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo 'c' > c
$ hg ci -A -m "2"
adding c
created new head
$ echo 'd' > d
$ hg ci -A -m "3"
adding d
$ hg bookmark -r 1 one
$ hg bookmark -r 3 two
Sean Farley
bookmarks: fix bug that activated a bookmark even with -r passed...
r19112 $ hg up -q two
Martin Geisler
tests: unify test-bookmarks-rebase
r11863
bookmark list
$ hg bookmark
David Soria Parra
localrepo: sort hg bookmark output...
r13388 one 1:925d80f479bb
Martin Geisler
tests: unify test-bookmarks-rebase
r11863 * two 3:2ae46b1d99a7
rebase
Nicolas Dumazet
tests: use regular expressions instead of helpers
r11907 $ hg rebase -s two -d one
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 3:2ae46b1d99a7 "3" (two tip)
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/.hg/strip-backup/2ae46b1d99a7-e6b057bc-rebase.hg
Martin Geisler
tests: unify test-bookmarks-rebase
r11863
$ hg log
Pierre-Yves David
rebase: do not add second parent to rebased changeset (drop detach option) (BC)...
r17005 changeset: 3:42e5ed2cdcf4
David Soria Parra
templater: add bookmarks to templates and default output...
r13386 bookmark: two
Martin Geisler
tests: unify test-bookmarks-rebase
r11863 tag: tip
parent: 1:925d80f479bb
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 3
changeset: 2:db815d6d32e6
parent: 0:f7b1eb17ad24
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
changeset: 1:925d80f479bb
David Soria Parra
bookmarks: make track.current=True default behaviour and remove option (BC)
r13416 bookmark: one
Martin Geisler
tests: unify test-bookmarks-rebase
r11863 user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 1
changeset: 0:f7b1eb17ad24
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 0
Tony Tung
rebase: restore bookmark state on abort...
r24758 aborted rebase should restore active bookmark.
$ hg up 1
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(leaving bookmark two)
$ echo 'e' > d
$ hg ci -A -m "4"
adding d
created new head
$ hg bookmark three
$ hg rebase -s three -d two
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 4:dd7c838e8362 "4" (three tip)
Tony Tung
rebase: restore bookmark state on abort...
r24758 merging d
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
Tony Tung
rebase: restore bookmark state on abort...
r24758 unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
$ hg rebase --abort
rebase aborted
$ hg bookmark
one 1:925d80f479bb
* three 4:dd7c838e8362
two 3:42e5ed2cdcf4
Tony Tung
rebase: check that the bookmark is still valid when restoring (issue4669)...
r25101 after aborted rebase, restoring a bookmark that has been removed should not fail
$ hg rebase -s three -d two
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 4:dd7c838e8362 "4" (three tip)
Tony Tung
rebase: check that the bookmark is still valid when restoring (issue4669)...
r25101 merging d
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
Tony Tung
rebase: check that the bookmark is still valid when restoring (issue4669)...
r25101 unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
$ hg bookmark -d three
$ hg rebase --abort
rebase aborted
$ hg bookmark
one 1:925d80f479bb
two 3:42e5ed2cdcf4