Examples of SVNRevision


Examples of org.tigris.subversion.svnclientadapter.SVNRevision

            if( !RbSVNUrlUtils.isProjectWithSameSVNRepository( projectToResources.keySet() ) ){
                throw new Exception( RbSubclipseMessages.getString("ERROR_PROJECT_NOTSAME_REPOSITORY") );
            }
           
            //再逐个生成resources的diff
            SVNRevision toRevision = SVNRevision.WORKING;
            monitor.worked(200);
            for ( Iterator<Entry<IProject, List<IResource>>> iEntry = projectToResources.entrySet().iterator(); iEntry.hasNext(); ) {
                monitor.worked(100)
                Entry<IProject, List<IResource>> entry = (Entry<IProject, List<IResource>>) iEntry.next();
                IProject project = (IProject) entry.getKey();
                List<IResource> resources = (List<IResource>) entry.getValue();
               
                String repositoryRootUrl = RbSVNUrlUtils.getRepositoryRootUrlForResource( project );
                String projectSVNUrl = RbSVNUrlUtils.getSVNUrlForProject( project );
                if( !repositoryRootUrl.endsWith("/") ){
                    repositoryRootUrl += "/";
                }
                if( !projectSVNUrl.endsWith("/") ){
                    projectSVNUrl += "/";
                }
                String relativeRepositoryRootUrl = projectSVNUrl.replaceFirst( repositoryRootUrl, EMPTY_STRING );
               
                for( IResource resourceTmp : resources ){
                    if( ! (resourceTmp instanceof IFile) ){
                        continue;
                    }
                    File tempDiffFile = IOUtils.generateTmpFile( FOLDER_TMP_DIFF, DIFF_SUFFIX);
                    File resourceFileTmp = ((IFile)resourceTmp).getLocation().toFile();
                    SVNRevision compareVersionReal = compareVersion;
                    //修复版本号
                    if( compareVersionReal instanceof SVNRevision.Number ){
                        compareVersionReal = RbSVNUrlUtils.reviseSVNRevisionAdaptByMaxOrMin( resourceTmp, (SVNRevision.Number)compareVersion, false, null );
                        if( null == compareVersionReal ){
                            compareVersionReal = compareVersion;
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

        //先初始化变量
        startVersion = 0;
        stopVersion = 0;
        reviewboardClient = null;
       
        SVNRevision fromRevision = null;
        SVNRevision toRevision = null;
        Object[] selectedObjects = selection.toArray();
       
        //请求方式:(1)右键Team,显示资源历史记录
        if (selectedObjects[0] instanceof ILogEntry) {
            selectedSVNResources = new ISVNResource[2];
            selectedSVNResources[0] = ((ILogEntry)selectedObjects[0]).getResource();
            toRevision = ((ILogEntry)selectedObjects[0]).getRevision();
           
            if (selectedObjects.length > 1) {
                selectedSVNResources[1] = ((ILogEntry)selectedObjects[1]).getResource();
                fromRevision = ((ILogEntry)selectedObjects[1]).getRevision();                 
            }
        }
       
        //请求方式:(2)从SVN资源库直接打开历史记录的情况(这种情况下无法获得IResource)
        if ( null == selectedSVNResources || selectedSVNResources.length == 0) {
            selectedSVNResources = getSelectedRemoteResources();
            if ( null != selectedSVNResources && selectedSVNResources.length > 0 ) {
                if (selectedSVNResources[0] instanceof ISVNRemoteResource)
                    toRevision = ((ISVNRemoteResource)selectedSVNResources[0]).getRevision();
                if (selectedSVNResources.length > 1 && selectedSVNResources[1] instanceof ISVNRemoteResource)
                    fromRevision = ((ISVNRemoteResource)selectedSVNResources[1]).getRevision()
            }
        }
       
        if( null == selectedSVNResources || selectedSVNResources.length == 0 ){
            return ;
        }

        ArrayList<IResource> selectedResourceList = new ArrayList<IResource>();
        for( ISVNResource svnResourceTmp : selectedSVNResources ){
            if( null == svnResourceTmp ){
                continue;
            }
            IResource resource = svnResourceTmp.getResource();
            if( null == resource ){
                continue;
            }
            //确认resourceList已经不包含重复值
            boolean isExsit = false;
            for( IResource resourceTmp : selectedResourceList){
                if( resourceTmp.getLocation().toString().equals(resource.getLocation().toString())){
                    isExsit = true;
                    break;
                }
            }
            if( !isExsit ){
                selectedResourceList.add( resource );
            }
       
        }
        selectedResources = selectedResourceList.toArray( new IResource[selectedResourceList.size()] );

        final IReviewboardClientRepository reviewboardClientRepository = SVNClientRepositoryAwair.getReviewboardClientRepository();
       
        //友好化用户体验
        if( null == reviewboardClientRepository.getClientFromUrlToClientMap()){
            run(new IRunnableWithProgress() {
                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    if( null != reviewboardClientRepository ){
                        if( null != monitor ){
                            monitor.setTaskName(RbSubclipseMessages.getString("PROGRESS_READINGCACHE")); //$NON-NLS-1$
                            monitor.worked(1);
                        }
                        try {
                            reviewboardClient = reviewboardClientRepository.getClient(false, monitor);
                        } catch (OperationCanceledException e) {
                            return ;
                        }
                    }
                }
            }, true, PROGRESS_DIALOG);
        }else{
            try {
                reviewboardClient = reviewboardClientRepository.getClient(false, null);
            } catch (OperationCanceledException e) {
                return ;
            }
        }
       
        if( null == reviewboardClient ){
            MessageDialog.openError(getShell(),
                    RbSubclipseMessages.getString("ERROR_INFORMATION_LABLE"),
                    RbSubclipseMessages.getString("ERROR_SERVER_NOT_CONFIFIGURED")); //$NON-NLS-1$
            return;
        }
       
        if( null != fromRevision ){
            try {
                startVersion = Integer.parseInt(fromRevision.toString());
            } catch (NumberFormatException e) {
            }
        }
        if( null != toRevision ){
            try {
                stopVersion = Integer.parseInt(toRevision.toString());
            } catch (NumberFormatException e) {
            }
        }
       
        if( startVersion > stopVersion ){
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

            }
           
            if( null == client ){
                return ;
            }
            SVNRevision pegRevision = null;
            if ( localNewVersionFlag && fromUrl.toString().equals(toUrl.toString()) && localResource != null) {
                if (localResource.getResource() == null) pegRevision = SVNRevision.HEAD;
                else {
                    IResource resource = localResource.getResource();
                    ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

                client = repository.getSVNClient();
            }
            if( null == client ){
                return sVNDiffSummarys;
            }
            SVNRevision pegRevision = null;
            if ( localNewVersionFlag && fromUrl.toString().equals(toUrl.toString()) && localResource != null) {
                if (localResource.getResource() == null){
                    pegRevision = SVNRevision.HEAD;
                }
                else {
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

    }
    /**
     * 本插件读取SVNRevision均遵循该规范
     */
    public static SVNRevision[] formateSVNRevisionUnify(String start, String stop ){
        SVNRevision fromRevision;
        SVNRevision toRevision;
        if(start.trim().isEmpty()){
            fromRevision = SVNRevision.HEAD;
        }
        else {
            try {
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

        if (!resource.exists())
            return null;
        try {
            ISVNLocalResource svnResourceFor = SVNWorkspaceRoot
                .getSVNResourceFor(resource);
            final SVNRevision revision = svnResourceFor.getRevision();
            if (revision != null)
                return revision.toString();
        } catch (SVNException e) {
            log.error("Error retrieving revision for " + resource, e);
        }
        return null;
    }
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

            // FIXME ndh: Use a CheckoutCommand instead. We should not depend on
            // org.tigris.subversion.subclipse.ui.
            final CheckoutAsProjectOperation checkoutAsProjectOperation = new CheckoutAsProjectOperation(
                null, remote, local);

            SVNRevision revision = getRevision(info.revision);
            if (revision != null)
                checkoutAsProjectOperation.setSvnRevision(revision);

            checkoutAsProjectOperation.run(monitor);
            result = local[0];
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

            + revisionString;
        // TODO Why doesn't this work? The caption of the dialog still reads
        // "Operation in progress".
        monitor.beginTask(taskName, 1);

        SVNRevision revision = getRevision(revisionString);
        if (revision == null)
            return;
        SVNWorkspaceRoot root;
        try {
            SVNTeamProvider provider = (SVNTeamProvider) RepositoryProvider
View Full Code Here

Examples of org.tigris.subversion.svnclientadapter.SVNRevision

            addToVersionControl(resource);
            return;
        }
        String taskName = "Switching " + resource.getName();
        monitor.beginTask(taskName, 1);
        SVNRevision revision = getRevision(revisionString);
        if (revision == null)
            return;
        SVNWorkspaceRoot root;
        SVNTeamProvider provider = (SVNTeamProvider) RepositoryProvider
            .getProvider(resource.getProject());
View Full Code Here

Examples of org.tmatesoft.svn.core.wc.SVNRevision

        e2.printStackTrace();
      }
      /*
       * A revision to check out
       */
      SVNRevision revision = SVNRevision.HEAD;

      /*
       * A revision for which you're sure that the url you specify is
       * exactly what you need
       */
      SVNRevision pegRevision = SVNRevision.HEAD;

      /*
       * A local path where a Working Copy will be ckecked out
       */
      File destPath = new File(m_installpath);
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.