Skip to content

Commit

Permalink
Merge branch 'develop' into feature/hg_hooks_over_tcp
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
sdorra committed Nov 27, 2020
2 parents 3e19f28 + aaeeed0 commit 8ee8c8b
Show file tree
Hide file tree
Showing 68 changed files with 1,135 additions and 402 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,9 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Added
- Add tooltips to short links on repository overview ([#1441](https://github.com/scm-manager/scm-manager/pull/1441))
- Show the date of the last commit for branches in the frontend ([#1439](https://github.com/scm-manager/scm-manager/pull/1439))
- Unify and add description to key view across user settings ([#1440](https://github.com/scm-manager/scm-manager/pull/1440))

### Changed
- Send mercurial hook callbacks over separate tcp socket instead of http ([#1416](https://github.com/scm-manager/scm-manager/pull/1416))

## [2.10.1] - 2020-11-24
### Fixed
- Improved logging of failures during plugin installation ([#1442](https://github.com/scm-manager/scm-manager/pull/1442))
- Do not throw exception when plugin file does not exist on cancelled installation ([#1442](https://github.com/scm-manager/scm-manager/pull/1442))

## [2.10.0] - 2020-11-20
### Added
- Delete branches directly in the UI ([#1422](https://github.com/scm-manager/scm-manager/pull/1422))
Expand Down Expand Up @@ -419,3 +430,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[2.6.3]: https://www.scm-manager.org/download/2.6.3
[2.7.0]: https://www.scm-manager.org/download/2.7.0
[2.7.1]: https://www.scm-manager.org/download/2.7.1
[2.8.0]: https://www.scm-manager.org/download/2.8.0
[2.9.0]: https://www.scm-manager.org/download/2.9.0
[2.9.1]: https://www.scm-manager.org/download/2.9.1
[2.10.0]: https://www.scm-manager.org/download/2.10.0
[2.10.1]: https://www.scm-manager.org/download/2.10.1
Binary file modified docs/de/user/profile/assets/api-key-overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/de/user/profile/index.md
Expand Up @@ -13,7 +13,7 @@ eingegeben werden. Danach muss das neue Passwort zweimal eingegeben werden.

## Öffentliche Schlüssel

Zum Prüfen von Signaturen für z. B. Commits können hier die entsprechenden öffentlichen Schlüssel hinterlegt werden.
Zum Prüfen von Signaturen für z. B. Commits können hier die entsprechenden öffentlichen GPG Schlüssel hinterlegt werden.
Zudem können hier die vom SCM-Manager erstellten Signaturschlüssel heruntergeladen werden.

## API Schlüssel
Expand Down
Binary file modified docs/de/user/repo/assets/repository-branch-detailView.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/de/user/repo/assets/repository-branches-overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/de/user/repo/assets/repository-overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions docs/de/user/repo/branches.md
Expand Up @@ -3,9 +3,11 @@ title: Repository
subtitle: Branches
---
### Übersicht
Auf der Branches-Übersicht sind die bereits existierenden Branches aufgeführt. Bei einem Klick auf einen Branch wird man zur Detailseite des Branches weitergeleitet.
Auf der Branches-Übersicht sind die bereits existierenden Branches aufgeführt. Bei einem Klick auf einen Branch wird man zur Detailseite des Branches weitergeleitet.
Die Branches sind in zwei Listen aufgeteilt: Unter "Aktive Branches" sind Branches aufgelistet, deren letzter Commit
nicht 30 Tage älter als der Stand des Default-Branches ist. Alle älteren Branches sind in der Liste "Stale Branches" zu finden.

Der Tag "Default" gibt an welcher Branch aktuell, als Standard-Branch dieses Repository im SCM-Manager markiert ist. Der Standard-Branch wird immer zuerst angezeigt, wenn man das Repository im SCM-Manager öffnet.
Der Tag "Default" gibt an, welcher Branch aktuell als Standard-Branch dieses Repository im SCM-Manager markiert ist. Der Standard-Branch wird immer zuerst angezeigt, wenn man das Repository im SCM-Manager öffnet.
Alle Branches mit Ausnahme des Default Branches können über den Mülleimer-Icon unwiderruflich gelöscht werden.

Über den "Branch erstellen"-Button gelangt man zum Formular, um neue Branches anzulegen.
Expand Down
Binary file modified docs/de/user/user/assets/user-information.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/de/user/user/assets/user-settings-general.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/de/user/user/assets/user-settings-publickeys.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en/user/profile/assets/api-key-overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/en/user/profile/index.md
Expand Up @@ -11,9 +11,9 @@ Here the password for the current account can be changed when it is a local acco
external system). To authorize the change, the current password has to be put first. Then the new password has to be
entered twice.

## Öffentliche Schlüssel
## Public Keys

To check signatures for example for commits, public keys can be stored here. Additionally the keys created by
To check signatures (for example for commits), gpg public keys can be stored here. Additionally the keys created by
SCM-Manager can be accessed here, too.

## API keys
Expand Down
Binary file modified docs/en/user/repo/assets/repository-branch-detailView.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en/user/repo/assets/repository-branches-overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en/user/repo/assets/repository-overview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/en/user/repo/branches.md
Expand Up @@ -4,6 +4,8 @@ subtitle: Branches
---
### Overview
The branches overview shows the branches that are already existing. By clicking on a branch, the details page of the branch is shown.
Branches are split into two lists: Branches whose last commits are at most 30 days older than the head of the default
branch are listed in "Active Branches". The older ones can be found in "Stale Branches".

The tag "Default" shows which branch is currently set as the default branch of the repository in SCM-Manager. The default branch is always shown first when opening the repository in SCM-Manager.
All branches except the default branch of the repository can be deleted by clicking on the trash bin icon.
Expand Down
Binary file modified docs/en/user/user/assets/user-information.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en/user/user/assets/user-settings-general.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en/user/user/assets/user-settings-publickeys.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -580,7 +580,7 @@
<plugin>
<groupId>sonia.scm.maven</groupId>
<artifactId>smp-maven-plugin</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
</plugin>

<plugin>
Expand Down Expand Up @@ -903,7 +903,7 @@

<properties>
<!-- test libraries -->
<mockito.version>3.5.15</mockito.version>
<mockito.version>3.6.0</mockito.version>
<hamcrest.version>2.1</hamcrest.version>
<junit.version>5.7.0</junit.version>

Expand Down Expand Up @@ -937,7 +937,7 @@
<svnkit.version>1.10.1-scm2</svnkit.version>

<!-- util libraries -->
<guava.version>26.0-jre</guava.version>
<guava.version>30.0-jre</guava.version>

<!-- frontend -->
<nodejs.version>12.16.1</nodejs.version>
Expand Down
136 changes: 74 additions & 62 deletions scm-core/src/main/java/sonia/scm/repository/Branch.java
Expand Up @@ -24,8 +24,6 @@

package sonia.scm.repository;

//~--- non-JDK imports --------------------------------------------------------

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import sonia.scm.Validateable;
Expand All @@ -34,10 +32,9 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.util.Optional;
import java.util.regex.Pattern;

//~--- JDK imports ------------------------------------------------------------

/**
* Represents a branch in a repository.
*
Expand All @@ -46,122 +43,132 @@
*/
@XmlRootElement(name = "branch")
@XmlAccessorType(XmlAccessType.FIELD)
public final class Branch implements Serializable, Validateable
{
public final class Branch implements Serializable, Validateable {

private static final String VALID_CHARACTERS_AT_START_AND_END = "\\w-,;\\]{}@&+=$#`|<>";
private static final String VALID_CHARACTERS = VALID_CHARACTERS_AT_START_AND_END + "/.";
public static final String VALID_BRANCH_NAMES = "[" + VALID_CHARACTERS_AT_START_AND_END + "]([" + VALID_CHARACTERS + "]*[" + VALID_CHARACTERS_AT_START_AND_END + "])?";
public static final Pattern VALID_BRANCH_NAME_PATTERN = Pattern.compile(VALID_BRANCH_NAMES);

/** Field description */
private static final long serialVersionUID = -4602244691711222413L;

//~--- constructors ---------------------------------------------------------
private String name;

private String revision;

private boolean defaultBranch;

private Long lastCommitDate;

private boolean stale = false;

/**
* Constructs a new instance of branch.
* This constructor should only be called from JAXB.
*
*/
Branch() {}

/**
* Constructs a new branch.
*
* @param name name of the branch
* @param revision latest revision of the branch
* @param defaultBranch Whether this branch is the default branch for the repository
*
* @deprecated Use {@link Branch#Branch(String, String, boolean, Long)} instead.
*/
@Deprecated
Branch(String name, String revision, boolean defaultBranch) {
this(name, revision, defaultBranch, null);
}

/**
* Constructs a new branch.
*
* @param name name of the branch
* @param revision latest revision of the branch
* @param defaultBranch Whether this branch is the default branch for the repository
* @param lastCommitDate The date of the commit this branch points to (if computed). May be <code>null</code>
*/
Branch(String name, String revision, boolean defaultBranch)
{
Branch(String name, String revision, boolean defaultBranch, Long lastCommitDate) {
this.name = name;
this.revision = revision;
this.defaultBranch = defaultBranch;
this.lastCommitDate = lastCommitDate;
}

/**
* @deprecated Use {@link #normalBranch(String, String, Long)} instead to set the date of the last commit, too.
*/
@Deprecated
public static Branch normalBranch(String name, String revision) {
return new Branch(name, revision, false);
return normalBranch(name, revision, null);
}

public static Branch normalBranch(String name, String revision, Long lastCommitDate) {
return new Branch(name, revision, false, lastCommitDate);
}

/**
* @deprecated Use {@link #defaultBranch(String, String, Long)} instead to set the date of the last commit, too.
*/
@Deprecated
public static Branch defaultBranch(String name, String revision) {
return new Branch(name, revision, true);
return defaultBranch(name, revision, null);
}

//~--- methods --------------------------------------------------------------
public static Branch defaultBranch(String name, String revision, Long lastCommitDate) {
return new Branch(name, revision, true, lastCommitDate);
}

public void setStale(boolean stale) {
this.stale = stale;
}

@Override
public boolean isValid() {
return VALID_BRANCH_NAME_PATTERN.matcher(name).matches();
}

/**
* {@inheritDoc}
*
*
* @param obj
*
* @return
*/
@Override
public boolean equals(Object obj)
{
if (obj == null)
{
public boolean equals(Object obj) {
if (obj == null) {
return false;
}

if (getClass() != obj.getClass())
{
if (getClass() != obj.getClass()) {
return false;
}

final Branch other = (Branch) obj;

return Objects.equal(name, other.name)
&& Objects.equal(revision, other.revision)
&& Objects.equal(defaultBranch, other.defaultBranch);
&& Objects.equal(defaultBranch, other.defaultBranch)
&& Objects.equal(lastCommitDate, other.lastCommitDate);
}

/**
* {@inheritDoc}
*
*
* @return
*/
@Override
public int hashCode()
{
public int hashCode() {
return Objects.hashCode(name, revision);
}

/**
* {@inheritDoc}
*
*
* @return
*/
@Override
public String toString()
{
//J-
public String toString() {
return MoreObjects.toStringHelper(this)
.add("name", name)
.add("revision", revision)
.add("defaultBranch", defaultBranch)
.add("lastCommitDate", lastCommitDate)
.toString();
//J+
}

//~--- get methods ----------------------------------------------------------

/**
* Returns the name of the branch
*
*
* @return name of the branch
*/
public String getName()
{
public String getName() {
return name;
}

Expand All @@ -170,22 +177,27 @@ public String getName()
*
* @return latest revision of branch
*/
public String getRevision()
{
public String getRevision() {
return revision;
}

/**
* Flag whether this branch is configured as the default branch.
*/
public boolean isDefaultBranch() {
return defaultBranch;
}

//~--- fields ---------------------------------------------------------------

/** name of the branch */
private String name;

/** Field description */
private String revision;
/**
* The date of the commit this branch points to, if this was computed (can be empty).
*
* @since 2.11.0
*/
public Optional<Long> getLastCommitDate() {
return Optional.ofNullable(lastCommitDate);
}

private boolean defaultBranch;
public boolean isStale() {
return stale;
}
}

0 comments on commit 8ee8c8b

Please sign in to comment.