Examples of SVNRevision


Examples of org.evolizer.versioncontrol.svn.model.entities.SVNRevision

        List<Revision> revisions =
                fPersistenceProvider.query("FROM SVNRevision as f WHERE f.file.path LIKE '" + fromPath
                        + "%' ORDER BY f.file.path", Revision.class);
        HashMap<String, SVNRevision> m = new HashMap<String, SVNRevision>();
        for (Revision rev : revisions) {
            SVNRevision r = (SVNRevision) rev;
            SVNRevision found = m.get(r.getFile().getPath());
            if (found == null) {
                if (Long.parseLong(r.getNumber()) <= copyRevision) {
                    m.put(r.getFile().getPath(), r);
                }
            } else if (Long.parseLong(r.getNumber()) <= copyRevision
                    && Long.parseLong(r.getNumber()) > Long.parseLong(found.getNumber())) {
                m.put(r.getFile().getPath(), r);
            }
        }
        for (String key : m.keySet()) {
            SVNRevision oldRevision = m.get(key);
            String oldRevisionFileName = oldRevision.getFile().getPath();
            String newRevisionFileName = oldRevisionFileName.replaceFirst(fromPath, toPath);
            if (oldRevision.getState() == null) {
                // I create the new SVNRevision which will have as a revision number the one of the branch/release
                // creation
                SVNRevision newRevision = new SVNRevision(revisionNum + "");
                ModificationReport report = this.createModificationReport(creationTime, commitMessage, author);
                newRevision.setReport(report);

                // I also need to create a new File, as it is actually done by the SVN
                // It's the same of the old one, but with a different path
                SVNVersionedFile newFile = (SVNVersionedFile) createFile(newRevisionFileName);
                newRevision.setChangeSet(changeSet);
                changeSet.addRevision(newRevision); // Transaction -> SVNRevision
                newFile.addRevision(newRevision); // File -> SVNRevision
                newRevision.setFile(newFile); // SVNRevision -> File
                // Keep track of a new file ancestor
                newRevision.setAncestor(oldRevision);
                // I check whether I'm connecting the new SVNRevision to a Branch or to a Release
                if ((branch != null) && (release == null)) {
                    // Now I add the newly created file version to the Branch and viceversa
                    branch.addRevision(newRevision); // Branch -> SVNRevision
                    LOGGER.debug(NLS.bind(MapperMessages.SVNModelMapper_addedRevisionToBranch, new String[]{
                            newRevision.getFile().getPath(),
                            newRevision.getNumber(),
                            branch.getName(),
                            oldRevision.getFile().getPath(),
                            oldRevision.getNumber()}));
                } else if ((branch == null) && (release != null)) {
                    // I add the newly created file version to the Release and viceversa
                    release.addReleaseRevision(newRevision);

                    LOGGER.debug(NLS.bind(MapperMessages.SVNModelMapper_addedRevisionToRelease, new String[]{
                            newRevision.getFile().getPath(),
                            newRevision.getNumber(),
                            release.getName(),
                            oldRevision.getFile().getPath(),
                            oldRevision.getNumber()}));
                }
            }
View Full Code Here

Examples of org.evolizer.versioncontrol.svn.model.entities.SVNRevision

            String copyPath,
            boolean deleted,
            String contents,
            String branchName) throws SVNImporterException {

        SVNRevision newRevision = new SVNRevision(number + "");
        SVNRevision oldRevision = (SVNRevision) file.getLatestRevision();
       
        LOGGER.debug(NLS.bind(MapperMessages.SVNModelMapper_createdRevision, file.getPath(), number));
        // Check if I'm actually modifying a revision that I was already created handling the same transaction.
        if (oldRevision != null && oldRevision.getNumber().compareTo(number + "") == 0) {
            newRevision = oldRevision;
            oldRevision = (SVNRevision) oldRevision.getPreviousRevision();
        } else {
            // Transaction -> SVNRevision
            changeSet.addRevision(newRevision);
            if (oldRevision != null) {
                // Older SVNRevision -> New one
                oldRevision.setNextRevision(newRevision);
                // New SVNRevision -> Old one
                newRevision.setPreviousRevision(oldRevision);
            }
            // File -> SVNRevision
            file.addRevision(newRevision);
View Full Code Here

Examples of org.evolizer.versioncontrol.svn.model.entities.SVNRevision

         * SVNRevisions is a list order by number of SVNRevision (from the earliest to the oldest).
         * So I'll go from the last element down. So, when a SVNRevision that has a SVNRevision
         * number smaller or equal to the wanted SVNRevision number if found, it's for sure the closest.
         */
        for (int i = f.getRevisions().size() - 1; i >= 0; i--) {
            SVNRevision revision = (SVNRevision) f.getRevisions().get(i);
            if (Long.parseLong(revision.getNumber()) <= revNum) {
                return revision;
            }
        }
        return null;
    }
View Full Code Here

Examples of org.evolizer.versioncontrol.svn.model.entities.SVNRevision

     * @param currSVNRevision
     *            The revision number of that File.
     * @return The previous revision number.
     */
    public String getPreviousRevision(String changedPath, long currSVNRevision) {
        SVNRevision revision = null;
        long currRevision = currSVNRevision;
        while (revision == null && currRevision >= 0) {
            revision =
                    fPersistenceProvider.uniqueResult("FROM SVNRevision as f WHERE f.file.path='" + changedPath
                            + "' AND f.number = '" + (--currRevision) + "' ORDER BY(f.number) DESC", SVNRevision.class);
        }
        if ((revision != null)) {
            return revision.getNumber();
        } else {
            return "-1";
        }
    }
View Full Code Here

Examples of org.evolizer.versioncontrol.svn.model.entities.SVNRevision

     *            The Release to modify.
     * @see org.evolizer.model.resources.entities.fs.File
     * @see org.evolizer.versioncontrol.svn.model.entities.SVNRelease
     */
    private void removeRevisionFromRelease(SVNVersionedFile file, SVNRelease release) {
        SVNRevision toRemove = (SVNRevision) file.getLatestRevision();
        release.removeReleaseRevision(toRemove);
        toRemove.getReleases().remove(release); // SVNRevision ->Release
        toRemove.getChangeSet().getInvolvedRevisions().remove(toRemove);
        LOGGER.debug(NLS.bind(MapperMessages.SVNModelMapper_removedRevisionFromRelease, new String[]{
                file.getPath(),
                file.getLatestRevision().getNumber(),
                release.getName()}));
    }
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

   * @param scmRevision
   * @return
   */
  public boolean isValidRevision(ScmUrl scmUrl, String scmRevision) {
    try {
      SVNRevision revision = SVNRevision.getRevision(scmRevision);
      int kind = revision.getKind();
      return kind == SVNRevision.Kind.head || kind == SVNRevision.Kind.number || kind == SVNRevision.Kind.date;
    } catch(ParseException ex) {
      return false;
    }
  }
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

                    IStructuredSelection sel = (IStructuredSelection)event.getSelection();
                    Object sel0 = sel.getFirstElement();
                    if (sel0 instanceof IFile) {
                        IFile ifile = (IFile)sel0;
                        final ISVNLocalResource localResource= SVNWorkspaceRoot.getSVNResourceFor( ifile );
                        SVNRevision compareVersion = SVNRevision.BASE;
                        //compareVersion = SVNRevision.START;
                        ISVNRemoteResource svnRemoteResource = null;
                        int compareVersionInt = 0;
                        if( null != txtStart ){
                            compareVersionInt = getStartVersion();
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

                if(!isAcceptCharset){
                    return false;
                }
            }
           
            SVNRevision compareVersion = null;
            if( mainPage.getStartVersion() > 0 ){
                compareVersion = new SVNRevision.Number(mainPage.getStartVersion());
            }
            GeneratePreCommitDiffOperation generateDiffFileOperation = new GeneratePreCommitDiffOperation(
                    mainPageSelectedResources, unaddedAllResourceList, null, getShell(), compareVersion );
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

                    ISVNRemoteResource svnRemoteResource2 = null;
                    final ISVNLocalResource localResource= SVNWorkspaceRoot.getSVNResourceFor(resource);
                    String[] startAndStopVersion = getStartAndStopVersion();
                    SVNRevision[] fromAndToRevision = RbSVNUrlUtils.formateSVNRevisionUnify(startAndStopVersion[0], startAndStopVersion[1]);
                   
                    SVNRevision startVersion = fromAndToRevision[0];
                    SVNRevision stopVersion = fromAndToRevision[1];
                    //修复版本号
                    if( stopVersion instanceof SVNRevision.Number ){
                        stopVersion = RbSVNUrlUtils.reviseSVNRevision( resource, (SVNRevision.Number)fromAndToRevision[1], true, true, null );
                    }
                    if( startVersion instanceof SVNRevision.Number ){
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

                    String startUrl = baseSVNUrl[2];
                    SVNUrl fromUrl = new SVNUrl(stopUrl);
                    SVNUrl toUrl = new SVNUrl(startUrl);
                    try {
                        SVNRevision[] fromAndToRevision = RbSVNUrlUtils.formateSVNRevisionUnify(start, stop);
                        SVNRevision startVersion = fromAndToRevision[0];
                        SVNRevision stopVersion = fromAndToRevision[1];
                        //修复版本号
                        if( stopVersion instanceof SVNRevision.Number ){
                            stopVersion = RbSVNUrlUtils.reviseSVNRevision( resourceTmp,
                                    (SVNRevision.Number)fromAndToRevision[1], true, true, null );
                        }
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.