Examples of CvsDirectory


Examples of org.w3c.cvs.CvsDirectory

     * @exception CvsException if the CVS process failed
     */
    protected void update()
  throws CvsException
    {
  CvsDirectory cvsdir = getCvsManager();
  cvsdir.update(getFileResource().getFile().getName());
    }
View Full Code Here

Examples of org.w3c.cvs.CvsDirectory

     * @exception CvsException if the CVS process failed
     */
    protected int status()
  throws CvsException
    {
  CvsDirectory cvsdir = getCvsManager();
  return cvsdir.status(getFileResource().getFile().getName());
    }
View Full Code Here

Examples of org.w3c.cvs.CvsDirectory

      names[1] = getFileResource().getFile().getName();
  } else {
      names = new String[1];
      names[0] = getFileResource().getFile().getName();
  }
  CvsDirectory cvsdir = null;
  cvsdir = getCvsManager();
  cvsdir.add(names, env);
    }
View Full Code Here

Examples of org.w3c.cvs.CvsDirectory

  throws CvsException
    {
  String u = (String)request.getState(AuthFilter.STATE_AUTHUSER);
  String env[] = {"USER="+u , "LOGNAME="+u };
  String comment = "("+u+") "+msg;
  CvsDirectory cvsdir = null;
  cvsdir = getCvsManager();
  cvsdir.commit(getFileResource().getFile().getName(), comment, env);
    }
View Full Code Here

Examples of org.w3c.cvs.CvsDirectory

        }
        // Display status:
        int st = -1;
        try {
      // Local status first:
      CvsDirectory cvs =
          CvsDirectory.getManager(dir,
                putlist.props);
      st  = cvs.status(file.getName());
      if ( cvsurl != null )
          g.append("Status: <a href=\""+cvsurl+ "\">"
             , cvs.statusToString(st)
             , "</a><br>");
      else
          g.append("Status: "
             , cvs.statusToString(st)
             , "<br>");

      if (url != null)
          g.append("URL: <a href=\"",
             url,
             "\">"+url+"</a><br>");
   
        } catch (CvsException ex) {
      g.append("Status: <strong>CVS ERROR</strong>: "
         , ex.getMessage()
         , "<br>");
        }
        // Publish status next (when possible)
        if ( st != CVS.FILE_Q ) {
      try {
          File         sf  = putlist.getServerFile(file);
          File         sd  = new File(sf.getParent());
          CvsDirectory sc  =
        CvsDirectory.getManager(sd, putlist.props);
          int          sst = sc.status(file.getName());
          if (sst == CVS.FILE_C) {
        g.append("Publish: (needed) <B><U>",
           sc.statusToString(sst),
           "</U></B><br>");
          } else if ((st == CVS.FILE_M) ||
               (sst != CVS.FILE_OK))
        {
            g.append("Publish: (needed) <em>"
               , sc.statusToString(sst)
               , "</em><br>");
        } else {
            g.append("Publish: <em>"
               , sc.statusToString(sst)
               , "</em><br>");
        }
      } catch (CvsException ex) {
          g.append("Publish: <strong>CVS ERROR</strong>: "
             , ex.getMessage()
View Full Code Here

Examples of org.w3c.cvs.CvsDirectory

  int status = FILE_UC;

  try {
      // First step: does the private version needs commit ?
      File         d  = new File(file.getParent());
      CvsDirectory c  = CvsDirectory.getManager(d, props);
      if ( c.status(file.getName()) == CVS.FILE_M ) {
    String author = pe.getAuthor();
    String env [] = { "USER="+author ,
          "LOGNAME="+author };
    String msg    = ((author != null)
         ? "Published by "+author+" through Jigsaw"
         : "Published through Jigsaw");
    c.commit(file.getName(), msg, env);
      } else if ( debug ) {
    System.out.println("PutList: no commit needed on "+
           file.getAbsolutePath()+
           " st="+c.status(file.getName()));
      }
      // Second step: publish
      File sd = new File(sfile.getParent());
      try {
    CvsDirectory sc =
        CvsDirectory.getManager(sd, props);
    String filename = sfile.getName();
    int cvs_status = sc.status(filename);
    if (debug) {
        System.out.println("publishing "+
               CvsDirectory.statusToString(cvs_status)+
               " file : "+filename);
    }
    if (cvs_status == CVS.FILE_C) {
        //conflict! we try to merge
        //create a backup file
        File backup = new File(sfile.getParent(), filename+".bak");
        try {
      org.w3c.util.IO.copy(sfile, backup);
      //try to merge
      sc.update(filename);
      cvs_status = sc.status(filename);
      if (cvs_status == CVS.FILE_M) {
          //merge done, so commit.
          String author = pe.getAuthor();
          String env [] = { "USER="+author ,
                "LOGNAME="+author };
          String msg    = ((author != null)
               ? "Merged by "+author+
               " through Jigsaw"
               : "Merged through Jigsaw");
          sc.commit(filename, msg, env);
          //done so delete backup file
          backup.delete();
          status = FILE_MG;
      } else if (cvs_status == CVS.FILE_C) {
          //merge failed
          sfile.delete();
          backup.renameTo(sfile);
          status = FILE_CF;
      }
        } catch (IOException ex) {
      ex.printStackTrace();
      status = FILE_CF;
        }
    } else if (cvs_status != CVS.FILE_OK) {
        sc.update(filename);
        status = FILE_PB;
    } else if ( debug ) {
        System.out.println("PutList: no update needed on "+
              sfile.getAbsolutePath()+
              " st="+
              CvsDirectory.statusToString(cvs_status));
    }
      } catch (UncheckedOutException ex) {
    // perform a get from root
    File root = new File(getRoot().getAbsolutePath());
    CvsDirectory sc = CvsDirectory.getManager(root, props);
    String fpath  = file.getAbsolutePath();
    String fspace = getCvsSpace().getAbsolutePath();
    String path   = fpath.substring(fspace.length()+1);
    sc.get(path);
    status = FILE_PB;
      }
      // Last step: remove published entries:
      entries.remove(pe.getKey());
      // publication time
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.