Examples of Revision


Examples of hudson.plugins.git.Revision

     */
    public Collection<Revision> getAllBranchRevisions() throws GitException, IOException {
        Map<ObjectId, Revision> revisions = new HashMap<ObjectId, Revision>();
        List<Branch> branches = git.getRemoteBranches();
        for (Branch b : branches) {
            Revision r = revisions.get(b.getSHA1());
            if (r == null) {
                r = new Revision(b.getSHA1());
                revisions.put(b.getSHA1(), r);
            }
            r.getBranches().add(b);
        }
        return revisions.values();
    }
View Full Code Here

Examples of hudson.plugins.git.Revision

        List<Revision> l = new ArrayList<Revision>(revisions);

        OUTER:
        for (int i = 0; i < l.size(); i++) {
            for (int j = i + 1; j < l.size(); j++) {
                Revision ri = l.get(i);
                Revision rj = l.get(j);
                ObjectId commonAncestor = git.mergeBase(ri.getSha1(), rj.getSha1());
                if (commonAncestor == null) {
                    continue;
                }

                if (commonAncestor.equals(ri.getSha1())) {
                    LOGGER.fine("filterTipBranches: " + rj + " subsumes " + ri);
                    l.remove(i);
                    i--;
                    continue OUTER;
                }
                if (commonAncestor.equals(rj.getSha1())) {
                    LOGGER.fine("filterTipBranches: " + ri + " subsumes " + rj);
                    l.remove(j);
                    j--;
                }
            }
View Full Code Here

Examples of hudson.plugins.git.Revision

        // this only makes sense for a build, there is no
        // reason to poll for a commit
        if (!isPollCall && singleBranch.matches("[0-9a-f]{6,40}")) {
            try {
                ObjectId sha1 = git.revParse(singleBranch);
                Revision revision = new Revision(sha1);
                revision.getBranches().add(new Branch("detached", sha1));
                verbose(listener, "Will build the detached SHA1 {0}", sha1);
                return Collections.singletonList(revision);
            } catch (GitException e) {
                // revision does not exist, may still be a branch
                // for example a branch called "badface" would show up here
                verbose(listener, "Not a valid SHA1 {0}", singleBranch);
            }
        }

        // if it doesn't contain '/' then it could be either a tag or an unqualified branch
        if (!singleBranch.contains("/")) {
            // the 'branch' could actually be a tag:
            Set<String> tags = git.getTagNames(singleBranch);
            if (tags.size() == 0) {
                // its not a tag, so lets fully qualify the branch
                String repository = gitSCM.getRepositories().get(0).getName();
                singleBranch = repository + "/" + singleBranch;
                verbose(listener, "{0} is not a tag. Qualifying with the repository {1} a a branch", singleBranch,
                    repository);
            }
        }

        try {
            ObjectId sha1 = git.revParse(singleBranch);
            verbose(listener, "rev-parse {0} -> {1}", singleBranch, sha1);

            // if polling for changes don't select something that has
            // already been built as a build candidate
            if (isPollCall && data.hasBeenBuilt(sha1)) {
                verbose(listener, "{0} has already been built", sha1);
                return emptyList();
            }

            verbose(listener, "Found a new commit {0} to be built on {1}", sha1, singleBranch);

            Revision revision = new Revision(sha1);
            revision.getBranches().add(new Branch(singleBranch, sha1));
            return Collections.singletonList(revision);
        } catch (GitException e) {
            // branch does not exist, there is nothing to build
            verbose(listener, "Failed to rev-parse: {0}", singleBranch);
            return emptyList();
View Full Code Here

Examples of kanakata.runtime.Revision

        super(new BorderLayout());
        buildUi();
    }

    public void buildUi() {
        Revision revision = Revision.fromManifest(getClass());
        JPanel revisionPanel = buildRevisionPanel(revision);
        add(revisionPanel, BorderLayout.CENTER);
    }
View Full Code Here

Examples of org.apache.commons.jrcs.diff.Revision

    getSourceViewer().getTextWidget().setRedraw(false);
   
    String[] text1 = doc.get().split("\n");
    String[] text2 = text.split("\n");
    try {
      Revision rev = Diff.diff(text1,text2);
      int count1 = 0;
      int count2 = 0;
      int index  = 0;
      for(int i=0;i<rev.size();i++){
        Delta delta = rev.getDelta(i);
        Range orgRange = new Range(delta.getOriginal().rangeString());
        Range revRange = new Range(delta.getRevised().rangeString());
        // matched
        while(count1!=orgRange.getFrom()-1){
          index = index + text1[count1].length() + 1;
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
                        break;
                    }
                    case SET_MAP_ENTRY: {
                        Revision r = k.getRevision();
                        if (r == null) {
                            throw new IllegalStateException(
                                    "SET_MAP_ENTRY must not have null revision");
                        }
                        DBObject value = new RevisionEntry(r, op.value);
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

*/
public class UtilsTest {

    @Test
    public void getPreviousIdFor() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        assertEquals("1:p/" + r.toString(), Utils.getPreviousIdFor("0:/", r));
        assertEquals("2:p/test/" + r.toString(), Utils.getPreviousIdFor("1:/test", r));
        assertEquals("14:p/a/b/c/d/e/f/g/h/i/j/k/l/m/" + r.toString(), Utils.getPreviousIdFor("13:/a/b/c/d/e/f/g/h/i/j/k/l/m", r));
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

    }

    @Ignore("Performance test")
    @Test
    public void performance_getPreviousIdFor() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        String id = Utils.getIdFromPath("/some/test/path/foo");
        // warm up
        for (int i = 0; i < 1 * 1000 * 1000; i++) {
            Utils.getPreviousIdFor(id, r);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

    }

    @Ignore("Performance test")
    @Test
    public void performance_revisionToString() {
        Revision r = new Revision(System.currentTimeMillis(), 0, 0);
        // warm up
        for (int i = 0; i < 1 * 1000 * 1000; i++) {
            r.toString();
        }
        long time = System.currentTimeMillis();
        for (int i = 0; i < 30 * 1000 * 1000; i++) {
            r.toString();
        }
        time = System.currentTimeMillis() - time;
        System.out.println(time);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.Revision

                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
                        break;
                    }
                    case SET_MAP_ENTRY: {
                        Revision r = k.getRevision();
                        if (r == null) {
                            throw new IllegalStateException(
                                    "SET_MAP_ENTRY must not have null revision");
                        }
                        DBObject value = new RevisionEntry(r, op.value);
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.