Skip to content

Commit 36b3329

Browse files
committed
2024.1 Patch 1 Code Drop
1 parent 89132fb commit 36b3329

File tree

6 files changed

+68
-13
lines changed

6 files changed

+68
-13
lines changed

RELEASE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,21 @@ Known Limitations
124124
* P4Java would not support file operations on altsync enabled clients.
125125

126126

127+
-------------------------------------------
128+
Updates in 2024.1 Patch 1 (2024.1/2674354) (2024/10/29)
129+
130+
#2672847 (Job #121791)
131+
Added support for "p4 attribute -I" and "p4 print -T" options.
132+
133+
#2672817 (Job #123136)
134+
Upgraded commons-io:commons-io to 2.17.0
135+
136+
#2669925 (Job #122392)
137+
Fixed an output bug with "Unable to determine client host name".
138+
139+
#2662969 (Job #122607)
140+
Added support to delete client and all of its shelves via a single command.
141+
127142
-------------------------------------------
128143
Updates in 2024.1 (2024.1/2612262) (2024/06/12)
129144

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies {
1919
api 'com.jcraft:jzlib:1.1.3'
2020
api 'org.apache.commons:commons-lang3:3.12.0'
2121
api 'commons-codec:commons-codec:1.15'
22-
api 'commons-io:commons-io:2.11.0'
22+
api 'commons-io:commons-io:2.17.0'
2323
api 'com.google.code.findbugs:jsr305:3.0.2'
2424

2525
testImplementation 'org.slf4j:slf4j-api:1.7.36'

src/main/java/com/perforce/p4java/impl/mapbased/rpc/RpcServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ public ServerStatus init(final String host, final int port, final Properties pro
867867

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

873873
// Initialize client trust

src/main/java/com/perforce/p4java/option/server/DeleteClientOptions.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@
1717
public class DeleteClientOptions extends Options {
1818

1919
/**
20-
* Options: -f
20+
* Options: -f -Fd
2121
*/
22-
public static final String OPTIONS_SPECS = "b:f";
22+
public static final String OPTIONS_SPECS = "b:f b:Fd";
2323

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

29+
/** If true, allows the deletion with -d of a client even when that client contains shelved changes.
30+
* The client and the shelved changes are both deleted. (You must use the -f option with the -Fd option.)
31+
* Corresponds to the -Fd flag
32+
*/
33+
protected boolean deleteShelvedChanges = false;
34+
2935
/**
3036
* Default constructor.
3137
*/
@@ -70,16 +76,24 @@ public DeleteClientOptions(boolean force) {
7076
* @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer)
7177
*/
7278
public List<String> processOptions(IServer server) throws OptionsException {
73-
this.optionList = this.processFields(OPTIONS_SPECS, this.isForce());
79+
this.optionList = this.processFields(OPTIONS_SPECS, this.isForce(), this.isDeleteShelvedChanges());
7480
return this.optionList;
7581
}
7682

7783
public boolean isForce() {
7884
return force;
7985
}
8086

87+
public boolean isDeleteShelvedChanges() { return deleteShelvedChanges; }
88+
8189
public DeleteClientOptions setForce(boolean force) {
8290
this.force = force;
8391
return this;
8492
}
93+
94+
public DeleteClientOptions setDeleteShelvedChanges(boolean deleteShelvedChanges) {
95+
this.deleteShelvedChanges = deleteShelvedChanges;
96+
this.force = true;
97+
return this;
98+
}
8599
}

src/main/java/com/perforce/p4java/option/server/GetFileContentsOptions.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
public class GetFileContentsOptions extends Options {
1919

2020
/**
21-
* Options: -a, -q, --offset, --size
21+
* Options: -a, -q, -T, --offset, --size
2222
*/
23-
public static final String OPTIONS_SPECS = "b:a b:q";
23+
public static final String OPTIONS_SPECS = "b:a b:q s:T";
2424

2525
/**
2626
* Options: --offset, --size
@@ -50,6 +50,12 @@ public class GetFileContentsOptions extends Options {
5050
*/
5151
protected boolean dontAnnotateFiles = false;
5252

53+
/**
54+
* The -T option prints the value of the specified non-encoded attribute
55+
* of the specified file.
56+
*/
57+
protected String fileAttributeName = "";
58+
5359
/**
5460
* Skip the specified number of bytes and only print what follows.
5561
*/
@@ -114,11 +120,11 @@ public List<String> processOptions(IServer server) throws OptionsException {
114120
}
115121
if (serverVersion >= 20221) {
116122
this.optionList = this.processFields(OPTIONS_SPECS + " " + OPTION_SPEC_NEW,
117-
this.isAllrevs(), this.isNoHeaderLine(),
123+
this.isAllrevs(), this.isNoHeaderLine(), this.getFileAttributeName(),
118124
this.offset, this.size);
119125

120126
} else {
121-
this.optionList = this.processFields(OPTIONS_SPECS, this.isAllrevs(), this.isNoHeaderLine());
127+
this.optionList = this.processFields(OPTIONS_SPECS, this.isAllrevs(), this.isNoHeaderLine(), this.getFileAttributeName());
122128
}
123129
return this.optionList;
124130
}
@@ -150,6 +156,13 @@ public GetFileContentsOptions setDontAnnotateFiles(boolean dontAnnotateFiles) {
150156
return this;
151157
}
152158

159+
public String getFileAttributeName() { return fileAttributeName; }
160+
161+
public GetFileContentsOptions setFileAttributeName(String fileAttributeName) {
162+
this.fileAttributeName = fileAttributeName;
163+
return this;
164+
}
165+
153166
public long getOffset() {
154167
return offset;
155168
}

src/main/java/com/perforce/p4java/option/server/SetFileAttributesOptions.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
public class SetFileAttributesOptions extends Options {
1818

1919
/**
20-
* Options: -e, -f, -p, -T0 | -T1
20+
* Options: -e, -f, -p, -T0 | -T1, I
2121
*/
22-
public static final String OPTIONS_SPECS = "b:e b:f b:p b:T0 b:T1";
22+
public static final String OPTIONS_SPECS = "b:e b:f b:p b:T0 b:T1 s:I";
2323

2424
/**
2525
* If true, indicates values are in hex format.
@@ -52,6 +52,12 @@ public class SetFileAttributesOptions extends Options {
5252
* */
5353
protected boolean storageTraitsDepot = false;
5454

55+
/**
56+
* If true, the attribute value is read from a file rather than stdin
57+
* This option can't be used with the -e option
58+
* */
59+
protected String readAttributeValueFromFile = null;
60+
5561
/**
5662
* Default constructor.
5763
*/
@@ -100,8 +106,7 @@ public SetFileAttributesOptions(boolean hexValue, boolean setOnSubmittedFiles, b
100106
* @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer)
101107
*/
102108
public List<String> processOptions(IServer server) throws OptionsException {
103-
this.optionList = this.processFields(OPTIONS_SPECS, this.isHexValue(), this.isSetOnSubmittedFiles(), this.isPropagateAttributes(), this.isStorageDbTraits(), this.isStorageTraitsDepot());
104-
109+
this.optionList = this.processFields(OPTIONS_SPECS, this.isHexValue(), this.isSetOnSubmittedFiles(), this.isPropagateAttributes(), this.isStorageDbTraits(), this.isStorageTraitsDepot(), this.getAttributeValueFileName());
105110
return this.optionList;
106111
}
107112

@@ -149,4 +154,12 @@ public SetFileAttributesOptions setStorageTraitsDepot(boolean storageTraitsDepot
149154
this.storageTraitsDepot = storageTraitsDepot;
150155
return this;
151156
}
157+
158+
public String getAttributeValueFileName() { return readAttributeValueFromFile; }
159+
160+
public SetFileAttributesOptions setAttributeValueFileName(String readAttributeValueFromFile) {
161+
this.readAttributeValueFromFile = readAttributeValueFromFile;
162+
this.hexValue = false;
163+
return this;
164+
}
152165
}

0 commit comments

Comments
 (0)