Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.HgLogCommand.file()


    } else {
      for (String fname : files) {
        HgDataFile f1 = hgRepo.getFileNode(fname);
        System.out.println("History of the file: " + f1.getPath());
        if (limit == -1) {
          cmd.file(f1.getPath(), true).execute(dump);
        } else {
          int[] r = new int[] { 0, f1.getRevisionCount() };
          if (fixRange(r, reverseOrder, limit) == 0) {
            System.out.println("No changes");
            continue;
View Full Code Here


  }

  private void buildFileLog() throws Exception {
    final long start = System.nanoTime();
    HgLogCommand cmd = new HgLogCommand(hgRepo);
    cmd.file("a2.txt", true, false);
    final int[] count = new int[] { 0 };
    class MyHandler implements HgChangesetTreeHandler, Adaptable {
      public void treeElement(HgChangesetTreeHandler.TreeElement entry) throws HgRuntimeException {
        StringBuilder sb = new StringBuilder();
        HashSet<Nodeid> test = new HashSet<Nodeid>(entry.childRevisions());
View Full Code Here

  public void testFollowMultipleRenames() throws Exception {
    repo = Configuration.get().find("log-renames");
    String fname = "a";
    eh.run("hg", "log", "--debug", "--follow", fname, "--cwd", repo.getLocation());
    HgLogCommand cmd = new HgLogCommand(repo);
    cmd.file(fname, true, true);
    CollectWithRenameHandler h1;
    //
    cmd.order(OldToNew).execute(h1 = new CollectWithRenameHandler());
    errorCollector.assertEquals(2, h1.rh.renames.size());
    report("Follow a->c->b, old2new:", h1.getChanges(), true);
View Full Code Here

    HgLogCommand cmd = new HgLogCommand(repo);
    // funny enough, but hg log -vf a -R c:\temp\hg\test-log\a doesn't work, while --cwd <same> works fine
    //
    changelogParser.reset();
    eh.run("hg", "log", "--debug", "a", "--cwd", repo.getLocation());
    report("log a", cmd.file("a", false).execute(), true);
    //
    changelogParser.reset();
    // fails with Mercurial 2.2.1, @see http://selenic.com/pipermail/mercurial-devel/2012-February/038249.html
    // and http://www.selenic.com/hg/rev/60101427d618?rev=
    // fix for the test (replacement) is available below 
View Full Code Here

//    report("log -f a", r, true);

    //
    changelogParser.reset();
    eh.run("hg", "log", "--debug", "-f", "e", "--cwd", repo.getLocation());
    report("log -f e", cmd.file("e", true).execute(), true);
    //
    changelogParser.reset();
    eh.run("hg", "log", "--debug", "dir/b", "--cwd", repo.getLocation());
    report("log dir/b", cmd.file("dir/b", false).execute(), true);
    //
View Full Code Here

    eh.run("hg", "log", "--debug", "-f", "e", "--cwd", repo.getLocation());
    report("log -f e", cmd.file("e", true).execute(), true);
    //
    changelogParser.reset();
    eh.run("hg", "log", "--debug", "dir/b", "--cwd", repo.getLocation());
    report("log dir/b", cmd.file("dir/b", false).execute(), true);
    //
    changelogParser.reset();
//   
//    Commented out for the same reason as above hg log -f a - newly introduced error message in Mercurial 2.2
//    when files are not part of the parent revision
View Full Code Here

    // commented tests from above updated to work in 2.2 - update repo to revision where files are present
    eh.run("hg", "update", "-q", "-r", "2", "--cwd", repo.getLocation());
    changelogParser.reset();
    eh.run("hg", "log", "--debug", "-f", "a", "--cwd", repo.getLocation());
    List<HgChangeset> r = cmd.file("a", true).execute();
    report("log -f a", r, true);
    changelogParser.reset();
    eh.run("hg", "log", "--debug", "-f", "dir/b", "--cwd", repo.getLocation());
    report("log -f dir/b", cmd.file("dir/b", true).execute(), true);
    //
View Full Code Here

    eh.run("hg", "log", "--debug", "-f", "a", "--cwd", repo.getLocation());
    List<HgChangeset> r = cmd.file("a", true).execute();
    report("log -f a", r, true);
    changelogParser.reset();
    eh.run("hg", "log", "--debug", "-f", "dir/b", "--cwd", repo.getLocation());
    report("log -f dir/b", cmd.file("dir/b", true).execute(), true);
    //
    // get repo back into clear state, up to the tip
    eh.run("hg", "update", "-q", "--cwd", repo.getLocation());
  }
View Full Code Here

      }
      revisionTags.add(tagName);
    }

    final HgLogCommand logCommand = new HgLogCommand(repository);
    logCommand.file(targetPath, true);
    logCommand.execute(new HgChangesetHandler() {
      public void cset(HgChangeset changeset) {
        if (changeset.getAffectedFiles().contains(targetPath)) {
          System.out.println(changeset.getRevisionIndex() + " " + changeSetRevisionToTags.get(changeset.getNodeid()));
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.