Package com.aragost.javahg.internals

Examples of com.aragost.javahg.internals.HgInputStream


     * Return tags that is pointing the this changeset
     */
    public List<String> tags() {
        GenericLogCommand cmd = new GenericLogCommand(getRepository()).style("tags");
        cmd.rev(getNode());
        HgInputStream stream = cmd.stream();
        List<String> result = Lists.newArrayList();
        try {
            while (!stream.isEof()) {
                String tag = stream.textUpTo(0);
                if (!"tip".equals(tag)) {
                    result.add(tag);
                }
            }
        } catch (IOException e) {
View Full Code Here


     *            the changeset to graft
     */
    public GraftContext execute(Changeset changeset) {
        Repository repo = getRepository();
        repo.lock();
        HgInputStream stream = launchStream(changeset.getNode());
        try {
            if (stream.match("grafting revision ".getBytes())) {
                int rev = stream.revisionUpTo('\n');
                GraftContext ctx = new GraftContext(this, rev);
                if (!stream.isEof()) {
                    ctx.processStream(stream, true);
                }
                stream.consumeAll();
                boolean flagOrKeepDeleteConflicts = !ctx.getFlagConflicts().isEmpty()
                        || !ctx.getKeepDeleteConflicts().isEmpty();
                if (getReturnCode() == -1 && this.hasConflicts || flagOrKeepDeleteConflicts) {
                    if (flagOrKeepDeleteConflicts && ctx.getMergeConflicts().isEmpty()) {
                        // graft has actually made a new changeset,
View Full Code Here

    /**
     * @return the parents of the working directory or revision
     */
    public List<Changeset> execute() {
        HgInputStream stream = launchStream();
        return Changeset.readListFromStream(getRepository(), stream);
    }
View Full Code Here

    /**
     * @param file The file whose parents to get
     * @return the parents of the working directory or revision
     */
    public List<Changeset> execute(String file) {
        HgInputStream stream = launchStream(file);
        return Changeset.readListFromStream(getRepository(), stream);
    }
View Full Code Here

        List<String> commandLine = new ArrayList<String>(this.cmdLine);
        getRepository().addToCommandLine(commandLine);
        commandLine.addAll(Arrays.asList(args));
        try {
            this.outputChannelStream = this.repository.getServer().runCommand(commandLine, this);
            return new HgInputStream(outputChannelStream, this.repository.getServer().getDecoder());
        } catch (IOException e) {
            throw new RuntimeIOException(e);
        }
    }
View Full Code Here

    public Bundle execute(String src) {
        if (this.bundleFile == null) {
            this.bundleFile = Utils.createTempFile("javahg", "hg");
        }
        cmdAppend("--bundle", this.bundleFile.getPath());
        HgInputStream stream = launchStream(src);
        Bundle bundle = new Bundle(getRepository().getBaseRepository(), this.bundleFile);
        List<Changeset> changesets = Changeset.readListFromStream(bundle.getOverlayRepository(), stream);
        if (changesets.isEmpty()) {
            bundle.close();
            return null;
View Full Code Here

     *            an optional list of files to retrieve the log for.
     *            With no files, all changesets are considered.
     * @return the log as a list of changesets
     */
    public List<Changeset> execute(String... files) {
        HgInputStream stream = launchStream(files);
        return Changeset.readListFromStream(getRepository(), stream);
    }
View Full Code Here

     *
     * @return List we status of merge files
     * @throws IOException
     */
    public List<ResolveStatusLine> list() {
        HgInputStream stream = launchStream("--list");
        List<ResolveStatusLine> result = Lists.newArrayList();
        try {
            while (stream.peek() != -1) {
                result.add(ResolveStatusLine.fromStream(stream));
            }
        } catch (IOException e) {
            throw new RuntimeIOException(e);
        }
View Full Code Here

     * @return list of annotated lines.
     * @throws IOException
     */
    public List<AnnotateLine> execute(String file) throws IOException {
        Repository repo = getRepository();
        HgInputStream stream = launchStream(file);
        LogCommand logCmd = LogCommand.on(repo);
        Map<Integer, String> dataMap = Maps.newHashMap();
        List<AnnotateLine> result = Lists.newArrayList();
        while (stream.peek() != -1) {
            Integer rev = stream.decimalIntUpTo(':');
            logCmd.rev(rev.toString());
            stream.skip(1);
            String data = stream.textUpTo('\n');
            dataMap.put(rev, data);
        }
        List<Changeset> changesets = logCmd.execute();
        for (Changeset changeset : changesets) {
            String data = dataMap.get(changeset.getRevision());
View Full Code Here

    /**
     * @return the root of the repository
     * @throws IOException
     */
    public List<Changeset> execute() {
        HgInputStream stream = launchStream();
        return Changeset.readListFromStream(getRepository(), stream);
    }
View Full Code Here

TOP

Related Classes of com.aragost.javahg.internals.HgInputStream

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.