public HgServeJob(
     HgRoot hgRoot,
     int port,
     String prefix,
     String name,
     String webdirConf,
     boolean ipv6,
     boolean stdio) {
   super(
       Messages.getString("HgServeClient.serveJob.name") // $NON-NLS-1$
           + hgRoot.getName()
           + "..."); //$NON-NLS-1$
   this.hgRoot = hgRoot;
   this.port = port;
   this.prefix = prefix;
   this.name = name;
   this.webdirConf = webdirConf;
   this.ipv6 = ipv6;
   this.stdio = stdio;
   progress = getJobManager().createProgressGroup();
   progress.beginTask("Local Mercurial Server on port " + port, IProgressMonitor.UNKNOWN);
   setProgressGroup(progress, IProgressMonitor.UNKNOWN);
   setPriority(LONG);
   setUser(false);
   setSystem(false);
   setRule(new ServeRule(port));
 }
  /**
   * The action has been activated. The argument of the method represents the 'real' action sitting
   * in the workbench UI.
   *
   * @see IWorkbenchWindowActionDelegate#run
   */
  public void run(IAction action) {
    Shell shell = window != null ? window.getShell() : MercurialEclipsePlugin.getActiveShell();
    if (!confirmRemove(shell)) {
      return;
    }
    List<IResource> resources = ResourceUtils.getResources(selection);
    Map<HgRoot, List<IResource>> byRoot = ResourceUtils.groupByRoot(resources);

    try {
      HgRemoveClient.removeResourcesLater(byRoot);
    } finally {
      for (Map.Entry<HgRoot, List<IResource>> mapEntry : byRoot.entrySet()) {
        HgRoot hgRoot = mapEntry.getKey();
        new RefreshStatusJob("Refreshing " + hgRoot.getName(), hgRoot).schedule();
      }
    }
  }
 private static String getRootKey(HgRoot root) {
   return KEY_REPOS_PREFIX + root.getAbsolutePath();
 }