HomePhabricator

ReceiveCommits: Fix setting [PRIVATE] and [WIP] for updated changes

Authored by David Pursehouse <dpursehouse@collab.net> on Dec 13 2018, 1:44 AM.

Description

ReceiveCommits: Fix setting [PRIVATE] and [WIP] for updated changes

When the private and/or work-in-progress state of a change is modified
by pushing for review using any of the %private, %remove-private, %wip
or %ready options, the change notes of the updated changes do not have
the new status. To work around this, the new private/WIP state is set
by checking for the relevant flags in the magic branch.

When none of the private/WIP options are given, i.e. the states are not
being set on push, the states are detected from the change notes of the
updated changes, which contain the current (correct, unchanged) states.

In the latter situation, the states are set from the notes of the first
updated change, but then reused for all subsequent updated changes. As
a result, if the first updated change is private, all subsequent changes
will also be reported with the [PRIVATE] suffix even when they are not
actually private. The same occurs for the [WIP] suffix.

Fix this by reevaluating the private and wip states for each updated
change.

Bug: Issue 9024
Change-Id: Ia9cec72cbc5d8820cd788f50239d19df6ee6f1dd

Event Timeline

David Pursehouse <dpursehouse@collab.net> committed rGERRITDEPLOY11cfda8dff46: ReceiveCommits: Fix setting [PRIVATE] and [WIP] for updated changes (authored by David Pursehouse <dpursehouse@collab.net>).Dec 13 2018, 7:05 AM