Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.WorkingDirFileWriter


    CheckoutWorker(Internals implRepo) {
      hgRepo = implRepo;
    }
   
    public boolean next(Nodeid nid, Path fname, Flags flags) {
      WorkingDirFileWriter workingDirWriter = null;
      try {
        HgDataFile df = hgRepo.getRepo().getFileNode(fname);
        int fileRevIndex = df.getRevisionIndex(nid);
        // check out files based on manifest
        workingDirWriter = new WorkingDirFileWriter(hgRepo);
        workingDirWriter.processFile(df, fileRevIndex, flags);
        lastWrittenFileSize = workingDirWriter.bytesWritten();
        lastFileMode = workingDirWriter.fmode();
        lastFileModificationTime = workingDirWriter.mtime();
        return true;
      } catch (HgIOException ex) {
        failure = ex;
      } catch (HgRuntimeException ex) {
        failure = new HgLibraryFailureException(ex);
View Full Code Here


          dirstateBuilder.recordRemoved(file);
        }
      } else if (resolveUse != null) {
        if (resolveUse != revA) {
          changedDirstate = true;
          final WorkingDirFileWriter fw = new WorkingDirFileWriter(repo);
          fw.processFile(resolveUse);
          if (resolveUse == revB) {
            dirstateBuilder.recordMergedFromP2(file);
          } else {
            dirstateBuilder.recordMerged(file, fw.fmode(), fw.mtime(), fw.bytesWritten());
          }
        } // if resolution is to use revA, nothing to do
      } else if (resolveContent != null) {
        changedDirstate = true;
        // FIXME write content to file using transaction?
        InputStream is;
        try {
          is = new FileInputStream(resolveContent);
        } catch (IOException ex) {
          throw new HgIOException("Failed to read temporary content", ex, resolveContent);
        }
        final WorkingDirFileWriter fw = new WorkingDirFileWriter(repo);
        fw.processFile(file, is, revA == null ? revB.getFileFlags() : revA.getFileFlags());
        // XXX if presentState(null, fileOnlyInB), and use(InputStream) - i.e.
        // resolution is to add file with supplied content - shall I put 'Merged', MergedFromP2 or 'Added' into dirstate?
        if (revA == null && revB != null) {
          dirstateBuilder.recordMergedFromP2(file);
        } else {
          dirstateBuilder.recordMerged(file, fw.fmode(), fw.mtime(), fw.bytesWritten());
        }
      } // else no resolution was chosen, fine with that
    }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.internal.WorkingDirFileWriter

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.