Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.HgStatusCommand


 
  @Test
  public void testDetectRenamesInNonFirstRev() throws Exception {
    repo = Configuration.get().find("log-renames");
    eh.cwd(repo.getWorkingDir());
    final HgStatusCommand cmd = new HgStatusCommand(repo).defaults();
    StatusCollector sc;
    for (int r : new int[] {2,3,4}) {
      statusParser.reset();
      eh.run("hg", "status", "-C", "--change", String.valueOf(r));
      cmd.change(r).execute(sc = new StatusCollector());
      sr.report("hg status -C --change " + r, sc);
    }
    // a and d from r5 are missing in r3
    statusParser.reset();
    eh.run("hg", "status", "-C", "--rev", "3", "--rev", "5");
    cmd.base(3).revision(5).execute(sc = new StatusCollector());
    sr.report("hg status -C 3..5 ", sc);
    //
    // a is c which is initially b
    // d is b which is initially a
    Path fa = Path.create("a");
    Path fb = Path.create("b");
    Path fc = Path.create("c");
    Path fd = Path.create("d");
    // neither initial a nor b have isCopy(() == true
    assertFalse("[sanity]", repo.getFileNode(fa).isCopy());
    // check HgStatusCollector
    // originals (base revision) doesn't contain first copy origin (there's no b in r2)
    cmd.base(2).revision(5).execute(sc = new StatusCollector());
    errorCollector.assertEquals(fa, sc.new2oldName.get(fd));
    errorCollector.assertEquals(Collections.singletonList(Removed), sc.get(fc));
    // ensure same result with HgWorkingCopyStatusCollector
    cmd.base(2).revision(WORKING_COPY).execute(sc = new StatusCollector());
    errorCollector.assertEquals(fa, sc.new2oldName.get(fd));
    errorCollector.assertEquals(Collections.singletonList(Removed), sc.get(fc));
    // originals (base revision) does contain first copy origin (b is in r1)
    cmd.base(1).revision(5).execute(sc = new StatusCollector());
    errorCollector.assertEquals(fa, sc.new2oldName.get(fd));
    errorCollector.assertEquals(Collections.singletonList(Removed), sc.get(fb));
  }
View Full Code Here


      eh.run("hg", "status", "-A", "--rev", "3:80");
    }
    final long start2 = System.currentTimeMillis();
    for (int i = 0; i < runs; i++) {
      StatusCollector r = new StatusCollector();
      new HgStatusCommand(repo).all().base(3).revision(80).execute(r);
    }
    final long end = System.currentTimeMillis();
    System.out.printf("'hg status -A --rev 3:80', %d runs:  Native client total %d (%d per run), Java client %d (%d)\n", runs, start2 - start1, (start2 - start1) / runs, end - start2,
        (end - start2) / runs);
  }
View Full Code Here

      wcLock.acquire();
      System.out.print(".");
      storeLock.acquire();
      System.out.print(".");
      try {
        new HgStatusCommand(hgRepo).execute(new TestStatus.StatusCollector());
        System.out.printf("%d ms)\n", (System.nanoTime() - start) / 1000000);
      } finally {
        storeLock.release();
        wcLock.release();
      }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.core.HgStatusCommand

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.