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 |
---|---|
void |
createEdit(org.eclipse.jgit.lib.Repository repository,
ChangeControl changeControl)
Creates a new change edit.
|
void |
deleteFile(org.eclipse.jgit.lib.Repository repository,
ChangeControl changeControl,
String file)
Deletes a file from the Git tree of a change edit.
|
void |
modifyFile(org.eclipse.jgit.lib.Repository repository,
ChangeControl changeControl,
String filePath,
RawInput newContent)
Modifies the contents of a file of a change edit.
|
void |
modifyMessage(org.eclipse.jgit.lib.Repository repository,
ChangeControl changeControl,
String newCommitMessage)
Modifies the commit message of a change edit.
|
void |
rebaseEdit(org.eclipse.jgit.lib.Repository repository,
ChangeControl changeControl)
Rebase change edit on latest patch set
|
void |
renameFile(org.eclipse.jgit.lib.Repository repository,
ChangeControl changeControl,
String currentFilePath,
String newFilePath)
Renames a file of a change edit or moves it to another directory.
|
void |
restoreFile(org.eclipse.jgit.lib.Repository repository,
ChangeControl changeControl,
String file)
Restores a file of a change edit to the state it was in before the patch set on which the
change edit is based.
|
public void createEdit(org.eclipse.jgit.lib.Repository repository, ChangeControl changeControl) throws AuthException, IOException, InvalidChangeOperationException, com.google.gwtorm.server.OrmException
repository
- the affected Git repositorychangeControl
- the ChangeControl
of the change for which the change edit should
be createdAuthException
- if the user isn't authenticated or not allowed to use change editsInvalidChangeOperationException
- if a change edit already existed for the changeIOException
com.google.gwtorm.server.OrmException
public void rebaseEdit(org.eclipse.jgit.lib.Repository repository, ChangeControl changeControl) throws AuthException, InvalidChangeOperationException, IOException, com.google.gwtorm.server.OrmException, MergeConflictException
repository
- the affected Git repositorychangeControl
- the ChangeControl
of the change whose change edit should be
rebasedAuthException
- if the user isn't authenticated or not allowed to use change editsInvalidChangeOperationException
- if a change edit doesn't exist for the specified
change, the change edit is already based on the latest patch set, or the change represents
the root commitMergeConflictException
- if rebase fails due to merge conflictsIOException
com.google.gwtorm.server.OrmException
public void modifyMessage(org.eclipse.jgit.lib.Repository repository, ChangeControl changeControl, String newCommitMessage) throws AuthException, IOException, UnchangedCommitMessageException, com.google.gwtorm.server.OrmException
repository
- the affected Git repositorychangeControl
- the ChangeControl
of the change whose change edit's message should
be modifiednewCommitMessage
- the new commit messageAuthException
- if the user isn't authenticated or not allowed to use change editsUnchangedCommitMessageException
- if the commit message is the same as beforeIOException
com.google.gwtorm.server.OrmException
public void modifyFile(org.eclipse.jgit.lib.Repository repository, ChangeControl changeControl, String filePath, RawInput newContent) throws AuthException, InvalidChangeOperationException, IOException, com.google.gwtorm.server.OrmException
repository
- the affected Git repositorychangeControl
- the ChangeControl
of the change whose change edit should be
modifiedfilePath
- the path of the file whose contents should be modifiednewContent
- the new file contentAuthException
- if the user isn't authenticated or not allowed to use change editsInvalidChangeOperationException
- if the file already had the specified contentIOException
com.google.gwtorm.server.OrmException
public void deleteFile(org.eclipse.jgit.lib.Repository repository, ChangeControl changeControl, String file) throws AuthException, InvalidChangeOperationException, IOException, com.google.gwtorm.server.OrmException
repository
- the affected Git repositorychangeControl
- the ChangeControl
of the change whose change edit should be
modifiedfile
- path of the file which should be deletedAuthException
- if the user isn't authenticated or not allowed to use change editsInvalidChangeOperationException
- if the file does not existIOException
com.google.gwtorm.server.OrmException
public void renameFile(org.eclipse.jgit.lib.Repository repository, ChangeControl changeControl, String currentFilePath, String newFilePath) throws AuthException, InvalidChangeOperationException, IOException, com.google.gwtorm.server.OrmException
repository
- the affected Git repositorychangeControl
- the ChangeControl
of the change whose change edit should be
modifiedcurrentFilePath
- the current path/name of the filenewFilePath
- the desired path/name of the fileAuthException
- if the user isn't authenticated or not allowed to use change editsInvalidChangeOperationException
- if the file was already renamed to the specified new
nameIOException
com.google.gwtorm.server.OrmException
public void restoreFile(org.eclipse.jgit.lib.Repository repository, ChangeControl changeControl, String file) throws AuthException, InvalidChangeOperationException, IOException, com.google.gwtorm.server.OrmException
repository
- the affected Git repositorychangeControl
- the ChangeControl
of the change whose change edit should be
modifiedfile
- the path of the file which should be restoredAuthException
- if the user isn't authenticated or not allowed to use change editsInvalidChangeOperationException
- if the file was already restoredIOException
com.google.gwtorm.server.OrmException