Package org.tmatesoft.hg.core

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


    List<String> files = cmdLineOpts.getList("");
    final long start = System.currentTimeMillis();
    if (files.isEmpty()) {
      if (limit == -1) {
        // no revisions and no limit
        cmd.execute(dump);
      } else {
        // in fact, external (to dump inspector) --limit processing yelds incorrect results when other args
        // e.g. -u or -b are used (i.e. with -u shall give <limit> csets with user, not check last <limit> csets for user
        int[] r = new int[] { 0, hgRepo.getChangelog().getRevisionCount() };
        if (fixRange(r, reverseOrder, limit) == 0) {
View Full Code Here


          return adapterClass.cast(new Log.RenameDumpHandler());
        }
        return null;
      }
    };
    cmd.execute(new MyHandler());
    System.out.println(count[0]);
    final long end = System.nanoTime();
    System.out.printf("buildFileLog: %,d ms\n", (end-start)/1000);
  }
View Full Code Here

    assertTrue("[sanity]", repo.getFileNode(fnameNoRename).exists());
   
    // first, check that file without renames doesn't report any accidentally
    CollectWithRenameHandler h1 = new CollectWithRenameHandler();
    HgLogCommand cmd = new HgLogCommand(repo).file(fnameNoRename, false, false);
    cmd.execute(h1);
    errorCollector.assertEquals(0, h1.rh.renames.size());
    TreeCollectHandler h2 = new TreeCollectHandler(false);
    RenameCollector rh = new RenameCollector(h2);
    cmd.execute(h2);
    errorCollector.assertEquals(0, rh.renames.size());
View Full Code Here

    HgLogCommand cmd = new HgLogCommand(repo).file(fnameNoRename, false, false);
    cmd.execute(h1);
    errorCollector.assertEquals(0, h1.rh.renames.size());
    TreeCollectHandler h2 = new TreeCollectHandler(false);
    RenameCollector rh = new RenameCollector(h2);
    cmd.execute(h2);
    errorCollector.assertEquals(0, rh.renames.size());
   
    // check default iterate direction
    cmd = new HgLogCommand(repo).file(fname2, false, false);
    cmd.execute(h1 = new CollectWithRenameHandler());
View Full Code Here

    cmd.execute(h2);
    errorCollector.assertEquals(0, rh.renames.size());
   
    // check default iterate direction
    cmd = new HgLogCommand(repo).file(fname2, false, false);
    cmd.execute(h1 = new CollectWithRenameHandler());
    errorCollector.assertEquals(1, h1.rh.renames.size());
    assertRename(fname1, fname2, h1.rh.renames.get(0));
   
    h2 = new TreeCollectHandler(false);
    rh = new RenameCollector(h2);
View Full Code Here

    errorCollector.assertEquals(1, h1.rh.renames.size());
    assertRename(fname1, fname2, h1.rh.renames.get(0));
   
    h2 = new TreeCollectHandler(false);
    rh = new RenameCollector(h2);
    cmd.execute(h2);
    errorCollector.assertEquals(1, rh.renames.size());
    assertRename(fname1, fname2, rh.renames.get(0));
   
    eh.run("hg", "log", "--debug", fname2, "--cwd", repo.getLocation());
    report("HgChangesetHandler+RenameHandler with followRenames = false, default iteration order", h1.getChanges(), true);
View Full Code Here

   
    //
    // Now, check that iteration in opposite direction (new to old)
    // still reports renames (and correct revisions, too)
    cmd.order(HgIterateDirection.NewToOld);
    cmd.execute(h1 = new CollectWithRenameHandler());
    errorCollector.assertEquals(1, h1.rh.renames.size());
    assertRename(fname1, fname2, h1.rh.renames.get(0));
    h2 = new TreeCollectHandler(false);
    rh = new RenameCollector(h2);
    cmd.execute(h2);
View Full Code Here

    cmd.execute(h1 = new CollectWithRenameHandler());
    errorCollector.assertEquals(1, h1.rh.renames.size());
    assertRename(fname1, fname2, h1.rh.renames.get(0));
    h2 = new TreeCollectHandler(false);
    rh = new RenameCollector(h2);
    cmd.execute(h2);
    errorCollector.assertEquals(1, rh.renames.size());
    assertRename(fname1, fname2, rh.renames.get(0));
    report("HgChangesetHandler+RenameHandler with followRenames = false, new2old iteration order", h1.getChanges(), false);
    report("HgChangesetTreeHandler+RenameHandler with followRenames = false, new2old iteration order", h2.getResult(), false);
  }
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.