From 856c8a2ad521064d69b2b50003c1df382d375013 Mon Sep 17 00:00:00 2001
From: Marcin Floryan <marcin.floryan@gmail.com>
Date: Sat, 03 Nov 2012 15:15:22 -0400
Subject: [PATCH] Download progress - CR character behaves as expected on Windows but not on other platforms.
---
src/com/gitblit/models/FederationModel.java | 27 +++++++++------------------
1 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/src/com/gitblit/models/FederationModel.java b/src/com/gitblit/models/FederationModel.java
index 017c2e0..1d211ce 100644
--- a/src/com/gitblit/models/FederationModel.java
+++ b/src/com/gitblit/models/FederationModel.java
@@ -45,6 +45,10 @@
public String frequency;
public String folder;
+
+ public boolean bare;
+
+ public boolean mirror;
public boolean mergeAccounts;
@@ -69,6 +73,8 @@
*/
public FederationModel(String serverName) {
this.name = serverName;
+ bare = true;
+ mirror = true;
this.lastPull = new Date(0);
this.nextPull = new Date(0);
}
@@ -108,7 +114,7 @@
* @param status
*/
public void updateStatus(RepositoryModel repository, FederationPullStatus status) {
- if (!results.containsKey(repository)) {
+ if (!results.containsKey(repository.name)) {
results.put(repository.name, FederationPullStatus.PENDING);
}
if (status != null) {
@@ -134,7 +140,7 @@
if (results.size() == 0) {
return FederationPullStatus.PENDING;
}
- FederationPullStatus status = FederationPullStatus.PULLED;
+ FederationPullStatus status = FederationPullStatus.MIRRORED;
for (FederationPullStatus result : results.values()) {
if (result.ordinal() < status.ordinal()) {
status = result;
@@ -192,22 +198,7 @@
@Override
public int compareTo(RepositoryStatus o) {
if (status.equals(o.status)) {
- // sort root repositories first, alphabetically
- // then sort grouped repositories, alphabetically
- int s1 = name.indexOf('/');
- int s2 = o.name.indexOf('/');
- if (s1 == -1 && s2 == -1) {
- // neither grouped
- return name.compareTo(o.name);
- } else if (s1 > -1 && s2 > -1) {
- // both grouped
- return name.compareTo(o.name);
- } else if (s1 == -1) {
- return -1;
- } else if (s2 == -1) {
- return 1;
- }
- return 0;
+ return StringUtils.compareRepositoryNames(name, o.name);
}
return status.compareTo(o.status);
}
--
Gitblit v1.9.1