expose latest changeset id of branch

This commit is contained in:
Sebastian Sdorra
2015-06-13 19:56:16 +02:00
parent ee0278b893
commit 0f1ac3f952
3 changed files with 46 additions and 4 deletions

View File

@@ -30,10 +30,13 @@
*/
package sonia.scm.repository.spi;
//~--- non-JDK imports --------------------------------------------------------
import com.aragost.javahg.Changeset;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
@@ -92,7 +95,15 @@ public class HgBranchesCommand extends AbstractCommand
@Override
public Branch apply(com.aragost.javahg.commands.Branch hgBranch)
{
return new Branch(hgBranch.getName());
String node = null;
Changeset changeset = hgBranch.getBranchTip();
if (changeset != null)
{
node = changeset.getNode();
}
return new Branch(hgBranch.getName(), node);
}
});