Examples of Revision


Examples of org.apache.wicket.util.diff.Revision

  }

  @Override
  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 16);

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

  }

  @Override
  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 17);

      if (header.startsWith("<?xml"))
      {
        header = header.substring(header.indexOf(LINE_ENDING) + LINE_ENDING.length());
      }
      else
      {
        // Then only take the first 16 lines
        String[] headers = header.split(LINE_ENDING);
        StringBuilder sb = new StringBuilder();
        for (int i = 0; (i < 16) && (i < headers.length); i++)
        {
          if (sb.length() > 0)
          {
            sb.append(LINE_ENDING);
          }
          sb.append(headers[i]);
        }
        header = sb.toString();
      }

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      e.printStackTrace();
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

  }

  @Override
  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 16);

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

  }

  @Override
  public boolean checkLicenseHeader(final File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 14);

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

        if (orig == null)
            throw new IllegalArgumentException("original sequence is null");
        if (rev == null)
            throw new IllegalArgumentException("revised sequence is null");

        Revision revision = new Revision();
        if (path.isSnake())
            path = path.prev;
        while (path != null && path.prev != null && path.prev.j >= 0)
        {
            if (path.isSnake())
                throw new IllegalStateException(
                        "bad diffpath: found snake when looking for diff");
            int i = path.i;
            int j = path.j;

            path = path.prev;
            int ianchor = path.i;
            int janchor = path.j;

            Delta delta = Delta.newDelta(new Chunk(orig, ianchor, i - ianchor),
                    new Chunk(rev, janchor, j - janchor));
            revision.insertDelta(delta);
            if (path.isSnake())
                path = path.prev;
        }
        return revision;
    }
View Full Code Here

Examples of org.apache.wicket.util.diff.Revision

    return "xmlLicense.txt";
  }

  public boolean checkLicenseHeader(File file)
  {
    Revision revision = null;

    try
    {
      String header = extractLicenseHeader(file, 0, 17);

      if (header.startsWith("<?xml"))
      {
        header = header.substring(header.indexOf(LINE_ENDING) + LINE_ENDING.length());
      }
      else
      {
        // Then only take the first 16 lines
        String[] headers = header.split(LINE_ENDING);
        header = "";
        for (int i = 0; i < 16 && i < headers.length; i++)
        {
          if (header.length() > 0)
          {
            header += LINE_ENDING;
          }
          header += headers[i];
        }
      }

      revision = Diff.diff(getLicenseHeader().split(LINE_ENDING), header.split(LINE_ENDING));
    }
    catch (Exception e)
    {
      e.printStackTrace();
      Assert.fail(e.getMessage());
    }

    return revision.size() == 0;
  }
View Full Code Here

Examples of org.eclipse.jface.text.revisions.Revision

  private void paintRange(RevisionRange range, GC gc) {
    ILineRange widgetRange= modelLinesToWidgetLines(range);
    if (widgetRange == null)
      return;

    Revision revision= range.getRevision();
    boolean drawArmedFocus= range == fMouseHandler.fMouseDownRegion;
    boolean drawSelection= !drawArmedFocus && revision == fSelectedRevision;
    boolean drawFocus= !drawSelection && !drawArmedFocus && revision == fFocusRevision;
    Rectangle box= computeBoxBounds(widgetRange);

    gc.setBackground(lookupColor(revision, false));
    if (drawArmedFocus) {
      Color foreground= gc.getForeground();
      Color focusColor= lookupColor(revision, true);
      gc.setForeground(focusColor);
      gc.fillRectangle(box);
      gc.drawRectangle(box.x, box.y, box.width - 1, box.height - 1); // highlight box
      gc.drawRectangle(box.x + 1, box.y + 1, box.width - 3, box.height - 3); // inner highlight box
      gc.setForeground(foreground);
    } else if (drawFocus || drawSelection) {
      Color foreground= gc.getForeground();
      Color focusColor= lookupColor(revision, true);
      gc.setForeground(focusColor);
      gc.fillRectangle(box);
      gc.drawRectangle(box.x, box.y, box.width - 1, box.height - 1); // highlight box
      gc.setForeground(foreground);
    } else {
      gc.fillRectangle(box);
    }

    if ((fShowAuthor || fShowRevision)) {
      int indentation= 1;
      int baselineBias= getBaselineBias(gc, widgetRange.getStartLine());
      if (fShowAuthor && fShowRevision) {
        gc.drawString(revision.getId(), indentation, box.y + baselineBias, true);
        gc.drawString(revision.getAuthor(), fAuthorInset, box.y + baselineBias, true);
      } else if (fShowAuthor) {
        gc.drawString(revision.getAuthor(), indentation, box.y + baselineBias, true);
      } else if (fShowRevision) {
        gc.drawString(revision.getId(), indentation, box.y + baselineBias, true);
      }
    }
  }
View Full Code Here

Examples of org.evolizer.versioncontrol.cvs.model.entities.Revision

                for (CommitFile commitFile : commit.getFiles()) {
                    LOGGER.debug("found file " + commitFile.getName());
                    // Check if the file in this commit has already been found in an earlier commit
                    VersionedFile file = this.createFile(commitFile.getName());
                    Revision revision = new Revision(commit.getSha());
                    revision.setFile(file);
                    if (filesContent != null && !filesContent.isEmpty()) {
                        String source = filesContent.get(commitFile.getName());
                        if (source != null) {
                            revision.setSource(source);
                        }
                    }
                    revision.setState(commitFile.getChangeType());
                    Person author = this.createPerson(commit.getAuthor());
                    this.createModificationReport(commitFile, commit, revision, author);

                    // Getting the committer role and adding this new revision to it
                    for (Role r : author.getRoles()) {
                        if (r instanceof CommitterRole) {
                            ((CommitterRole) r).addRevision(revision);
                            break;
                        }
                    }

                    Revision latestRevision = file.getLatestRevision();
                    if (latestRevision != null) {
                        latestRevision.setNextRevision(revision);
                        revision.setPreviousRevision(latestRevision);
                    }
                    file.addRevision(revision);
                    revision.addRelease(fCurrRelease);
                    fCurrRelease.addRevision(revision);
View Full Code Here

Examples of org.exoplatform.services.document.diff.Revision

   public void testEmptySequences() throws Exception
   {
      String[] emptyOrig = {};
      String[] emptyRev = {};
      DiffService diffService = new DiffServiceImpl(getAlgo());
      Revision revision = diffService.diff(emptyOrig, emptyRev);

      assertEquals("revision size is not zero", 0, revision.size());
   }
View Full Code Here

Examples of org.jayasoft.woj.common.model.content.Organisation.Module.Revision

    Module module = getModule(moduleName);
    if(module == null) {
      module = new Module(moduleName);
      addModule(module);
    }
    Revision rev = module.getRevision(revision);
    if(rev == null) {
      rev = new Revision(revision);
    }
    module.addRevision(rev);
  }
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.