Package org.tmatesoft.hg.repo

Examples of org.tmatesoft.hg.repo.HgInvalidControlFileException


      daIndex.seek(recordOffset + 32);
      byte[] rv = new byte[20];
      daIndex.readBytes(rv, 0, 20);
      return rv;
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Revision lookup failed", ex, indexFile).setRevisionIndex(revisionIndex);
    } finally {
      daIndex.done();
    }
  }
View Full Code Here


      int recordOffset = getIndexOffsetInt(revisionIndex);
      daIndex.seek(recordOffset + 20);
      int linkRev = daIndex.readInt();
      return linkRev;
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Linked revision lookup failed", ex, indexFile).setRevisionIndex(revisionIndex);
    } finally {
      daIndex.done();
    }
  }
View Full Code Here

      // although NO_REVISION == -1, it doesn't hurt to ensure this
      parents[0] = p1 == -1 ? NO_REVISION : p1;
      parents[1] = p2 == -1 ? NO_REVISION : p2;
      return parents;
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Parents lookup failed", ex, indexFile).setRevisionIndex(revisionIndex);
    } finally {
      daIndex.done();
    }
  }
View Full Code Here

          return i;
        }
        daIndex.skip(inline ? 12 + compressedLen : 12);
      }
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Revision lookup failed", ex, indexFile).setRevision(nodeid);
    } finally {
      daIndex.done();
    }
    return BAD_REVISION;
  }
View Full Code Here

      long value = daIndex.readLong();
      value = value >>> 16;
      int compressedLen = daIndex.readInt();
      return lastRev == 0 ? compressedLen : value + compressedLen;
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Linked revision lookup failed", ex, indexFile).setRevisionIndex(lastRev);
    } finally {
      daIndex.done();
    }
  }
View Full Code Here

    ReaderN1 r = new ReaderN1(needData, inspector, repo.shallMergePatches());
    try {
      r.start(end - start + 1, getLastRevisionRead());
      r.range(start, end);
    } catch (IOException ex) {
      throw new HgInvalidControlFileException(String.format("Failed reading [%d..%d]", start, end), ex, indexFile);
    } finally {
      CachedRevision cr = r.finish();
      setLastRevisionRead(cr);
    }
  }
View Full Code Here

          return;
        }
      }
    } catch (IOException ex) {
      final int c = sortedRevisions.length;
      throw new HgInvalidControlFileException(String.format("Failed reading %d revisions in [%d; %d]", c, sortedRevisions[0], sortedRevisions[c-1]), ex, indexFile);
    } finally {
      CachedRevision cr = r.finish();
      setLastRevisionRead(cr);
    }
  }
View Full Code Here

    shallDropDerivedCaches = true;
    if (!outlineCached()) {
      return;
    }
    if (baseRevisions.length != revisionIndex) {
      throw new HgInvalidControlFileException(String.format("New entry's index shall be %d, not %d", baseRevisions.length, revisionIndex), null, indexFile);
    }
    if (baseRevisionIndex < 0 || baseRevisionIndex > baseRevisions.length) {
      // baseRevisionIndex MAY be == to baseRevisions.length, it's when new revision is based on itself
      throw new HgInvalidControlFileException(String.format("Base revision index %d doesn't fit [0..%d] range", baseRevisionIndex, baseRevisions.length), null, indexFile);
    }
    assert revision != null;
    assert !revision.isNull();
    // next effort doesn't seem to be of any value at least in case of regular commit
    // as the next call to #initOutline would recognize the file change and reload complete revlog anyway
View Full Code Here

          long l = da.readLong();
          offset = l >>> 16;
        }
      }
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Failed to analyze revlog index", ex, indexFile);
    } finally {
      da.done();
      if (notifyReload && observers != null) {
        for (Observer l : observers) {
          l.reloaded(this);
View Full Code Here

TOP

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

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.