public class ChangeEditModifier extends Object
This class contains methods to modify edit's content.
For retrieving, publishing and deleting edit see
ChangeEditUtil
.
Modifier and Type | Method and Description |
---|---|
org.eclipse.jgit.lib.RefUpdate.Result |
createEdit(com.google.gerrit.reviewdb.client.Change change,
com.google.gerrit.reviewdb.client.PatchSet ps)
Create new change edit.
|
org.eclipse.jgit.lib.RefUpdate.Result |
deleteFile(ChangeEdit edit,
String file)
Delete file in existing change edit.
|
org.eclipse.jgit.lib.RefUpdate.Result |
modifyFile(ChangeEdit edit,
String file,
com.google.gerrit.extensions.restapi.RawInput content)
Modify file in existing change edit from its base commit.
|
org.eclipse.jgit.lib.RefUpdate.Result |
modifyMessage(ChangeEdit edit,
String msg)
Modify commit message in existing change edit.
|
void |
rebaseEdit(ChangeEdit edit,
com.google.gerrit.reviewdb.client.PatchSet current)
Rebase change edit on latest patch set
|
org.eclipse.jgit.lib.RefUpdate.Result |
renameFile(ChangeEdit edit,
String file,
String newFile)
Rename file in existing change edit.
|
org.eclipse.jgit.lib.RefUpdate.Result |
restoreFile(ChangeEdit edit,
String file)
Restore file in existing change edit.
|
public org.eclipse.jgit.lib.RefUpdate.Result createEdit(com.google.gerrit.reviewdb.client.Change change, com.google.gerrit.reviewdb.client.PatchSet ps) throws com.google.gerrit.extensions.restapi.AuthException, IOException, com.google.gerrit.extensions.restapi.ResourceConflictException, com.google.gwtorm.server.OrmException
change
- to create change edit forps
- patch set to create change edit oncom.google.gerrit.extensions.restapi.AuthException
IOException
com.google.gerrit.extensions.restapi.ResourceConflictException
- When change edit already
exists for the changecom.google.gwtorm.server.OrmException
public void rebaseEdit(ChangeEdit edit, com.google.gerrit.reviewdb.client.PatchSet current) throws com.google.gerrit.extensions.restapi.AuthException, com.google.gerrit.extensions.restapi.ResourceConflictException, InvalidChangeOperationException, IOException
edit
- change edit that contains edit to rebasecurrent
- patch set to rebase the edit oncom.google.gerrit.extensions.restapi.AuthException
com.google.gerrit.extensions.restapi.ResourceConflictException
- thrown if rebase fails due to merge conflictsInvalidChangeOperationException
IOException
public org.eclipse.jgit.lib.RefUpdate.Result modifyMessage(ChangeEdit edit, String msg) throws com.google.gerrit.extensions.restapi.AuthException, InvalidChangeOperationException, IOException, UnchangedCommitMessageException
edit
- change editmsg
- new commit messagecom.google.gerrit.extensions.restapi.AuthException
InvalidChangeOperationException
IOException
UnchangedCommitMessageException
public org.eclipse.jgit.lib.RefUpdate.Result modifyFile(ChangeEdit edit, String file, com.google.gerrit.extensions.restapi.RawInput content) throws com.google.gerrit.extensions.restapi.AuthException, InvalidChangeOperationException, IOException
edit
- change editfile
- path to modifycontent
- new contentcom.google.gerrit.extensions.restapi.AuthException
InvalidChangeOperationException
IOException
public org.eclipse.jgit.lib.RefUpdate.Result deleteFile(ChangeEdit edit, String file) throws com.google.gerrit.extensions.restapi.AuthException, InvalidChangeOperationException, IOException
edit
- change editfile
- path to deletecom.google.gerrit.extensions.restapi.AuthException
InvalidChangeOperationException
IOException
public org.eclipse.jgit.lib.RefUpdate.Result renameFile(ChangeEdit edit, String file, String newFile) throws com.google.gerrit.extensions.restapi.AuthException, InvalidChangeOperationException, IOException
edit
- change editfile
- path to renamenewFile
- path to rename the file tocom.google.gerrit.extensions.restapi.AuthException
InvalidChangeOperationException
IOException
public org.eclipse.jgit.lib.RefUpdate.Result restoreFile(ChangeEdit edit, String file) throws com.google.gerrit.extensions.restapi.AuthException, InvalidChangeOperationException, IOException
edit
- change editfile
- path to restorecom.google.gerrit.extensions.restapi.AuthException
InvalidChangeOperationException
IOException