public class ChangeMessagesUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AUTOGENERATED_TAG_PREFIX |
static String |
TAG_ABANDON |
static String |
TAG_CHERRY_PICK_CHANGE |
static String |
TAG_DELETE_ASSIGNEE |
static String |
TAG_DELETE_REVIEWER |
static String |
TAG_DELETE_VOTE |
static String |
TAG_MERGED |
static String |
TAG_MOVE |
static String |
TAG_RESTORE |
static String |
TAG_REVERT |
static String |
TAG_SET_ASSIGNEE |
static String |
TAG_SET_DESCRIPTION |
static String |
TAG_SET_HASHTAGS |
static String |
TAG_SET_PRIVATE |
static String |
TAG_SET_READY |
static String |
TAG_SET_TOPIC |
static String |
TAG_SET_WIP |
static String |
TAG_UNSET_PRIVATE |
static String |
TAG_UPLOADED_PATCH_SET |
static String |
TAG_UPLOADED_WIP_PATCH_SET |
Constructor and Description |
---|
ChangeMessagesUtil() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeMessage(ChangeUpdate update,
ChangeMessage changeMessage) |
List<ChangeMessage> |
byChange(ChangeNotes notes) |
static ChangeMessageInfo |
createChangeMessageInfo(ChangeMessage message,
AccountLoader accountLoader) |
static boolean |
isAutogenerated(String tag) |
static ChangeMessage |
newMessage(ChangeContext ctx,
String body,
String tag) |
static ChangeMessage |
newMessage(PatchSet.Id psId,
CurrentUser user,
Timestamp when,
String body,
String tag) |
void |
replaceChangeMessage(ChangeUpdate update,
String targetMessageId,
String newMessage)
Replace an existing change message with the provided new message.
|
static String |
uploadedPatchSetTag(boolean workInProgress) |
public static final String AUTOGENERATED_TAG_PREFIX
public static final String TAG_ABANDON
public static final String TAG_CHERRY_PICK_CHANGE
public static final String TAG_DELETE_ASSIGNEE
public static final String TAG_DELETE_REVIEWER
public static final String TAG_DELETE_VOTE
public static final String TAG_MERGED
public static final String TAG_MOVE
public static final String TAG_RESTORE
public static final String TAG_REVERT
public static final String TAG_SET_ASSIGNEE
public static final String TAG_SET_DESCRIPTION
public static final String TAG_SET_HASHTAGS
public static final String TAG_SET_PRIVATE
public static final String TAG_SET_READY
public static final String TAG_SET_TOPIC
public static final String TAG_SET_WIP
public static final String TAG_UNSET_PRIVATE
public static final String TAG_UPLOADED_PATCH_SET
public static final String TAG_UPLOADED_WIP_PATCH_SET
public static ChangeMessage newMessage(ChangeContext ctx, String body, String tag)
public static ChangeMessage newMessage(PatchSet.Id psId, CurrentUser user, Timestamp when, String body, String tag)
public static String uploadedPatchSetTag(boolean workInProgress)
public List<ChangeMessage> byChange(ChangeNotes notes)
public void addChangeMessage(ChangeUpdate update, ChangeMessage changeMessage)
public void replaceChangeMessage(ChangeUpdate update, String targetMessageId, String newMessage)
The ID of a change message is different between NoteDb and ReviewDb. In NoteDb, it's the commit SHA-1, but in ReviewDb it was generated randomly. Taking the target message as an index rather than an ID allowed us to delete the message from both NoteDb and ReviewDb.
update
- change update.targetMessageId
- the id of the target change message.newMessage
- the new message which is going to replace the old.public static boolean isAutogenerated(String tag)
tag
- value of a tag, or null.public static ChangeMessageInfo createChangeMessageInfo(ChangeMessage message, AccountLoader accountLoader)