Skip to content

Commit

Permalink
2024.1 Patch 1 Code Drop
Browse files Browse the repository at this point in the history
  • Loading branch information
ajindal-mdx committed Dec 4, 2024
1 parent 89132fb commit 36b3329
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 13 deletions.
15 changes: 15 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ Known Limitations
* P4Java would not support file operations on altsync enabled clients.


-------------------------------------------
Updates in 2024.1 Patch 1 (2024.1/2674354) (2024/10/29)

#2672847 (Job #121791)
Added support for "p4 attribute -I" and "p4 print -T" options.

#2672817 (Job #123136)
Upgraded commons-io:commons-io to 2.17.0

#2669925 (Job #122392)
Fixed an output bug with "Unable to determine client host name".

#2662969 (Job #122607)
Added support to delete client and all of its shelves via a single command.

-------------------------------------------
Updates in 2024.1 (2024.1/2612262) (2024/06/12)

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
api 'com.jcraft:jzlib:1.1.3'
api 'org.apache.commons:commons-lang3:3.12.0'
api 'commons-codec:commons-codec:1.15'
api 'commons-io:commons-io:2.11.0'
api 'commons-io:commons-io:2.17.0'
api 'com.google.code.findbugs:jsr305:3.0.2'

testImplementation 'org.slf4j:slf4j-api:1.7.36'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public ServerStatus init(final String host, final int port, final Properties pro

authFileLockWait = getPropertyAsLong(properties, new String[]{AUTH_FILE_LOCK_WAIT_KEY_SHORT_FORM, AUTH_FILE_LOCK_WAIT_KEY}, AbstractAuthHelper.DEFAULT_LOCK_WAIT);
} catch (UnknownHostException uhe) {
throw new ConfigException("Unable to determine client host name: %s" + uhe.getLocalizedMessage());
throw new ConfigException("Unable to determine client host name: " + uhe.getLocalizedMessage());
}

// Initialize client trust
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@
public class DeleteClientOptions extends Options {

/**
* Options: -f
* Options: -f -Fd
*/
public static final String OPTIONS_SPECS = "b:f";
public static final String OPTIONS_SPECS = "b:f b:Fd";

/** If true, tell the server to attempt to force the delete regardless of
* the consequences; corresponds to the -f flag.
*/
protected boolean force = false;

/** If true, allows the deletion with -d of a client even when that client contains shelved changes.
* The client and the shelved changes are both deleted. (You must use the -f option with the -Fd option.)
* Corresponds to the -Fd flag
*/
protected boolean deleteShelvedChanges = false;

/**
* Default constructor.
*/
Expand Down Expand Up @@ -70,16 +76,24 @@ public DeleteClientOptions(boolean force) {
* @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.isForce());
this.optionList = this.processFields(OPTIONS_SPECS, this.isForce(), this.isDeleteShelvedChanges());
return this.optionList;
}

public boolean isForce() {
return force;
}

public boolean isDeleteShelvedChanges() { return deleteShelvedChanges; }

public DeleteClientOptions setForce(boolean force) {
this.force = force;
return this;
}

public DeleteClientOptions setDeleteShelvedChanges(boolean deleteShelvedChanges) {
this.deleteShelvedChanges = deleteShelvedChanges;
this.force = true;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
public class GetFileContentsOptions extends Options {

/**
* Options: -a, -q, --offset, --size
* Options: -a, -q, -T, --offset, --size
*/
public static final String OPTIONS_SPECS = "b:a b:q";
public static final String OPTIONS_SPECS = "b:a b:q s:T";

/**
* Options: --offset, --size
Expand Down Expand Up @@ -50,6 +50,12 @@ public class GetFileContentsOptions extends Options {
*/
protected boolean dontAnnotateFiles = false;

/**
* The -T option prints the value of the specified non-encoded attribute
* of the specified file.
*/
protected String fileAttributeName = "";

/**
* Skip the specified number of bytes and only print what follows.
*/
Expand Down Expand Up @@ -114,11 +120,11 @@ public List<String> processOptions(IServer server) throws OptionsException {
}
if (serverVersion >= 20221) {
this.optionList = this.processFields(OPTIONS_SPECS + " " + OPTION_SPEC_NEW,
this.isAllrevs(), this.isNoHeaderLine(),
this.isAllrevs(), this.isNoHeaderLine(), this.getFileAttributeName(),
this.offset, this.size);

} else {
this.optionList = this.processFields(OPTIONS_SPECS, this.isAllrevs(), this.isNoHeaderLine());
this.optionList = this.processFields(OPTIONS_SPECS, this.isAllrevs(), this.isNoHeaderLine(), this.getFileAttributeName());
}
return this.optionList;
}
Expand Down Expand Up @@ -150,6 +156,13 @@ public GetFileContentsOptions setDontAnnotateFiles(boolean dontAnnotateFiles) {
return this;
}

public String getFileAttributeName() { return fileAttributeName; }

public GetFileContentsOptions setFileAttributeName(String fileAttributeName) {
this.fileAttributeName = fileAttributeName;
return this;
}

public long getOffset() {
return offset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
public class SetFileAttributesOptions extends Options {

/**
* Options: -e, -f, -p, -T0 | -T1
* Options: -e, -f, -p, -T0 | -T1, I
*/
public static final String OPTIONS_SPECS = "b:e b:f b:p b:T0 b:T1";
public static final String OPTIONS_SPECS = "b:e b:f b:p b:T0 b:T1 s:I";

/**
* If true, indicates values are in hex format.
Expand Down Expand Up @@ -52,6 +52,12 @@ public class SetFileAttributesOptions extends Options {
* */
protected boolean storageTraitsDepot = false;

/**
* If true, the attribute value is read from a file rather than stdin
* This option can't be used with the -e option
* */
protected String readAttributeValueFromFile = null;

/**
* Default constructor.
*/
Expand Down Expand Up @@ -100,8 +106,7 @@ public SetFileAttributesOptions(boolean hexValue, boolean setOnSubmittedFiles, b
* @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.isHexValue(), this.isSetOnSubmittedFiles(), this.isPropagateAttributes(), this.isStorageDbTraits(), this.isStorageTraitsDepot());

this.optionList = this.processFields(OPTIONS_SPECS, this.isHexValue(), this.isSetOnSubmittedFiles(), this.isPropagateAttributes(), this.isStorageDbTraits(), this.isStorageTraitsDepot(), this.getAttributeValueFileName());
return this.optionList;
}

Expand Down Expand Up @@ -149,4 +154,12 @@ public SetFileAttributesOptions setStorageTraitsDepot(boolean storageTraitsDepot
this.storageTraitsDepot = storageTraitsDepot;
return this;
}

public String getAttributeValueFileName() { return readAttributeValueFromFile; }

public SetFileAttributesOptions setAttributeValueFileName(String readAttributeValueFromFile) {
this.readAttributeValueFromFile = readAttributeValueFromFile;
this.hexValue = false;
return this;
}
}

0 comments on commit 36b3329

Please sign in to comment.