Пример #1
0
    public void bumpTo(SVNSqlJetDb sDb, File wcRootAbsPath) throws SVNException {
      // -- STMT_HAS_WORKING_NODES
      // SELECT 1 FROM nodes WHERE op_depth > 0
      // LIMIT 1
      SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields> stmt =
          new SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.NODES__Fields>(
              sDb, SVNWCDbSchema.NODES) {
            protected void defineFields() {
              fields.add(SVNWCDbSchema.NODES__Fields.wc_id);
            }

            protected boolean isFilterPassed() throws SVNException {
              return getColumnLong(SVNWCDbSchema.NODES__Fields.op_depth) > 0;
            }
          };

      boolean haveRow = false;
      try {
        haveRow = stmt.next();
      } finally {
        stmt.reset();
      }

      if (haveRow) {
        SVNErrorMessage err =
            SVNErrorMessage.create(
                SVNErrorCode.UNSUPPORTED_FEATURE,
                "The working copy at ''{0}'' is format 22 with WORKING nodes; use a format 22 client to diff/revert before using this client",
                wcRootAbsPath);
        SVNErrorManager.error(err, SVNLogType.WC);
      }

      setVersion(sDb, (int) 23);
    }
Пример #2
0
    public void bumpTo(SVNSqlJetDb sDb, File wcRootAbsPath) throws SVNException {
      /*
      -- STMT_HAS_ACTUAL_NODES_CONFLICTS
      SELECT 1 FROM actual_node
      WHERE NOT ((prop_reject IS NULL) AND (conflict_old IS NULL)
                 AND (conflict_new IS NULL) AND (conflict_working IS NULL)
                 AND (tree_conflict_data IS NULL))
      LIMIT 1
      */

      SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.ACTUAL_NODE__Fields> stmt =
          new SVNSqlJetSelectFieldsStatement<SVNWCDbSchema.ACTUAL_NODE__Fields>(
              sDb, SVNWCDbSchema.ACTUAL_NODE) {
            protected void defineFields() {
              fields.add(SVNWCDbSchema.ACTUAL_NODE__Fields.wc_id);
            }

            protected boolean isFilterPassed() throws SVNException {
              return !(isColumnNull(SVNWCDbSchema.ACTUAL_NODE__Fields.prop_reject)
                  && isColumnNull(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_old)
                  && isColumnNull(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_new)
                  && isColumnNull(SVNWCDbSchema.ACTUAL_NODE__Fields.conflict_working)
                  && isColumnNull(SVNWCDbSchema.ACTUAL_NODE__Fields.tree_conflict_data));
            }
          };

      boolean haveRow = false;
      try {
        haveRow = stmt.next();
      } finally {
        stmt.reset();
      }

      if (haveRow) {
        SVNErrorMessage err =
            SVNErrorMessage.create(
                SVNErrorCode.UNSUPPORTED_FEATURE,
                "The working copy at ''{0}'' is format 26 with conflicts; use a format 26 client to resolve before using this client",
                wcRootAbsPath);
        SVNErrorManager.error(err, SVNLogType.WC);
      }

      setVersion(sDb, (int) 27);
    }