Package org.tmatesoft.hg.core

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


    final String fname = "src/org/tmatesoft/hg/internal/PatchGenerator.java";
    final int checkChangeset = repo.getChangelog().getRevisionIndex(Nodeid.fromAscii("946b131962521f9199e1fedbdc2487d3aaef5e46")); // 539
    HgDataFile df = repo.getFileNode(fname);
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    HgDiffCommand diffCmd = new HgDiffCommand(repo);
    diffCmd.file(df).changeset(checkChangeset);
    diffCmd.executeParentsAnnotate(new DiffOutInspector(new PrintStream(bos)));
    LineGrepOutputParser gp = new LineGrepOutputParser("^@@.+");
    ExecHelper eh = new ExecHelper(gp, null);
    eh.run("hg", "diff", "-c", String.valueOf(checkChangeset), "-U", "0", fname);
    //
View Full Code Here


    final String fname = "src/org/tmatesoft/hg/internal/PatchGenerator.java";
    HgDataFile df = repo.getFileNode(fname);
    AnnotateRunner ar = new AnnotateRunner(df.getPath(), null);

    final HgDiffCommand diffCmd = new HgDiffCommand(repo);
    diffCmd.file(df).order(NewToOld);
    final HgChangelog clog = repo.getChangelog();
    final int[] toTest = new int[] {
      clog.getRevisionIndex(Nodeid.fromAscii("946b131962521f9199e1fedbdc2487d3aaef5e46")), // 539
      clog.getRevisionIndex(Nodeid.fromAscii("1e95f48d9886abe79b9711ab371bc877ca5e773e")), // 541
      /*, TIP */};
 
View Full Code Here

    HgRepository repo = Configuration.get().find("test-annotate");
    HgDataFile df = repo.getFileNode("file1");
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffOutInspector dump = new DiffOutInspector(new PrintStream(bos));
    HgDiffCommand diffCmd = new HgDiffCommand(repo);
    diffCmd.file(df).range(0, TIP).order(OldToNew);
    diffCmd.executeAnnotate(dump);
    LinkedList<String> apiResult = new LinkedList<String>(Arrays.asList(splitLines(bos.toString())));
   
    /*
     * FIXME this is an ugly hack to deal with the way `hg diff -c <mergeRev>` describes the change
View Full Code Here

    // rev6 changes rev4, rev4 changes rev3. Plus, anything changed
    // earlier than rev2 shall be reported as new from change3
    int[] change_2_8_new2old = new int[] {4, 6, 3, 4, -1, 3};
    int[] change_2_8_old2new = new int[] {-1, 3, 3, 4, 4, 6 };
    final HgDiffCommand cmd = new HgDiffCommand(repo);
    cmd.file(df);
    cmd.range(2, 8).order(NewToOld);
    cmd.executeAnnotate(insp);
    Assert.assertArrayEquals(change_2_8_new2old, insp.getReportedRevisionPairs());
    insp.reset();
    cmd.order(OldToNew).executeAnnotate(insp);
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.