Package org.tmatesoft.hg.repo

Examples of org.tmatesoft.hg.repo.HgInvalidStateException


          return n;
        }
      }
      int csetStart = changeHistory.get(0).changeset;
      int csetEnd = changeHistory.get(changeHistory.size() - 1).changeset;
      throw new HgInvalidStateException(String.format("For change history (cset[%d..%d]) could not find node for file change %s", csetStart, csetEnd, fileRevision.shortNotation()));
    }
View Full Code Here


    return fileRevision.getRevision();
  }

  private void assertCheckRan() {
    if (checkResult == null) {
      throw new HgInvalidStateException("Shall invoke #check(Path) first");
    }
  }
View Full Code Here

    Metadata.Record i = entries.get(revision);
    if (i == NONE) {
      return; // already there
    }
    if (i != null) {
      throw new HgInvalidStateException(String.format("Trying to override Metadata state for revision %d (known offset: %d)", revision, i));
    }
    entries.put(revision, NONE);
  }
View Full Code Here

      for (Pair<Integer, HgDataFile> e : files) {
        if (e.first() >= clogRevIndex) {
          return e.second();
        }
      }
      throw new HgInvalidStateException(String.format("Got %d file-changelog mappings, but no luck for revision %d.", files.size(), clogRevIndex));
    }
View Full Code Here

        }
        return rv;
      } catch (CancelledException ex) {
        // TODO likely it was bad idea to throw cancelled exception from content()
        // deprecate and provide alternative?
        HgInvalidStateException ise = new HgInvalidStateException("ByteArrayChannel never throws CancelledException");
        ise.initCause(ex);
        throw ise;
      }
    }
View Full Code Here

  private static int offsetFieldToInlineFileOffset(long offset, int recordIndex) throws HgInvalidStateException {
    int o = Internals.ltoi(offset);
    if (o != offset) {
      // just in case, can't happen, ever, unless HG (or some other bad tool) produces index file
      // with inlined data of size greater than 2 Gb.
      throw new HgInvalidStateException("Data too big, offset didn't fit to sizeof(int)");
    }
    return o + REVLOGV1_RECORD_SIZE * recordIndex;
  }
 
View Full Code Here

          p2IsDescendant = result.get(p2x);
        }
        //
        int rx = revisionIndex - rootRevIndex;
        if (rx != i) {
          throw new HgInvalidStateException(String.format("Sanity check failed. Revision %d. Expected:%d, was:%d", revisionIndex, rx, i));
        }
        // current revision is descendant if any of its parents is descendant
        result.set(rx, p1IsDescendant || p2IsDescendant);
        i++;
      }
View Full Code Here

        }
        case DelEntry: {
          cfgWrite.delete(op.section, op.key);
          break;
        }
        default: throw new HgInvalidStateException(String.format("Unknown change %s", op.kind));
        }
      }
      FileOutputStream fos = new FileOutputStream(configFile);
      cfgWrite.update(fos);
      fos.close();
View Full Code Here

    CollectHandler collector = new CollectHandler();
    try {
      execute(collector);
    } catch (HgCallbackTargetException ex) {
      // see below for CanceledException
      HgInvalidStateException t = new HgInvalidStateException("Internal error");
      t.initCause(ex);
      throw t;
    } catch (CancelledException ex) {
      // can't happen as long as our CollectHandler doesn't throw any exception
      HgInvalidStateException t = new HgInvalidStateException("Internal error");
      t.initCause(ex);
      throw t;
    }
    return collector.getChanges();
  }
View Full Code Here

        initTransform();
        repo.getChangelog().range(this, changesets2read);
        for (int changeset2read : changesets2read) {
          HgChangeset cs = cachedChangesets.get(changeset2read);
          if (cs == null) {
            throw new HgInvalidStateException(String.format("Can't get changeset for revision %d", changeset2read));
          }
          // HgChangelog.range may reorder changesets according to their order in the changelog
          // thus need to find original index
          boolean sanity = false;
          for (int i = 0; i < changelogRevisionIndex.length; i++) {
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.repo.HgInvalidStateException

Copyright © 2018 www.massapicom. 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.