Class RebaseUtil


  • public class RebaseUtil
    extends Object
    Utility methods related to rebasing changes.
    • Method Detail

      • canRebase

        public boolean canRebase​(PatchSet patchSet,
                                 BranchNameKey dest,
                                 org.eclipse.jgit.lib.Repository git,
                                 org.eclipse.jgit.revwalk.RevWalk rw)
      • findBaseRevision

        public org.eclipse.jgit.lib.ObjectId findBaseRevision​(PatchSet patchSet,
                                                              BranchNameKey destBranch,
                                                              org.eclipse.jgit.lib.Repository git,
                                                              org.eclipse.jgit.revwalk.RevWalk rw)
                                                       throws RestApiException,
                                                              IOException
        Find the commit onto which a patch set should be rebased.

        This is defined as the latest patch set of the change corresponding to this commit's parent, or the destination branch tip in the case where the parent's change is merged.

        Parameters:
        patchSet - patch set for which the new base commit should be found.
        destBranch - the destination branch.
        git - the repository.
        rw - the RevWalk.
        Returns:
        the commit onto which the patch set should be rebased.
        Throws:
        RestApiException - if rebase is not possible.
        IOException - if accessing the repository fails.