Package org.tmatesoft.hg.util

Examples of org.tmatesoft.hg.util.Path


    repo = Configuration.get().find("status-1");
    HgStatusCommand cmd = new HgStatusCommand(repo);
    StatusCollector sc = new StatusCollector();
    cmd.all().base(7).execute(sc);
    assertTrue(sc.getErrors().isEmpty());
    Path file5 = Path.create("dir/file5");
    // shall not be listed at all
    assertTrue(sc.get(file5).isEmpty());
  }
View Full Code Here


    repo = Configuration.get().find("status-1");
    HgStatusCommand cmd = new HgStatusCommand(repo);
    StatusCollector sc = new StatusCollector();
    cmd.all().execute(sc);
    assertTrue(sc.getErrors().isEmpty());
    final Path file2 = Path.create("file2");
    assertTrue(sc.get(file2).contains(Modified));
    assertTrue(sc.get(file2).size() == 1);
  }
View Full Code Here

    repo = Configuration.get().find("status-1");
    HgStatusCommand cmd = new HgStatusCommand(repo);
    StatusCollector sc = new StatusCollector();
    cmd.all().execute(sc);
    assertTrue(sc.getErrors().isEmpty());
    Path file4 = Path.create("dir/file4");
    assertTrue(sc.get(file4).contains(Removed));
    assertTrue(sc.get(file4).size() == 1);
    //
    // different code path (collect != null)
    cmd.base(3).execute(sc = new StatusCollector());
View Full Code Here

    repo = Configuration.get().find("status-1");
    HgStatusCommand cmd = new HgStatusCommand(repo);
    StatusCollector sc = new StatusCollector();
    cmd.all().execute(sc);
    assertTrue(sc.getErrors().isEmpty());
    final Path file3 = Path.create("dir/file3");
    assertTrue(sc.get(file3).contains(Ignored));
    assertTrue(sc.get(file3).size() == 1);
    //
    cmd.base(3).execute(sc = new StatusCollector());
    assertTrue(sc.getErrors().isEmpty());
View Full Code Here

    HgStatusCommand cmd = new HgStatusCommand(repo);
    StatusCollector sc = new StatusCollector();
    cmd.base(1);
    cmd.all().execute(sc);
    assertTrue(sc.getErrors().isEmpty());
    final Path file1 = Path.create("file1");
    assertTrue(sc.get(file1).contains(Unknown));
    assertTrue(sc.get(file1).contains(Removed));
    assertTrue(sc.get(file1).size() == 2);
    //
    // no file1 in rev 2, shall be reported as unknown only
View Full Code Here

     * C .hgignore
     * ? file1
     * M file2
     * C readme
     */
    final Path file1 = Path.create("file1");
    assertTrue(sc.get(file1).contains(Unknown));
    assertTrue(sc.get(file1).size() == 1);
    assertTrue(sc.get(Removed).isEmpty());
    assertTrue(sc.get(Clean).size() == 2);
    assertTrue(sc.get(Modified).size() == 1);
View Full Code Here

  @Test
  public void testSpecificFileStatus() throws Exception {
    repo = Configuration.get().find("status-1");
    // files only
    final Path file2 = Path.create("file2");
    final Path file3 = Path.create("dir/file3");
    HgWorkingCopyStatusCollector sc = HgWorkingCopyStatusCollector.create(repo, file2, file3);
    HgStatusCollector.Record r = new HgStatusCollector.Record();
    sc.walk(WORKING_COPY, r);
    assertTrue(r.getAdded().isEmpty());
    assertTrue(r.getRemoved().isEmpty());
    assertTrue(r.getUnknown().isEmpty());
    assertTrue(r.getClean().isEmpty());
    assertTrue(r.getMissing().isEmpty());
    assertTrue(r.getCopied().isEmpty());
    assertTrue(r.getIgnored().contains(file3));
    assertTrue(r.getIgnored().size() == 1);
    assertTrue(r.getModified().contains(file2));
    assertTrue(r.getModified().size() == 1);
    // mix files and directories
    final Path readme = Path.create("readme");
    final Path dir = Path.create("dir/");
    sc = HgWorkingCopyStatusCollector.create(repo, readme, dir);
    sc.walk(WORKING_COPY, r = new HgStatusCollector.Record());
    assertTrue(r.getAdded().isEmpty());
    assertTrue(r.getRemoved().size() == 2);
    for (Path p : r.getRemoved()) {
View Full Code Here

  }

  @Test
  public void testSameResultDirectPathVsMatcher() throws Exception {
    repo = Configuration.get().find("status-1");
    final Path file3 = Path.create("dir/file3");
    final Path file5 = Path.create("dir/file5");

    HgWorkingCopyStatusCollector sc = HgWorkingCopyStatusCollector.create(repo, file3, file5);
    HgStatusCollector.Record r;
    sc.walk(WORKING_COPY, r = new HgStatusCollector.Record());
    assertTrue(r.getRemoved().contains(file5));
    assertTrue(r.getIgnored().contains(file3));
    //
    // query for the same file, but with
    sc = HgWorkingCopyStatusCollector.create(repo, new PathGlobMatcher(file3.toString(), file5.toString()));
    sc.walk(WORKING_COPY, r = new HgStatusCollector.Record());
    assertTrue(r.getRemoved().contains(file5));
    assertTrue(r.getIgnored().contains(file3));
  }
View Full Code Here

    cmd.base(3).revision(8).all();
    cmd.match(new PathGlobMatcher("dir/*"));
    StatusCollector sc = new StatusCollector();
    cmd.execute(sc);
    assertTrue(sc.getErrors().isEmpty());
    final Path file3 = Path.create("dir/file3");
    final Path file4 = Path.create("dir/file4");
    final Path file5 = Path.create("dir/file5");
    //
    assertTrue(sc.get(file3).contains(Removed));
    assertTrue(sc.get(file3).size() == 1);
    assertTrue(sc.get(Removed).size() == 1);
    //
View Full Code Here

    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());
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.