/AWS1/IF_CMT=>CREATECOMMIT()¶
About CreateCommit¶
Creates a commit for a repository on the tip of a specified branch.
Method Signature¶
METHODS /AWS1/IF_CMT~CREATECOMMIT
IMPORTING
!IV_REPOSITORYNAME TYPE /AWS1/CMTREPOSITORYNAME OPTIONAL
!IV_BRANCHNAME TYPE /AWS1/CMTBRANCHNAME OPTIONAL
!IV_PARENTCOMMITID TYPE /AWS1/CMTCOMMITID OPTIONAL
!IV_AUTHORNAME TYPE /AWS1/CMTNAME OPTIONAL
!IV_EMAIL TYPE /AWS1/CMTEMAIL OPTIONAL
!IV_COMMITMESSAGE TYPE /AWS1/CMTMESSAGE OPTIONAL
!IV_KEEPEMPTYFOLDERS TYPE /AWS1/CMTKEEPEMPTYFOLDERS OPTIONAL
!IT_PUTFILES TYPE /AWS1/CL_CMTPUTFILEENTRY=>TT_PUTFILEENTRIES OPTIONAL
!IT_DELETEFILES TYPE /AWS1/CL_CMTDELETEFILEENTRY=>TT_DELETEFILEENTRIES OPTIONAL
!IT_SETFILEMODES TYPE /AWS1/CL_CMTSETFILEMODEENTRY=>TT_SETFILEMODEENTRIES OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cmtcreatecommitoutput
RAISING
/AWS1/CX_CMTBRANCHDOESNOTEXEX
/AWS1/CX_CMTBRANCHNAMEISTAGN00
/AWS1/CX_CMTBRANCHNAMEREQUIR00
/AWS1/CX_CMTCOMMITMSGLENGTHE00
/AWS1/CX_CMTDIRECTORYNAMECON00
/AWS1/CX_CMTENCINTEGRITYCHXF00
/AWS1/CX_CMTENCKEYACCDENIEDEX
/AWS1/CX_CMTENCKEYDISABLEDEX
/AWS1/CX_CMTENCKEYNOTFOUNDEX
/AWS1/CX_CMTENCKEYUNAVAILEX
/AWS1/CX_CMTFILECONTANDSRCFI00
/AWS1/CX_CMTFILECONTSIZELMTE00
/AWS1/CX_CMTFILEDOESNOTEXISTEX
/AWS1/CX_CMTFILEENTRREQUIREDEX
/AWS1/CX_CMTFILEMODEREQUIREDEX
/AWS1/CX_CMTFILENAMECONFLICT00
/AWS1/CX_CMTFILEPATHCONFLICT00
/AWS1/CX_CMTFOLDERCONTSIZELM00
/AWS1/CX_CMTINVBRANCHNAMEEX
/AWS1/CX_CMTINVDELETIONPARAMEX
/AWS1/CX_CMTINVALIDEMAILEX
/AWS1/CX_CMTINVALIDFILEMODEEX
/AWS1/CX_CMTINVPARENTCOMMITI00
/AWS1/CX_CMTINVALIDPATHEX
/AWS1/CX_CMTINVREPOSITORYNAM00
/AWS1/CX_CMTMAXFILEENTRIESEX00
/AWS1/CX_CMTNAMELENGTHEXCDEX
/AWS1/CX_CMTNOCHANGEEXCEPTION
/AWS1/CX_CMTPARENTCOMMITDOES00
/AWS1/CX_CMTPARENTCOMMITIDOU00
/AWS1/CX_CMTPARENTCOMMITIDRE00
/AWS1/CX_CMTPATHREQUIREDEX
/AWS1/CX_CMTPUTFILEENTCONFLI00
/AWS1/CX_CMTREPOSITORYDOESNO00
/AWS1/CX_CMTREPOSITORYNAMERE00
/AWS1/CX_CMTRESTRICTEDSRCFIL00
/AWS1/CX_CMTSAMEPATHREQUESTEX
/AWS1/CX_CMTSRCFILEORCONTREQ00
/AWS1/CX_CMTCLIENTEXC
/AWS1/CX_CMTSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_repositoryname TYPE /AWS1/CMTREPOSITORYNAME /AWS1/CMTREPOSITORYNAME¶
The name of the repository where you create the commit.
iv_branchname TYPE /AWS1/CMTBRANCHNAME /AWS1/CMTBRANCHNAME¶
The name of the branch where you create the commit.
Optional arguments:¶
iv_parentcommitid TYPE /AWS1/CMTCOMMITID /AWS1/CMTCOMMITID¶
The ID of the commit that is the parent of the commit you create. Not required if this is an empty repository.
iv_authorname TYPE /AWS1/CMTNAME /AWS1/CMTNAME¶
The name of the author who created the commit. This information is used as both the author and committer for the commit.
iv_email TYPE /AWS1/CMTEMAIL /AWS1/CMTEMAIL¶
The email address of the person who created the commit.
iv_commitmessage TYPE /AWS1/CMTMESSAGE /AWS1/CMTMESSAGE¶
The commit message you want to include in the commit. Commit messages are limited to 256 KB. If no message is specified, a default message is used.
iv_keepemptyfolders TYPE /AWS1/CMTKEEPEMPTYFOLDERS /AWS1/CMTKEEPEMPTYFOLDERS¶
If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a ..gitkeep file is created for empty folders. The default is false.
it_putfiles TYPE /AWS1/CL_CMTPUTFILEENTRY=>TT_PUTFILEENTRIES TT_PUTFILEENTRIES¶
The files to add or update in this commit.
it_deletefiles TYPE /AWS1/CL_CMTDELETEFILEENTRY=>TT_DELETEFILEENTRIES TT_DELETEFILEENTRIES¶
The files to delete in this commit. These files still exist in earlier commits.
it_setfilemodes TYPE /AWS1/CL_CMTSETFILEMODEENTRY=>TT_SETFILEMODEENTRIES TT_SETFILEMODEENTRIES¶
The file modes to update for files in this commit.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cmtcreatecommitoutput /AWS1/CL_CMTCREATECOMMITOUTPUT¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createcommit(
it_deletefiles = VALUE /aws1/cl_cmtdeletefileentry=>tt_deletefileentries(
( new /aws1/cl_cmtdeletefileentry( |string| ) )
)
it_putfiles = VALUE /aws1/cl_cmtputfileentry=>tt_putfileentries(
(
new /aws1/cl_cmtputfileentry(
io_sourcefile = new /aws1/cl_cmtsrcfilespecifier(
iv_filepath = |string|
iv_ismove = ABAP_TRUE
)
iv_filecontent = '5347567362473873563239796247513D'
iv_filemode = |string|
iv_filepath = |string|
)
)
)
it_setfilemodes = VALUE /aws1/cl_cmtsetfilemodeentry=>tt_setfilemodeentries(
(
new /aws1/cl_cmtsetfilemodeentry(
iv_filemode = |string|
iv_filepath = |string|
)
)
)
iv_authorname = |string|
iv_branchname = |string|
iv_commitmessage = |string|
iv_email = |string|
iv_keepemptyfolders = ABAP_TRUE
iv_parentcommitid = |string|
iv_repositoryname = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_objectid = lo_result->get_commitid( ).
lv_objectid = lo_result->get_treeid( ).
LOOP AT lo_result->get_filesadded( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_path = lo_row_1->get_absolutepath( ).
lv_objectid = lo_row_1->get_blobid( ).
lv_filemodetypeenum = lo_row_1->get_filemode( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_filesupdated( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_path = lo_row_1->get_absolutepath( ).
lv_objectid = lo_row_1->get_blobid( ).
lv_filemodetypeenum = lo_row_1->get_filemode( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_filesdeleted( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_path = lo_row_1->get_absolutepath( ).
lv_objectid = lo_row_1->get_blobid( ).
lv_filemodetypeenum = lo_row_1->get_filemode( ).
ENDIF.
ENDLOOP.
ENDIF.