Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.HgAnnotateCommand$Inspector


    if (!repo.init(cmdLineOpts.findRepository())) {
      System.err.printf("Can't find repository in: %s\n", repo.getRepository().getLocation());
      return;
    }
    int rev = cmdLineOpts.getSingleInt(TIP, "-r", "--rev");
    HgAnnotateCommand cmd = repo.createAnnotateCommand();
    AnnotateDumpInspector insp = new AnnotateDumpInspector(cmdLineOpts.getBoolean(false, "-l", "--line-number"));
    cmd.changeset(rev);
    for (String fname : cmdLineOpts.getList("")) {
      cmd.file(Path.create(fname));
      cmd.execute(insp);
    }
  }
View Full Code Here


  @Test
  public void testAnnotateCmdFollowNoFollow() throws Exception {
    HgRepoFacade hgRepoFacade = new HgRepoFacade();
    HgRepository repo = Configuration.get().find("test-annotate2");
    hgRepoFacade.init(repo);
    HgAnnotateCommand cmd = hgRepoFacade.createAnnotateCommand();
    final Path fname = Path.create("file1b.txt");
    final int changeset = TIP;
    AnnotateInspector ai = new AnnotateInspector();

    cmd.changeset(changeset);
    // follow
    cmd.file(fname);
    cmd.execute(ai);
    AnnotateRunner ar = new AnnotateRunner(fname, repo.getWorkingDir());
    ar.run(changeset, true);
    doAnnotateLineCheck(changeset, ar, ai);
   
    // no follow
    cmd.file(fname, false);
    ai = new AnnotateInspector();
    cmd.execute(ai);
    ar.run(changeset, false);
    doAnnotateLineCheck(changeset, ar, ai);
  }
View Full Code Here

    // hg annotate handles merge in its own way, here we check
    // how map(diff(p1->base->p2)) merge strategy works
    final String file1AnnotateResult = "3:1:1\n3:2:2x\n3:3:3y\n2:4:z\n0:1:1\n1:2:2x\n4:3:3y\n";
    final String file4AnnotateResult = "3:1:1\n1:2:2x\n4:3:3y\n2:4:z\n0:1:1\n3:6:2x\n3:7:3y\n";
    final String file5AnnotateResult = "0:1:1\n1:2:2x\n4:3:3y\n2:4:z\n5:5:1\n5:6:2x\n5:7:3y\n";
    HgAnnotateCommand cmd = new HgAnnotateCommand(repo);
    cmd.changeset(5);
    AnnotateInspector insp = new AnnotateInspector();
    // file1
    cmd.file(df1, false).execute(insp);
    doAnnotateLineCheck(5, splitLines(file1AnnotateResult), insp);
    // file4
    cmd.file(df4, false).execute(insp = new AnnotateInspector());
    doAnnotateLineCheck(5, splitLines(file4AnnotateResult), insp);
    // file5
    cmd.file(df5, false).execute(insp = new AnnotateInspector());
    doAnnotateLineCheck(5, splitLines(file5AnnotateResult), insp);
}
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.core.HgAnnotateCommand$Inspector

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.