package com.perforce.p4java_ext; import com.perforce.p4java.exception.P4JavaException; import com.perforce.p4java.server.IOptionsServer; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; /** * Exposes access to the "p4 edit" command */ public interface P4Edit extends P4ClientConnection, P4Errors { static P4Edit create(P4ClientConnection conn) { return new DefaultP4Edit(conn); } /** * Opens the local files for edit on the indicated changelist. * * Basically, the "p4 edit" command. Depending upon your client settings * this probably has to be run before updating the content. * * @param changelist The pending changelist ID * @param paths The files to mark as edit */ default void edit(String changelist, String... paths) { try { List<String> optList = new ArrayList<String>(); // -f will allow us to submit special characters, and have them // reformatted later by the server optList.add("-f"); Collections.addAll(optList, "-c", changelist); Collections.addAll(optList, paths); String[] opts = optList.toArray(new String[0]); IOptionsServer optionsServer = getOptionsServer(); Map<String, Object>[] results = optionsServer.execMapCmd("edit", opts, null); checkError(results); } catch (P4JavaException e) { throw new P4Exception(e); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 9086 | tjuricek |
0.1.0 Initial release of p4java_ext Mostly just contains enough of the P4 API to build the test data initializer. About 4 commands have minimal testing, so it works. Kind of. |
||
#1 | 9085 | tjuricek | First import of the project, before package refactoring. |