Skip to content

Commit

Permalink
series: Update the number of patches when resending full new series
Browse files Browse the repository at this point in the history
I can't believe it took 3 tries to properly test this. When resending
a full series, we actually want to update n_patches of the new revision
we are creating, because the new series can have any number of patches.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
  • Loading branch information
Damien Lespiau committed Feb 10, 2016
1 parent 9771c34 commit 728795f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions patchwork/bin/parsemail.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ def on_revision_complete(sender, revision, **kwargs):
new_revision = previous_series.latest_revision().duplicate_meta()
new_revision.root_msgid = revision.root_msgid
new_revision.cover_letter = revision.cover_letter
new_revision.n_patches = revision.n_patches
new_revision.save()
i = 1
for patch in revision.ordered_patches():
Expand Down
1 change: 1 addition & 0 deletions patchwork/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ def check_revision(self, series, revision, mails, ref_n_patches):
self.assertEquals(revision.series_id, series.id)
self.assertEquals(revision.root_msgid, mails[0].get('Message-Id'))
self.assertEquals(revision.patches.count(), n_patches)
self.assertEquals(revision.n_patches, n_patches)

i = 1 if self.has_cover_letter else 0
for patch in revision.ordered_patches():
Expand Down

0 comments on commit 728795f

Please sign in to comment.