Package org.exist.versioning.svn

Examples of org.exist.versioning.svn.WorkingCopy


     *
     * @param args
     * @param contextSequence
     */
    public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    WorkingCopy wc = new WorkingCopy("", "");
       
        String uri = args[0].getStringValue();
      
        Resource wcDir = new Resource(uri);
       
        try {
      wc.unlock(wcDir, false);
    } catch (SVNException e) {
            throw new XPathException(this, e.getMessage(), e);
    }
       
        return Sequence.EMPTY_SEQUENCE;
View Full Code Here


    public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {

        String wcDir = args[0].getStringValue();
       
        try {
          WorkingCopy wc = new WorkingCopy("", "");

          wc.revert(new File[] { new Resource(wcDir) });

        } catch (SVNException svne) {
      svne.printStackTrace();
      throw new XPathException(this,
          "error while revert '" + wcDir + "'", svne);
View Full Code Here

     *
     * @param args
     * @param contextSequence
     */
    public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
    WorkingCopy wc = new WorkingCopy("", "");
       
        String uri = args[0].getStringValue();
        String lockComment = args[1].getStringValue();
      
        Resource wcDir = new Resource(uri);
       
        try {
      wc.lock(wcDir, false, lockComment);
    } catch (SVNException e) {
            throw new XPathException(this, e.getMessage(), e);
    }
       
        return Sequence.EMPTY_SEQUENCE;
View Full Code Here

    String password = "";
    if (args.length == 4) {
      login = args[2].getStringValue();
      password = args[3].getStringValue();
    }
        WorkingCopy wc = new WorkingCopy(login, password);
        String uri = args[0].getStringValue();
        String destPath = args[1].getStringValue();
       
        Resource wcDir = new Resource(destPath);
        if (wcDir.exists()) {
          IOException exception =
              new IOException("the destination directory '" + wcDir.getAbsolutePath() + "' already exists!");

          LOG.debug(exception);
         
          throw new XPathException(this, exception);
        }
        //wcDir.mkdirs();
       
        long rev = -1;
      try {
        rev = wc.checkout(SVNURL.parseURIEncoded(uri), SVNRevision.HEAD, wcDir, true);
    } catch (SVNException svne) {
      svne.printStackTrace();
     
          LOG.debug(svne);
View Full Code Here

    public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {

        String wcDir = args[0].getStringValue();
       
        try {
        WorkingCopy wc = new WorkingCopy("", "");

          wc.delete(new Resource(wcDir), true);
    } catch (SVNException svne) {
      svne.printStackTrace();
      throw new XPathException(this,
          "error while scheduling deletion from version control of '"
                    + wcDir + "'", svne);
View Full Code Here

  }

  @Override
  public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
       
    WorkingCopy wc = new WorkingCopy("", "");
       
        String uri = args[0].getStringValue();
      
        Resource wcDir = new Resource(uri);
      try {
       
            MemTreeBuilder builder = context.getDocumentBuilder();
       
            AttributesImpl attribs = new AttributesImpl();
            attribs.addAttribute("", "uri", "uri", "CDATA", uri);
            //attribs.addAttribute("", "start", "start", "CDATA", Long.toString(startRevision));

            int nodeNr = builder.startElement(INFO_ELEMENT, attribs);
           
            wc.showInfo(wcDir, SVNRevision.WORKING, true, new InfoHandler(builder));
           
            builder.endElement();
        return builder.getDocument().getNode(nodeNr);
       
    } catch (SVNException svne) {
View Full Code Here

  public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
        String uri = args[0].getStringValue();
        String user = args[1].getStringValue();
        String password = args[2].getStringValue();

    WorkingCopy wc = new WorkingCopy(user, password);
   
    List<SVNDirEntry> entries;
    try {
      entries = wc.list(SVNURL.parseURIEncoded(uri), SVNRevision.HEAD, SVNRevision.HEAD, false, SVNDepth.IMMEDIATES, 1);
      MemTreeBuilder builder = context.getDocumentBuilder();
      int nodeNr = builder.startElement(ENTRIES_ELEMENT, EMPTY_ATTRIBS);
     
      for (SVNDirEntry entry : entries) {
        String path = entry.getRelativePath();
View Full Code Here

    public void process(XmldbURI collection, String[] params) throws CommandException {
      //TODO: check params
      String uri = params[0];
      String destPath = params[1];

      WorkingCopy wc = new WorkingCopy("", "");

        Resource wcDir = new Resource(collection.append(destPath));
        if (wcDir.exists()) {
          throw new CommandException(
            "the destination directory '" + wcDir.getAbsolutePath() + "' already exists!");
        }
        wcDir.mkdirs();
       
      try {
        out().println( wc.checkout(SVNURL.parseURIEncoded(uri), SVNRevision.HEAD, wcDir, true) );
    } catch (SVNException svne) {
      throw new CommandException(
        "error while checking out a working copy for the location '" + uri + "'", svne);
    }
  }
View Full Code Here

    names = new String[] {"add"};
  }
 
    public void process(XmldbURI collection, String[] params) throws CommandException {

      WorkingCopy wc = new WorkingCopy("", "");
     
      String destPath = params[0];
     
        Resource wcDir = new Resource(collection.append(destPath));

      try {
      wc.addEntry(wcDir);
    } catch (SVNException e) {
      throw new CommandException(e);
    }
  }
View Full Code Here

        String comment = params[2];
       
        Resource wcDir = new Resource(collection);

        try {
          WorkingCopy wc = new WorkingCopy(user, password);

          out().println( wc.commit(wcDir, false, comment) );
    } catch (SVNException svne) {
      svne.printStackTrace();
      throw new CommandException(
          "error while commiting a working copy to the repository '"
                    + wcDir + "'", svne);
View Full Code Here

TOP

Related Classes of org.exist.versioning.svn.WorkingCopy

Copyright © 2018 www.massapicom. 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.