/**
   * Prime the remote tree with the sync info from the local workspace. This is done to ensure that
   * we don't get a huge number of outgoing changes before the first refresh.
   */
  public void primeRemoteTree() throws CVSException {
    for (int i = 0; i < resources.length; i++) {
      IResource resource = resources[i];
      ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
      cvsResource.accept(
          new ICVSResourceVisitor() {
            public void visitFile(ICVSFile file) throws CVSException {
              byte[] bytes = file.getSyncBytes();
              if (bytes != null) {
                try {
                  tree.getByteStore().setBytes(file.getIResource(), bytes);
                } catch (TeamException e) {
                  throw CVSException.wrapException(e);
                }
              }
            }

            public void visitFolder(ICVSFolder folder) throws CVSException {
              // No need to copy sync info for folders since
              // CVS resource variant tree will get missing
              // folder info from the local resources
              folder.acceptChildren(this);
            }
          });
    }
  }