reviewboard: add test for pushing to a discarded series; r?smacleod
We didn't have explicit test coverage of this before.
--- a/hgext/reviewboard/tests/test-review-request-closed-discarded.t
+++ b/hgext/reviewboard/tests/test-review-request-closed-discarded.t
@@ -687,12 +687,240 @@ The attachment for the review request sh
component: TestComponent
depends_on: []
platform: All
product: TestProduct
resolution: ''
status: NEW
summary: summary
+Pushing to a discarded review series will create a new series
+
+ $ rbmanage closediscarded 1
+
+ $ echo foo3 > foo
+ $ hg commit -m 'Bug 1 - Foo 3'
+ $ hg push
+ pushing to ssh://*:$HGPORT6/test-repo (glob)
+ searching for changes
+ remote: adding changesets
+ remote: adding manifests
+ remote: adding file changes
+ remote: added 1 changesets with 1 changes to 1 files
+ remote: recorded push in pushlog
+ submitting 3 changesets for review
+
+ changeset: 1:a92d53c0ffc7
+ summary: Bug 1 - Foo 1
+ review: http://*:$HGPORT1/r/5 (draft) (glob)
+
+ changeset: 2:233b570e5356
+ summary: Bug 1 - Foo 2
+ review: http://*:$HGPORT1/r/6 (draft) (glob)
+
+ changeset: 3:4cb601f74de5
+ summary: Bug 1 - Foo 3
+ review: http://*:$HGPORT1/r/7 (draft) (glob)
+
+ review id: bz://1/mynick
+ review url: http://*:$HGPORT1/r/4 (draft) (glob)
+ (review requests lack reviewers; visit review url to assign reviewers)
+ (visit review url to publish these review requests so others can see them)
+
+ $ rbmanage publish 4
+
+ $ rbmanage dumpreview 1
+ id: 1
+ status: discarded
+ public: true
+ bugs:
+ - '1'
+ commit: null
+ submitter: default+5
+ summary: bz://1/mynick
+ description: This is the parent review request
+ target_people: []
+ extra_data:
+ calculated_trophies: true
+ p2rb: true
+ p2rb.base_commit: 7c5bdf0cec4a90edb36300f8f3679857f46db829
+ p2rb.commits: '[["a92d53c0ffc7df0517397a77980e62332552d812", 2], ["233b570e5356d0c84bcbf0633de446172012b3b3",
+ 3]]'
+ p2rb.discard_on_publish_rids: '[]'
+ p2rb.first_public_ancestor: 7c5bdf0cec4a90edb36300f8f3679857f46db829
+ p2rb.identifier: bz://1/mynick
+ p2rb.is_squashed: true
+ p2rb.reviewer_map: '{}'
+ p2rb.unpublished_rids: '[]'
+ diffs:
+ - id: 1
+ revision: 1
+ base_commit_id: 7c5bdf0cec4a90edb36300f8f3679857f46db829
+ name: diff
+ extra: {}
+ patch:
+ - diff --git a/foo b/foo
+ - '--- a/foo'
+ - +++ b/foo
+ - '@@ -1,1 +1,1 @@'
+ - -foo0
+ - +foo2
+ - ''
+ approved: false
+ approval_failure: Commit a92d53c0ffc7df0517397a77980e62332552d812 is not approved.
+
+ $ rbmanage dumpreview 4
+ id: 4
+ status: pending
+ public: true
+ bugs:
+ - '1'
+ commit: bz://1/mynick
+ submitter: default+5
+ summary: bz://1/mynick
+ description: This is the parent review request
+ target_people: []
+ extra_data:
+ calculated_trophies: true
+ p2rb: true
+ p2rb.base_commit: 7c5bdf0cec4a90edb36300f8f3679857f46db829
+ p2rb.commits: '[["a92d53c0ffc7df0517397a77980e62332552d812", 5], ["233b570e5356d0c84bcbf0633de446172012b3b3",
+ 6], ["4cb601f74de529935048816623637fb0ca2812a4", 7]]'
+ p2rb.discard_on_publish_rids: '[]'
+ p2rb.first_public_ancestor: 7c5bdf0cec4a90edb36300f8f3679857f46db829
+ p2rb.identifier: bz://1/mynick
+ p2rb.is_squashed: true
+ p2rb.reviewer_map: '{}'
+ p2rb.unpublished_rids: '[]'
+ diffs:
+ - id: 4
+ revision: 1
+ base_commit_id: 7c5bdf0cec4a90edb36300f8f3679857f46db829
+ name: diff
+ extra: {}
+ patch:
+ - diff --git a/foo b/foo
+ - '--- a/foo'
+ - +++ b/foo
+ - '@@ -1,1 +1,1 @@'
+ - -foo0
+ - +foo3
+ - ''
+ approved: false
+ approval_failure: Commit a92d53c0ffc7df0517397a77980e62332552d812 is not approved.
+
+ $ bugzilla dump-bug 1
+ Bug 1:
+ attachments:
+ - attacher: default@example.com
+ content_type: text/x-review-board-request
+ data: http://*:$HGPORT1/r/2/diff/#index_header (glob)
+ description: 'MozReview Request: Bug 1 - Foo 1'
+ file_name: reviewboard-2-url.txt
+ flags: []
+ id: 1
+ is_obsolete: true
+ is_patch: false
+ summary: 'MozReview Request: Bug 1 - Foo 1'
+ - attacher: default@example.com
+ content_type: text/x-review-board-request
+ data: http://*:$HGPORT1/r/3/diff/#index_header (glob)
+ description: 'MozReview Request: Bug 1 - Foo 2'
+ file_name: reviewboard-3-url.txt
+ flags: []
+ id: 2
+ is_obsolete: true
+ is_patch: false
+ summary: 'MozReview Request: Bug 1 - Foo 2'
+ - attacher: default@example.com
+ content_type: text/x-review-board-request
+ data: http://*:$HGPORT1/r/5/diff/#index_header (glob)
+ description: 'MozReview Request: Bug 1 - Foo 1'
+ file_name: reviewboard-5-url.txt
+ flags: []
+ id: 3
+ is_obsolete: false
+ is_patch: false
+ summary: 'MozReview Request: Bug 1 - Foo 1'
+ - attacher: default@example.com
+ content_type: text/x-review-board-request
+ data: http://*:$HGPORT1/r/6/diff/#index_header (glob)
+ description: 'MozReview Request: Bug 1 - Foo 2'
+ file_name: reviewboard-6-url.txt
+ flags: []
+ id: 4
+ is_obsolete: false
+ is_patch: false
+ summary: 'MozReview Request: Bug 1 - Foo 2'
+ - attacher: default@example.com
+ content_type: text/x-review-board-request
+ data: http://*:$HGPORT1/r/7/diff/#index_header (glob)
+ description: 'MozReview Request: Bug 1 - Foo 3'
+ file_name: reviewboard-7-url.txt
+ flags: []
+ id: 5
+ is_obsolete: false
+ is_patch: false
+ summary: 'MozReview Request: Bug 1 - Foo 3'
+ blocks: []
+ cc: []
+ comments:
+ - author: default@example.com
+ id: 1
+ tags: []
+ text: ''
+ - author: default@example.com
+ id: 2
+ tags: []
+ text:
+ - Created attachment 1
+ - 'MozReview Request: Bug 1 - Foo 1'
+ - ''
+ - 'Review commit: http://*:$HGPORT1/r/2/diff/#index_header' (glob)
+ - 'See other reviews: http://*:$HGPORT1/r/2/' (glob)
+ - author: default@example.com
+ id: 3
+ tags: []
+ text:
+ - Created attachment 2
+ - 'MozReview Request: Bug 1 - Foo 2'
+ - ''
+ - 'Review commit: http://*:$HGPORT1/r/3/diff/#index_header' (glob)
+ - 'See other reviews: http://*:$HGPORT1/r/3/' (glob)
+ - author: default@example.com
+ id: 4
+ tags: []
+ text:
+ - Created attachment 3
+ - 'MozReview Request: Bug 1 - Foo 1'
+ - ''
+ - 'Review commit: http://*:$HGPORT1/r/5/diff/#index_header' (glob)
+ - 'See other reviews: http://*:$HGPORT1/r/5/' (glob)
+ - author: default@example.com
+ id: 5
+ tags: []
+ text:
+ - Created attachment 4
+ - 'MozReview Request: Bug 1 - Foo 2'
+ - ''
+ - 'Review commit: http://*:$HGPORT1/r/6/diff/#index_header' (glob)
+ - 'See other reviews: http://*:$HGPORT1/r/6/' (glob)
+ - author: default@example.com
+ id: 6
+ tags: []
+ text:
+ - Created attachment 5
+ - 'MozReview Request: Bug 1 - Foo 3'
+ - ''
+ - 'Review commit: http://*:$HGPORT1/r/7/diff/#index_header' (glob)
+ - 'See other reviews: http://*:$HGPORT1/r/7/' (glob)
+ component: TestComponent
+ depends_on: []
+ platform: All
+ product: TestProduct
+ resolution: ''
+ status: NEW
+ summary: summary
+
Cleanup
$ mozreview stop
stopped 10 containers