Package org.tmatesoft.hg.repo

Examples of org.tmatesoft.hg.repo.HgInvalidControlFileException


        revisionSequence.add(node);
        prevRevContent.done();
        prevRevContent = new ByteArrayDataAccess(content);
      } catch (HgIOException ex) {
        String m = String.format("Failed to write revision %s of file %s", ge.node().shortNotation(), filename);
        throw new HgInvalidControlFileException(m, ex, currentFile);
      } catch (IOException ex) {
        String m = String.format("Failed to write revision %s of file %s", ge.node().shortNotation(), filename);
        throw new HgInvalidControlFileException(m, ex, currentFile);
      }
      return cancelException == null;
    }
View Full Code Here


      for (Nodeid n : draftPhaseRoots) {
        fw.write(String.format(fmt, HgPhase.Draft.mercurialOrdinal(), n.toString()));
      }
      fw.flush();
    } catch (IOException ex) {
      throw new HgInvalidControlFileException(ex.getMessage(), ex, phaseroots);
    } finally {
      new FileUtils(repo.getLog(), this).closeQuietly(fw);
    }
  }
View Full Code Here

        roots.add(rootRev);
      }
      draftPhaseRoots = phase2roots.containsKey(Draft) ? phase2roots.get(Draft) : Collections.<Nodeid> emptyList();
      secretPhaseRoots = phase2roots.containsKey(Secret) ? phase2roots.get(Secret) : Collections.<Nodeid> emptyList();
    } catch (HgIOException ex) {
      throw new HgInvalidControlFileException(ex, true);
    }
    return Boolean.TRUE;
  }
View Full Code Here

        }
        ds.writeByte(clogMap.get(linkRevision).toByteArray());
        pds.serialize(ds);
      } catch (IOException ex) {
        // XXX odd to have object with IOException to use where no checked exception is allowed
        throw new HgInvalidControlFileException(ex.getMessage(), ex, null);
      } catch (HgIOException ex) {
        throw new HgInvalidControlFileException(ex, true); // XXX any way to refactor ChunkGenerator not to get checked exception here?
      }
    }
View Full Code Here

        state = readState(new BufferedReader(new FileReader(hgstateFile)));
      } else {
        state = Collections.emptyMap();
      }
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Subrepo state read failed", ex, hgstateFile);
    }
    try {
      BufferedReader br = new BufferedReader(new FileReader(hgsubFile));
      return readConfig(br, state);
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Subrepo state read failed", ex, hgsubFile);
    }
  }
View Full Code Here

      }
    }
    // data.isEmpty is not reliable, renamed files of size==0 keep only metadata
    if (!metadataIsComplete) {
      // XXX perhaps, worth a testcase (empty file, renamed, read or ask ifCopy
      throw new HgInvalidControlFileException("Metadata is not closed properly", null, null);
    }
    return lastEntryStart;
  }
View Full Code Here

        } else {
          repo.getLog().dump(getClass(), Severity.Warn, "Dirstate record for file %s (size: %d, tstamp:%d) has unknown state '%c'", r.name(), r.size(), r.modificationTime(), state);
        }
      }
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Dirstate read failed", ex, dirstateFile);
    } finally {
      da.done();
    }
  }
View Full Code Here

      if (da.isEmpty()) {
        return new Pair<Nodeid,Nodeid>(NULL, NULL);
      }
      return internalReadParents(da);
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Error reading working copy parents from dirstate", ex, dirstateFile);
    } finally {
      da.done();
    }
  }
View Full Code Here

        r.close();
      } catch (FileNotFoundException ex) {
        internalRepo.getLog().dump(HgDirstate.class, Debug, ex, null); // log verbose debug, exception might be legal here
        // IGNORE
      } catch (IOException ex) {
        throw new HgInvalidControlFileException("Error reading file with branch information", ex, branchFile);
      }
    }
    return branch;
  }
View Full Code Here

      int recordOffset = getIndexOffsetInt(revisionIndex);
      daIndex.seek(recordOffset + 12); // 6+2+4
      int actualLen = daIndex.readInt();
      return actualLen;
    } catch (IOException ex) {
      throw new HgInvalidControlFileException(null, ex, indexFile).setRevisionIndex(revisionIndex);
    } finally {
      daIndex.done();
    }
  }
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.