Package org.tmatesoft.hg.internal.DataSerializer

Examples of org.tmatesoft.hg.internal.DataSerializer.ByteArraySerializer.toByteArray()


      if (fp.first() != NO_REVISION && fp.second() == NO_REVISION && !isNewFile) {
        // compare file contents to see if anything has changed, and reuse old revision, if unchanged.
        // XXX ineffective, need better access to revision conten
        ByteArraySerializer bas = new ByteArraySerializer();
        bds.serialize(bas);
        final byte[] newContent = bas.toByteArray();
        // unless there's a way to reset DataSource, replace it with the content just read
        bds = new DataSerializer.ByteArrayDataSource(newContent);
        if (new ComparatorChannel(newContent).same(df, fp.first())) {
          fileRev = df.getRevision(fp.first());
        }
View Full Code Here


  }
 
  private byte[] toByteArray(DataSource content) throws HgIOException, HgRuntimeException {
    ByteArraySerializer ba = new ByteArraySerializer();
    content.serialize(ba);
    return ba.toByteArray();
  }

  private Nodeid revision(int revisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException {
    if (revisionIndex == NO_REVISION) {
      return Nodeid.NULL;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.