Support topic branch tags on changes

The topic tag can be attached to a change during upload by suffixing
the 'refs/for/branch_name' with the topic label, treating the branch
as though it were a directory.

For example, to tag 'exp/nosql' onto a change headed for the
'sandbox/future-stuff' branch, git push can be used as:

  git push URL HEAD:refs/for/sandbox/future-stuff/exp-nosql

If the topic is supplied, it is displayed in the branch column of
a change, in parens.  If no topic was set, only the branch is shown.

Bug: issue 51
Change-Id: I07d6c137fc9aefa8c1ee1652bf1e7bcde9d33674
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-07-15 12:24:11 -07:00
parent 72fc9bb5a8
commit d50c94e759
11 changed files with 129 additions and 40 deletions

View File

@@ -27,6 +27,7 @@ public class ChangeInfo {
protected Change.Status status;
protected ProjectInfo project;
protected String branch;
protected String topic;
protected boolean starred;
protected Timestamp lastUpdatedOn;
protected String sortKey;
@@ -42,6 +43,7 @@ public class ChangeInfo {
status = c.getStatus();
project = new ProjectInfo(c.getProject());
branch = c.getDest().getShortName();
topic = c.getTopic();
lastUpdatedOn = c.getLastUpdatedOn();
sortKey = c.getSortKey();
}
@@ -74,6 +76,10 @@ public class ChangeInfo {
return branch;
}
public String getTopic() {
return topic;
}
public boolean isStarred() {
return starred;
}