Esempio n. 1
0
  private boolean hasSwitchedRoots() {
    File currentRoot = myMergeContext.getWcInfo().getRootInfo().getIoFile();

    return myMergeContext
        .getVcs()
        .getAllWcInfos()
        .stream()
        .filter(info -> NestedCopyType.switched.equals(info.getType()))
        .anyMatch(info -> FileUtil.isAncestor(currentRoot, info.getRootInfo().getIoFile(), true));
  }
Esempio n. 2
0
 @NotNull
 private Task newIntegrateTask(@NotNull String title, @NotNull MergerFactory mergerFactory) {
   return new SvnIntegrateChangesTask(
       myMergeContext.getVcs(),
       new WorkingCopyInfo(myMergeContext.getWcInfo().getPath(), true),
       mergerFactory,
       parseUrl(myMergeContext.getSourceUrl()),
       title,
       false,
       myMergeContext.getBranchName()) {
     @Override
     public void onFinished() {
       super.onFinished();
       mySemaphore.up();
     }
   };
 }
Esempio n. 3
0
  @NotNull
  private MergerFactory createMergeAllFactory(
      boolean reintegrate, @Nullable WrapperInvertor copyPoint, boolean supportsMergeInfo) {
    long revision =
        copyPoint != null
            ? reintegrate
                ? copyPoint.getWrapped().getTargetRevision()
                : copyPoint.getWrapped().getSourceRevision()
            : -1;

    return (vcs, target, handler, currentBranchUrl, branchName) ->
        new BranchMerger(
            vcs,
            currentBranchUrl,
            myMergeContext.getWcInfo().getPath(),
            handler,
            reintegrate,
            myMergeContext.getBranchName(),
            revision,
            supportsMergeInfo);
  }
Esempio n. 4
0
  @CalledInAwt
  public void execute() {
    FileDocumentManager.getInstance().saveAllDocuments();

    mySemaphore.down();
    runInEdt(
        () -> {
          if (areInSameHierarchy(
              createUrl(myMergeContext.getSourceUrl()), myMergeContext.getWcInfo().getUrl())) {
            end("Cannot merge from self", true);
          } else if (!hasSwitchedRoots() || myInteraction.shouldContinueSwitchedRootFound()) {
            runInBackground(
                "Checking repository capabilities",
                indicator -> {
                  if (supportsMergeInfo()) {
                    runInEdt(this::selectMergeVariant);
                  } else {
                    mergeAll(false);
                  }
                });
          }
        });
  }
Esempio n. 5
0
 public boolean is18() {
   return myMergeContext.getWcInfo().getFormat().isOrGreater(ONE_DOT_EIGHT);
 }
Esempio n. 6
0
 private boolean supportsMergeInfo() {
   return myMergeContext.getWcInfo().getFormat().supportsMergeInfo()
       && checkRepositoryVersion15(myMergeContext.getVcs(), myMergeContext.getSourceUrl());
 }