Package org.tmatesoft.hg.util

Examples of org.tmatesoft.hg.util.Path


    result = new HgStatusCollector.Record();
  }

  public void parse(CharSequence seq) {
    Matcher m = pattern.matcher(seq);
    Path lastEntry = null;
    while (m.find()) {
      Path fname = pathHelper.path(m.group(2));
      switch ((int) m.group(1).charAt(0)) {
      case (int) 'M' : {
        result.modified(fname);
        lastEntry = fname; // for files modified through merge there's also 'copy' source
        break;
View Full Code Here


    final IntMap<List<TagInfo>> tagLocalRev2TagInfo = new IntMap<List<TagInfo>>(allTags.length);
    System.out.printf("Collecting manifests for %d tags\n", allTags.length);
    final int[] tagLocalRevs = collectLocalTagRevisions(clogrmap, allTags, tagLocalRev2TagInfo);
    System.out.printf("Prepared %d tag revisions to analyze: %d ms\n", tagLocalRevs.length, System.currentTimeMillis() - start);

    final Path targetPath = Path.create("README");
    //
    collectTagsPerFile_Approach_1(clogrmap, tagLocalRevs, allTags, targetPath);
    System.out.printf("Total time: %d ms\n", System.currentTimeMillis() - start);

    System.out.println("\nApproach 2");
View Full Code Here

    }
  }
 
  public static void main2(String[] args) throws HgCallbackTargetException, HgException, CancelledException, HgRuntimeException {
    final HgRepository repository = new HgLookup().detect(new File("/temp/hg/cpython"));
    final Path targetPath = Path.create("README");
    final HgTags tags = repository.getTags();
    final Map<String, HgTags.TagInfo> tagToInfo = tags.getAllTags();
    final HgManifest manifest = repository.getManifest();
    final Map<Nodeid, List<String>> changeSetRevisionToTags = new HashMap<Nodeid, List<String>>();
    final HgDataFile fileNode = repository.getFileNode(targetPath);
View Full Code Here

    // init empty
    HgRepository hgRepo = new HgInitCommand().location(repoLoc).revlogV1().execute();
    assertFalse("[sanity]", hgRepo.isInvalid());
    assertEquals("[sanity]", 0, hgRepo.getChangelog().getRevisionCount());
    // add 2 files
    Path fa = Path.create("a"), fb = Path.create("b");
    final File fileA = new File(repoLoc, fa.toString());
    final File fileB = new File(repoLoc, fb.toString());
    RepoUtils.createFile(fileA, "first file");
    RepoUtils.createFile(fileB, "second file");
    new HgAddRemoveCommand(hgRepo).add(fa, fb).execute();
    new HgCommitCommand(hgRepo).message("FIRST").execute();
    // add one more file
    // remove one initial file
    Path fc = Path.create("c");
    final File fileC = new File(repoLoc, fc.toString());
    RepoUtils.createFile(fileC, "third file");
    fileB.delete();
    // TODO HgAddRemoveCommand needs #copy(from, to) method
    new HgAddRemoveCommand(hgRepo).add(fc).remove(fb).execute();
    new HgCommitCommand(hgRepo).message("SECOND").execute();
View Full Code Here

  @Test
  public void testMergeAndCommit() throws Exception {
    File repoLoc = RepoUtils.createEmptyDir("composite-scenario-2");
    HgRepository hgRepo = new HgInitCommand().location(repoLoc).revlogV1().execute();
    Path fa = Path.create("file1"), fb = Path.create("file2"), fc = Path.create("file3");
    final File fileA = new File(repoLoc, fa.toString());
    final File fileB = new File(repoLoc, fb.toString());
    // rev0: +file1, +file2
    RepoUtils.createFile(fileA, "first file");
    RepoUtils.createFile(fileB, "second file");
    new HgAddRemoveCommand(hgRepo).add(fa, fb).execute();
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.util.Path

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.