Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.PathGlobMatcher


  private void testFileStatus() throws Exception {
//    final Path path = Path.create("src/org/tmatesoft/hg/util/");
//    final Path path = Path.create("src/org/tmatesoft/hg/internal/Experimental.java");
//    final Path path = Path.create("missing-dir/");
//    HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, path);
    HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, new PathGlobMatcher("mi**"));
    wcsc.walk(WORKING_COPY, new StatusDump());
  }
View Full Code Here


  @Test
  public void testSubTreeStatus() throws Exception {
    repo = Configuration.get().find("status-1");
    HgStatusCommand cmd = new HgStatusCommand(repo);
    StatusCollector sc = new StatusCollector();
    cmd.match(new PathGlobMatcher("*"));
    cmd.all().execute(sc);
    assertTrue(sc.getErrors().isEmpty());
    /*
     * 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);
    //
    cmd.match(new PathGlobMatcher("dir/*")).execute(sc = new StatusCollector());
    assertTrue(sc.getErrors().isEmpty());
    /*
     * I dir/file3
     * R dir/file4
     * R dir/file5
View Full Code Here

    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

  @Test
  public void testScopeInHistoricalStatus() throws Exception {
    repo = Configuration.get().find("status-1");
    HgStatusCommand cmd = new HgStatusCommand(repo);
    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");
View Full Code Here

TOP

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

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.