@Override
 protected void load() {
   if (myPI != null) {
     myPI.setText2(SvnBundle.message("progress.text2.changes.establishing.connection", myUrl));
   }
   SVNWCClient wcClient = myVcs.createWCClient();
   try {
     final SVNURL svnurl = SVNURL.parseURIEncoded(myUrl);
     SVNInfo info = null;
     info = wcClient.doInfo(svnurl, SVNRevision.UNDEFINED, SVNRevision.HEAD);
     final String root = info.getRepositoryRootURL().toString();
     String relativeUrl = myUrl;
     if (myUrl.startsWith(root)) {
       relativeUrl = myUrl.substring(root.length());
     }
     SVNLogClient client = myVcs.createLogClient();
     client.doLog(
         svnurl,
         new String[] {},
         SVNRevision.UNDEFINED,
         SVNRevision.HEAD,
         SVNRevision.create(1),
         false,
         true,
         mySupport15,
         0,
         null,
         new RepositoryLogEntryHandler(
             myVcs,
             myUrl,
             SVNRevision.UNDEFINED,
             relativeUrl,
             myConsumer,
             info.getRepositoryRootURL()));
   } catch (SVNCancelException e) {
     //
   } catch (SVNException e) {
     myException = new VcsException(e);
   } catch (VcsException e) {
     myException = e;
   }
 }
 private void collectLogEntriesForRepository(
     final ProgressIndicator indicator,
     FilePath file,
     final Consumer<VcsFileRevision> result,
     final Ref<Boolean> supports15Ref)
     throws SVNException, VcsException {
   final String url = file.getPath().replace('\\', '/');
   if (indicator != null) {
     indicator.setText2(SvnBundle.message("progress.text2.changes.establishing.connection", url));
   }
   SVNWCClient wcClient = myVcs.createWCClient();
   final SVNURL svnurl = SVNURL.parseURIEncoded(url);
   SVNInfo info = wcClient.doInfo(svnurl, SVNRevision.UNDEFINED, SVNRevision.HEAD);
   final String root = info.getRepositoryRootURL().toString();
   String relativeUrl = url;
   if (url.startsWith(root)) {
     relativeUrl = url.substring(root.length());
   }
   SVNLogClient client = myVcs.createLogClient();
   final boolean supports15 = SvnUtil.checkRepositoryVersion15(myVcs, root);
   supports15Ref.set(supports15);
   // todo log in history provider
   client.doLog(
       svnurl,
       new String[] {},
       SVNRevision.UNDEFINED,
       SVNRevision.HEAD,
       SVNRevision.create(1),
       false,
       true,
       supports15,
       0,
       null,
       new RepositoryLogEntryHandler(
           myVcs, url, SVNRevision.UNDEFINED, relativeUrl, result, info.getRepositoryRootURL()));
 }
示例#3
0
    @Override
    protected void load() {
      if (myPI != null) {
        myPI.setText2(SvnBundle.message("progress.text2.changes.establishing.connection", myUrl));
      }

      try {
        if (myForceBackwards) {
          SVNURL svnurl = SVNURL.parseURIEncoded(myUrl);
          if (!existsNow(svnurl)) {
            loadBackwards(svnurl);
            return;
          }
        }

        final SVNURL svnurl = SVNURL.parseURIEncoded(myUrl);
        SVNRevision operationalFrom = myFrom == null ? SVNRevision.HEAD : myFrom;
        // TODO: try to rewrite without separately retrieving repository url by item url - as this
        // command could require authentication
        // TODO: and it is not "clear enough/easy to implement" with current design (for some cases)
        // how to cache credentials (if in
        // TODO: non-interactive mode)
        final SVNURL rootURL = SvnUtil.getRepositoryRoot(myVcs, svnurl);
        if (rootURL == null) {
          throw new VcsException("Could not find repository root for URL: " + myUrl);
        }
        final String root = rootURL.toString();
        String relativeUrl = myUrl;
        if (myUrl.startsWith(root)) {
          relativeUrl = myUrl.substring(root.length());
        }
        SvnTarget target = SvnTarget.fromURL(svnurl, myPeg == null ? myFrom : myPeg);
        RepositoryLogEntryHandler handler =
            new RepositoryLogEntryHandler(
                myVcs,
                myUrl,
                SVNRevision.UNDEFINED,
                relativeUrl,
                createConsumerAdapter(myConsumer),
                rootURL);

        myVcs
            .getFactory(target)
            .createHistoryClient()
            .doLog(
                target,
                operationalFrom,
                myTo == null ? SVNRevision.create(1) : myTo,
                false,
                true,
                myShowMergeSources && mySupport15,
                myLimit + 1,
                null,
                handler);
      } catch (SVNCancelException e) {
        //
      } catch (SVNException e) {
        myException = new VcsException(e);
      } catch (VcsException e) {
        myException = e;
      }
    }