Skip to content

Commit

Permalink
2023.1 Code Drop
Browse files Browse the repository at this point in the history
  • Loading branch information
ajindal-mdx committed Feb 14, 2024
1 parent 9438607 commit aea150e
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 37 deletions.
75 changes: 46 additions & 29 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Release Notes for
P4Java, the Perforce Java API

Version 2023.1
Version 2023.2

Introduction

Expand Down Expand Up @@ -123,78 +123,95 @@ Known Limitations
* P4Java would not support file operations on altsync enabled clients.

-------------------------------------------
Updates in 2023.2 (2023.2/2542382) (2024/01/16)

#2529385, #2525471 (Job #117013)
Added support for 'Support Traits Depot' feature for attribute command

#2529385, #2525471 (Job #117014)
Added support for 'Support Traits Depot' feature for fstat command

#2535863 (Job #115952)
Raised distinct exceptions for Server Resource Pressure commands

#2532392, #2536740 (Job #117017)
Added support for --viewmatch argument in streams command

-------------------------------------------
Updates in 2023.1 (2023.1/2512805) (2023/11/01)

#2497593, #2509668, #2502386 (Job #116934)
Added support for the updated client spec in the 2023.1 Helix Core
server release.
Added support for the updated client spec in the 2023.1 Helix Core
server release.

-------------------------------------------
Updates in 2022.2 (2022.2/2444480) (2023/05/23)

#2435337 (Job #114238)
Enhanced functionality of p4 print command with the addition of
--offset and --size options.
Enhanced functionality of p4 print command with the addition of
--offset and --size options.

#2426294 (Job #114313)
Added support for 'MaxMemory' in the group spec.
Added support for 'MaxMemory' in the group spec.

#2439567, #2443196 (Job #114313)
Added support for 'Components' in the stream spec.
Added support for 'Components' in the stream spec.

-------------------------------------------
Updates in 2022.1 Patch 2 (2022.1/2423241) (2023/03/28)

#2421117 (Job #112706)
Fixed a bug where P4Java failed to update the sync time in db.have
during a sync operation
Fixed a bug where P4Java failed to update the sync time in db.have
during a sync operation

#2409816 (Job #113999)
Fixed a bug in decoding UTF-16 encoded files, which leads to file corruption
Fixed a bug in decoding UTF-16 encoded files, which leads to file
corruption

#2369664 (Job #115104)
Fixed a bug where using Metadata class for version information did not return a result.

Fixed a bug where using Metadata class for version information did not
return a result.

-------------------------------------------
Updates in 2022.1 Patch 1 (2023/01/12)

#2390507 (Job #113889)
Syncing large files could produce corrupted client files larger than
the expected size. Compressed files (binary or +C) are now properly
decompressed. When writing converted bytes, we reset the temp buffer for
compressed data and not close.
Syncing large files could produce corrupted client files larger than
the expected size. Compressed files (binary or +C) are now properly
decompressed. When writing converted bytes, we reset the temp buffer for
compressed data and not close.

#2389019 (Job #113888)
Syncing +x files will now always set the execute bit.
Syncing +x files will now always set the execute bit.

-------------------------------------------
Updates in 2022.1 (2022/09/29)

#2345331 (Job #111078)
Added support to uncompress the compressed files received from server
Added support to uncompress the compressed files received from server

#2325394 (Job #111560)
Added functionality to remove file revision attributes
Added functionality to remove file revision attributes

