unsupportedOperationNotAddAtEnd=Not add-at-end: {0}
unsupportedPackIndexVersion=Unsupported pack index version {0}
unsupportedPackVersion=Unsupported pack version {0}.
+updatingReferences=Updating references
updatingRefFailed=Updating the ref {0} to {1} failed. ReturnCode from RefUpdate.update() was {2}
uriNotFound={0} not found
userConfigFileInvalid=User config file {0} invalid {1}
/***/ public String unsupportedOperationNotAddAtEnd;
/***/ public String unsupportedPackIndexVersion;
/***/ public String unsupportedPackVersion;
+ /***/ public String updatingReferences;
/***/ public String updatingRefFailed;
/***/ public String uriNotFound;
/***/ public String userConfigFileInvalid;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.NotSupportedException;
import org.eclipse.jgit.errors.TransportException;
+import org.eclipse.jgit.lib.BatchingProgressMonitor;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ProgressMonitor;
final RevWalk walk = new RevWalk(transport.local);
try {
+ if (monitor instanceof BatchingProgressMonitor) {
+ ((BatchingProgressMonitor) monitor).setDelayStart(
+ 250, TimeUnit.MILLISECONDS);
+ }
+ monitor.beginTask(JGitText.get().updatingReferences, localUpdates.size());
if (transport.isRemoveDeletedRefs())
deleteStaleTrackingRefs(result, walk);
for (TrackingRefUpdate u : localUpdates) {
try {
+ monitor.update(1);
u.update(walk);
result.add(u);
} catch (IOException err) {
u.getLocalName(), err.getMessage()), err);
}
}
+ monitor.endTask();
} finally {
walk.release();
}
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.errors.MissingObjectException;
private void executeCommands() {
preReceive.onPreReceive(this, filterCommands(Result.NOT_ATTEMPTED));
- for (final ReceiveCommand cmd : filterCommands(Result.NOT_ATTEMPTED))
+
+ List<ReceiveCommand> toApply = filterCommands(Result.NOT_ATTEMPTED);
+ ProgressMonitor updating = NullProgressMonitor.INSTANCE;
+ if (sideBand) {
+ SideBandProgressMonitor pm = new SideBandProgressMonitor(msgOut);
+ pm.setDelayStart(250, TimeUnit.MILLISECONDS);
+ updating = pm;
+ }
+ updating.beginTask(JGitText.get().updatingReferences, toApply.size());
+ for (ReceiveCommand cmd : toApply) {
+ updating.update(1);
execute(cmd);
+ }
+ updating.endTask();
}
private void execute(final ReceiveCommand cmd) {