Read last commit date for hg branches

This commit is contained in:
René Pfeuffer
2020-11-23 15:21:59 +01:00
parent f0f7ddc444
commit 4d4f89dc7e
2 changed files with 5 additions and 4 deletions

View File

@@ -79,10 +79,11 @@ public class HgBranchesCommand extends AbstractCommand
node = changeset.getNode();
}
long lastCommitDate = changeset.getTimestamp().getDate().getTime();
if (DEFAULT_BRANCH_NAME.equals(hgBranch.getName())) {
return Branch.defaultBranch(hgBranch.getName(), node);
return Branch.defaultBranch(hgBranch.getName(), node, lastCommitDate);
} else {
return Branch.normalBranch(hgBranch.getName(), node);
return Branch.normalBranch(hgBranch.getName(), node, lastCommitDate);
}
}
});

View File

@@ -42,8 +42,8 @@ public class HgBranchesCommandTest extends AbstractHgCommandTestBase {
List<Branch> branches = command.getBranches();
assertThat(branches).contains(
defaultBranch("default", "2baab8e80280ef05a9aa76c49c76feca2872afb7"),
normalBranch("test-branch", "79b6baf49711ae675568e0698d730b97ef13e84a")
defaultBranch("default", "2baab8e80280ef05a9aa76c49c76feca2872afb7", 1339586381000L),
normalBranch("test-branch", "79b6baf49711ae675568e0698d730b97ef13e84a", 1339586299000L)
);
}
}