#2322763 (Job #110629)
Added support for special characters (@, %, # and *) in the file spec
builder by adding ‘makeFileSpecListSpecialChars’ method
Added support for special characters (@, %, # and *) in the file spec
builder by adding ‘makeFileSpecListSpecialChars’ method

#2328997, #2330279 (Job #110207)
Fixed a bug where sync of unicode files with bad charset was causing
corrupt files on the workspace without throwing an error
Fixed a bug where sync of unicode files with bad charset was causing
corrupt files on the workspace without throwing an error

#2346483 (Job #109218)
Fixed a bug where moves with an overlap between source and target
file/directory names raised an error.
Fixed a bug where moves with an overlap between source and target
file/directory names raised an error.

#2333818 (Job #112005)
Fixed a bug where unending sync operation was being caused when the
client compression option was set
Fixed a bug where unending sync operation was being caused when the
client compression option was set

With this release we have migrated P4Java build from from Maven to
Gradle using Gradle wrapper 7.5
With this release we have migrated P4Java build from from Maven to
Gradle using Gradle wrapper 7.5

-------------------------------------------
Updates in 2021.2 Patch 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import com.perforce.p4java.common.function.FunctionWithException;
import com.perforce.p4java.exception.AccessException;
import com.perforce.p4java.exception.ConnectionException;
import com.perforce.p4java.exception.LowResourceException;
import com.perforce.p4java.exception.MessageGenericCode;
import com.perforce.p4java.exception.MessageSeverityCode;
import com.perforce.p4java.exception.OptionsException;
import com.perforce.p4java.exception.P4JavaError;
import com.perforce.p4java.exception.P4JavaException;
import com.perforce.p4java.exception.PauseTimeException;
import com.perforce.p4java.exception.ProtocolError;
import com.perforce.p4java.exception.RequestException;

Expand Down Expand Up @@ -212,7 +214,12 @@ public R apply(T t) throws RequestException {
try {
return function.apply(t);
} catch (P4JavaException e) {
throw new RequestException(e);
if(e instanceof LowResourceException) {
throw new LowResourceException(e);
} else if(e instanceof PauseTimeException) {
throw new PauseTimeException(e);
} else
throw new RequestException(e);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class FileStatAncilliaryOptions {
private boolean excludeLocalPath = false; // -Os
private boolean showAttributes = false; // -Oa
private boolean showHexAttributes = false; // -Oae
private boolean showStorageLocation = false; // -On

public FileStatAncilliaryOptions() {
}
Expand Down Expand Up @@ -63,6 +64,9 @@ public List<String> toStrings() {
} else if (this.isShowAttributes()) {
retVal.add("-Oa");
}
if(this.isShowStorageLocation()) {
retVal.add("-On");
}

return retVal;
}
Expand Down Expand Up @@ -138,4 +142,8 @@ public boolean isShowHexAttributes() {
public void setShowHexAttributes(boolean showHexAttributes) {
this.showHexAttributes = showHexAttributes;
}
}

public boolean isShowStorageLocation() { return showStorageLocation; }

public void setShowStorageLocation(boolean showStorageLocation) { this.showStorageLocation = showStorageLocation; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2008 Perforce Software Inc., All Rights Reserved.
*/
package com.perforce.p4java.exception;

import com.perforce.p4java.Log;

public class LowResourceException extends RequestException {
public LowResourceException(String message, Throwable cause) { super(message, cause); }

public LowResourceException(String message) { super(message); }

public LowResourceException(Throwable cause) {
super(cause);
}

public LowResourceException(String message, String codeString) {
super(message);
if (codeString != null) {
try {
setCodes(new Integer(codeString));
} catch (Exception exc) {
Log.exception(exc);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2008 Perforce Software Inc., All Rights Reserved.
*/
package com.perforce.p4java.exception;

import com.perforce.p4java.Log;

public class PauseTimeException extends RequestException {
public PauseTimeException(String message, Throwable cause) { super(message, cause); }

public PauseTimeException(String message) { super(message); }

public PauseTimeException(Throwable cause) {
super(cause);
}

public PauseTimeException(String message, String codeString) {
super(message);
if (codeString != null) {
try {
setCodes(new Integer(codeString));
} catch (Exception exc) {
Log.exception(exc);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.perforce.p4java.core.file.IFileSpec;
import com.perforce.p4java.exception.AccessException;
import com.perforce.p4java.exception.ConnectionException;
import com.perforce.p4java.exception.LowResourceException;
import com.perforce.p4java.exception.PauseTimeException;
import com.perforce.p4java.exception.RequestException;
import com.perforce.p4java.impl.generic.core.file.ExtendedFileSpec;
import com.perforce.p4java.impl.generic.core.file.FileSpec;
Expand Down Expand Up @@ -80,6 +82,14 @@ public abstract class ResultMapParser {
* Array of access error messages.
*/
private static final String[] ACCESS_ERR_MSGS = {CORE_AUTH_FAIL_STRING_1, CORE_AUTH_FAIL_STRING_2, CORE_AUTH_FAIL_STRING_3, CORE_AUTH_FAIL_STRING_4, AUTH_FAIL_STRING_1, AUTH_FAIL_STRING_2};
/**
* Server low on resources error
*/
private static final String SERVER_LOW_ON_RESOURCES = "Server low on resources";
/**
* Resources waited too long
*/
private static final String WAITED_TOO_LONG = "Waited too long";

/**
* Parses the command result map to return a String of info messages. The
Expand Down Expand Up @@ -142,6 +152,10 @@ public static boolean handleErrorStr(final Map<String, Object> map) throws Reque
if (isNotBlank(errStr)) {
if (isAuthFail(errStr)) {
throw new AccessException(errStr);
} else if (errStr.contains(SERVER_LOW_ON_RESOURCES)) {
throw new LowResourceException(errStr, parseCode0ErrorString(map));
} else if (errStr.contains(WAITED_TOO_LONG)) {
throw new PauseTimeException(errStr, parseCode0ErrorString(map));
} else {
throw new RequestException(errStr, parseCode0ErrorString(map));
}
Expand Down Expand Up @@ -350,6 +364,10 @@ public static boolean handleErrorOrInfoStr(final Map<String, Object> map) throws
if (isNotBlank(errStr)) {
if (isAuthFail(errStr)) {
throw new AccessException(errStr);
} else if (errStr.contains(SERVER_LOW_ON_RESOURCES)) {
throw new LowResourceException(errStr, parseCode0ErrorString(map));
} else if (errStr.contains(WAITED_TOO_LONG)) {
throw new PauseTimeException(errStr, parseCode0ErrorString(map));
} else {
throw new RequestException(errStr, parseCode0ErrorString(map));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
public class GetStreamsOptions extends Options {

/**
* Options: -U -F["filter"], -T["fields"], -m[max]
* Options: -U, -F["filter"], -T["fields"], -m[max], --viewmatch
*/
public static final String OPTIONS_SPECS = "b:U s:F s:T i:m:gtz";
public static final String OPTIONS_SPECS = "b:U s:F s:T i:m:gtz b:-viewmatch";

/**
* If true, lists unloaded task streams (see 'p4 help unload').
Expand Down Expand Up @@ -52,6 +52,13 @@ public class GetStreamsOptions extends Options {
*/
protected int maxResults = 0;

/**
* If true, Returns the stream name, depot path, and stream view path of the streams that
* have views containing the given depot files.
* Corresponds to --viewmatch flag.
*/
protected boolean viewmatch = false;

/**
* Default constructor.
*/
Expand Down Expand Up @@ -100,7 +107,7 @@ public GetStreamsOptions(String filter, String fields, int maxResults) {
* @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer)
*/
public List<String> processOptions(IServer server) throws OptionsException {
this.optionList = this.processFields(OPTIONS_SPECS, this.isUnloaded(), this.getFilter(), this.getFields(), this.getMaxResults());
this.optionList = this.processFields(OPTIONS_SPECS, this.isUnloaded(), this.getFilter(), this.getFields(), this.getMaxResults(), this.isViewmatch());
return this.optionList;
}

Expand Down Expand Up @@ -139,4 +146,13 @@ public GetStreamsOptions setMaxResults(int maxResults) {
this.maxResults = maxResults;
return this;
}

public boolean isViewmatch() {
return viewmatch;
}

public GetStreamsOptions setViewmatch(boolean viewmatch) {
this.viewmatch = viewmatch;
return this;
}
}
Loading

0 comments on commit aea150e

Please sign in to comment.