Use abbreviated Change-Id in merge messages

Instead of recording the internal database sequence number, record
the abbreviation we show in the UI, and that we want users to use
for searching in the future as try to move to a distributed database.

Change-Id: I2174616287e6404f2c115ac5c64c327f24f0a343
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-09-28 07:49:34 -07:00
parent 3e50777617
commit a0055ecf6a

View File

@@ -442,9 +442,8 @@ public class MergeOp {
final StringBuilder msgbuf = new StringBuilder();
if (merged.size() == 1) {
final CodeReviewCommit c = merged.get(0);
final Change.Id changeId = c.patchsetId.getParentKey();
msgbuf.append("Merge change ");
msgbuf.append(changeId);
msgbuf.append(c.changeKey.abbreviate());
} else {
final ArrayList<CodeReviewCommit> o;
o = new ArrayList<CodeReviewCommit>(merged);
@@ -458,8 +457,7 @@ public class MergeOp {
msgbuf.append("Merge changes ");
for (final Iterator<CodeReviewCommit> i = o.iterator(); i.hasNext();) {
final Change.Id id = i.next().patchsetId.getParentKey();
msgbuf.append(id);
msgbuf.append(i.next().changeKey.abbreviate());
if (i.hasNext()) {
msgbuf.append(',');
}