Package com.aragost.javahg.internals

Examples of com.aragost.javahg.internals.UnexpectedCommandOutputException


        if (createdChangeset == null && merge) {
            if (whenUnknowReturn) {
                return;
            }
            throw new UnexpectedCommandOutputException(this.getCommand(), null);
        }

        super.processStream(in, whenUnknowReturn);
    }
View Full Code Here


                Integer removed = in.readDecimal();
                in.mustMatch(FILES_REMOVED);
                Integer unresolved = in.readDecimal();
                in.mustMatch(" files unresolved\n".getBytes());
                if (merged == null || removed == null || unresolved == null) {
                    throw new UnexpectedCommandOutputException(this.command, null);
                }
                if (unresolved.intValue() == 0) {
                    this.mergeConflicts = Collections.emptyList();
                    // If there is merge conflicts it will be lazy
                    // intialized
                }
            } else if (in.match(USE_RESOLVE_EXPLANATION)) {
                // ignore
            } else if (in.match(USE_RESOLVE_SHORT_EXPLANATION)) {
                // ignore
            } else if (in.match(BRANCH_MERGE_EXPLANATION)) {
                // ignore
            } else {
                if (whenUnknowReturn) {
                    return;
                } else {
                    throw new UnexpectedCommandOutputException(Utils.readStream(in,
                            command.getRepository().newDecoder()));
                }
            }
            if (endPattern != null) {
                String fileName = in.textUpTo(endPattern);
View Full Code Here

        if (s.startsWith(PREFIX)) {
            s = s.substring(PREFIX.length());
            int n = s.indexOf(')');
            return HgVersion.fromString(new String(s.substring(0, n)));
        } else {
            throw new UnexpectedCommandOutputException(this, s);
        }
    }
View Full Code Here

                Integer removed = in.readDecimal();
                in.mustMatch(FILES_REMOVED);
                Integer unresolved = in.readDecimal();
                in.mustMatch(" files unresolved\n".getBytes());
                if (merged == null || removed == null || unresolved == null) {
                    throw new UnexpectedCommandOutputException(this.command, null);
                }
                if (unresolved.intValue() == 0) {
                    this.mergeConflicts = Collections.emptyList();
                    // If there is merge conflicts it will be lazy
                    // intialized
                }
            } else if (in.match(USE_RESOLVE_EXPLANATION)) {
                // ignore
            } else if (in.match(USE_RESOLVE_SHORT_EXPLANATION)) {
                // ignore
            } else if (in.match(BRANCH_MERGE_EXPLANATION)) {
                // ignore
            } else {
                if (whenUnknowReturn) {
                    return;
                } else {
                    throw new UnexpectedCommandOutputException(Utils.readStream(in,
                            command.getRepository().getServer().newDecoder()));
                }
            }
            if (endPattern != null) {
                String fileName = in.textUpTo(endPattern);
View Full Code Here

        Matcher m = TAGS_PATTERN.matcher(line);
        if (m.matches()) {
            return new Tag(m.group(1).trim(), repository.changeset(m.group(2)),
                    m.group(3) != null);
        }
        throw new UnexpectedCommandOutputException(this, line);
    }
View Full Code Here

    while (!in.isEof()) {
      if (in.match(SAVED_BACKUP_BUNDLE_TO)) {
        assert this.backupBundleFile == null;
        this.backupBundleFile = new File(in.textUpTo('\n'));
      } else {
        throw new UnexpectedCommandOutputException(Utils.readStream(in,
            getRepository().newDecoder()));
      }
    }
  }
View Full Code Here

        // format of line: 0 files updated, 0 files merged, 0 files
        // removed, 0 files unresolved
        UpdateResult result = new UpdateResult();
        Matcher matcher = UPDATE_LINE_PATTERN.matcher(line);
        if (!matcher.matches()) {
            throw new UnexpectedCommandOutputException("Unexpected format: " + line);
        }
        int[] numbers = new int[4];
        for (int i = 0; i < 4; i++) {
            numbers[i] = Integer.parseInt(line.substring(matcher.start(i + 1), matcher.end(i + 1)));
        }
View Full Code Here

                    src = files[currentSrc];
                }
                String[] names = parseCopyLine(src.getPath(), dst.getPath(), line, dstIsDirectory);
                result.put(new File(names[1]), new File(names[0]));
            } else {
                throw new UnexpectedCommandOutputException("could not parse '" + line + "'");
            }
        }
        return result;

    }
View Full Code Here

        if (s.startsWith(PREFIX)) {
            s = s.substring(PREFIX.length());
            int n = s.indexOf(')');
            return new String(s.substring(0, n));
        } else {
            throw new UnexpectedCommandOutputException(this, s);
        }
    }
View Full Code Here

            if (line.startsWith(prefix)) {
                String file = new String(line.substring(prefix.length()));
                result.add(file);
            } else {
                command.cleanUp();
                throw new UnexpectedCommandOutputException(this.command, line);
            }
        }
        return result;
    }
View Full Code Here

TOP

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

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.