Class ChangeUtil


  • public class ChangeUtil
    extends Object
    • Field Detail

      • PS_ID_ORDER

        public static final com.google.common.collect.Ordering<PatchSet> PS_ID_ORDER
    • Method Detail

      • messageUuid

        public static String messageUuid()
        Returns:
        a new unique identifier for change message entities.
      • nextPatchSetIdFromAllRefsMap

        public static PatchSet.Id nextPatchSetIdFromAllRefsMap​(Map<String,​org.eclipse.jgit.lib.Ref> allRefs,
                                                               PatchSet.Id id)
        Get the next patch set ID from a previously-read map of all refs.
        Parameters:
        allRefs - map of full ref name to ref.
        id - previous patch set ID.
        Returns:
        next unused patch set ID for the same change, skipping any IDs whose corresponding ref names appear in the allRefs map.
      • nextPatchSetIdFromChangeRefs

        public static PatchSet.Id nextPatchSetIdFromChangeRefs​(Collection<String> changeRefNames,
                                                               PatchSet.Id id)
        Get the next patch set ID from a previously-read map of refs below the change prefix.
        Parameters:
        changeRefNames - existing full change ref names with the same change ID as id.
        id - previous patch set ID.
        Returns:
        next unused patch set ID for the same change, skipping any IDs whose corresponding ref names appear in the changeRefs map.
      • nextPatchSetId

        public static PatchSet.Id nextPatchSetId​(org.eclipse.jgit.lib.Repository git,
                                                 PatchSet.Id id)
                                          throws IOException
        Get the next patch set ID from scanning refs in the repo.
        Parameters:
        git - repository to scan for patch set refs.
        id - previous patch set ID.
        Returns:
        next unused patch set ID for the same change, skipping any IDs whose corresponding ref names appear in the repository.
        Throws:
        IOException