Fix: Reverting a change does not preserve the change's topic
When reverting a change in the UI, set the revert change's topic to the same as the change being reverted. Bug: Issue 1664 Change-Id: I8d225a1ec1da759877846fd37fc3611ca17a4545
This commit is contained in:
@@ -190,10 +190,11 @@ public class ChangeUtil {
|
||||
if (patch == null) {
|
||||
throw new NoSuchChangeException(changeId);
|
||||
}
|
||||
final Change changeToRevert = db.changes().get(changeId);
|
||||
|
||||
final Repository git;
|
||||
try {
|
||||
git = gitManager.openRepository(db.changes().get(changeId).getProject());
|
||||
git = gitManager.openRepository(changeToRevert.getProject());
|
||||
} catch (RepositoryNotFoundException e) {
|
||||
throw new NoSuchChangeException(changeId, e);
|
||||
}
|
||||
@@ -234,8 +235,9 @@ public class ChangeUtil {
|
||||
new Change.Key("I" + computedChangeId.name()),
|
||||
new Change.Id(db.nextChangeId()),
|
||||
user.getAccountId(),
|
||||
db.changes().get(changeId).getDest());
|
||||
changeToRevert.getDest());
|
||||
change.nextPatchSetId();
|
||||
change.setTopic(changeToRevert.getTopic());
|
||||
|
||||
final PatchSet ps = new PatchSet(change.currPatchSetId());
|
||||
ps.setCreatedOn(change.getCreatedOn());
|
||||
|
Reference in New Issue
Block a user