package hudson.scm;

import hudson.model.AbstractProject;
import hudson.model.InvisibleAction;
import hudson.model.TaskListener;
import hudson.model.AbstractBuild;
import hudson.Launcher;
import hudson.FilePath;

/**
 * Immutable object that represents revisions of the files in the repository,
 * used to represent the result of
 * {@linkplain SCM#poll(AbstractProject, Launcher, FilePath, TaskListener, SCMRevisionState) a SCM polling}.
 *
 * <p>
 * This object is used so that the successive polling can compare the tip of the repository now vs
 * what it was when it was last polled. (Before 1.345, Hudson was only able to compare the tip
 * of the repository vs the state of the workspace, which resulted in a problem like HUDSON-2180.
 *
 * <p>
 * {@link SCMRevisionState} is persisted as an action to {@link AbstractBuild}.
 *
 * @author Kohsuke Kawaguchi
 * @since 1.345
 */
public abstract class SCMRevisionState extends InvisibleAction {
    /*
      I can't really make this comparable because comparing two revision states often requires
      non-trivial computation and conversations with the repository (mainly to figure out
      which changes are insignificant and which are not.)

      So instead, here we opt to a design where we tell SCM upfront about what we are comparing
      against (baseline), and have it give us the new state and degree of change in PollingResult.
     */

    public static SCMRevisionState NONE = new None();

    private static final class None extends SCMRevisionState {}
}

@@ -32,66 +32,40 @@
 son.
-model.AbstractProject;%0Aimport hudson.model.InvisibleAction
+FilePath;%0Aimport hudson.Launcher
 ;%0Aim
@@ -82,28 +82,29 @@
 n.model.
-TaskListener
+AbstractBuild
 ;%0Aimport
@@ -117,37 +117,39 @@
 n.model.Abstract
-Build
+Project
 ;%0Aimport hudson.
@@ -144,32 +144,36 @@
 port hudson.
-Launcher
+model.Action
 ;%0Aimport hud
@@ -176,24 +176,34 @@
  hudson.
-FilePath
+model.TaskListener
 ;%0A%0A/**%0A 
@@ -910,33 +910,219 @@
 ate 
-extends InvisibleAction %7B
+implements Action %7B%0A    public String getIconFileName() %7B%0A        return null;%0A    %7D%0A%0A    public String getDisplayName() %7B%0A        return null;%0A    %7D%0A%0A    public String getUrlName() %7B%0A        return null;%0A    %7D%0A
 %0A   

allow subtype to define visible Action out of SCMRevisionState