Package com.google.gerrit.server.change
Class RebaseUtil
- java.lang.Object
-
- com.google.gerrit.server.change.RebaseUtil
-
public class RebaseUtil extends Object
Utility methods related to rebasing changes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RebaseUtil.Base
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRebase(PatchSet patchSet, BranchNameKey dest, org.eclipse.jgit.lib.Repository git, org.eclipse.jgit.revwalk.RevWalk rw)
org.eclipse.jgit.lib.ObjectId
findBaseRevision(PatchSet patchSet, BranchNameKey destBranch, org.eclipse.jgit.lib.Repository git, org.eclipse.jgit.revwalk.RevWalk rw)
Find the commit onto which a patch set should be rebased.RebaseUtil.Base
parseBase(RevisionResource rsrc, String base)
-
-
-
Method Detail
-
canRebase
public boolean canRebase(PatchSet patchSet, BranchNameKey dest, org.eclipse.jgit.lib.Repository git, org.eclipse.jgit.revwalk.RevWalk rw)
-
parseBase
public RebaseUtil.Base parseBase(RevisionResource rsrc, String base)
-
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.
-
-