Lines Matching refs:line

128                           const char *line,
137 const apr_size_t len = strlen(line);
189 * Save the offset of the last byte of the diff line. */
192 svn_stringbuf_appendbytes(buf, line, len);
213 const char *line,
218 SVN_ERR(add_or_delete_single_line(hunk_out, line, patch,
226 const char *line,
231 SVN_ERR(add_or_delete_single_line(hunk_out, line, patch,
308 char buffer[52]; /* Bytes on current line */
309 apr_off_t next_pos; /* Start position of next line */
310 apr_off_t end_pos; /* Position after last line */
336 svn_stringbuf_t *line;
357 SVN_ERR(svn_io_file_readline(b85b->file, &line, NULL, &at_eof,
367 if (line->len && line->data[0] >= 'A' && line->data[0] <= 'Z')
368 b85b->buf_size = line->data[0] - 'A' + 1;
369 else if (line->len && line->data[0] >= 'a' && line->data[0] <= 'z')
370 b85b->buf_size = line->data[0] - 'a' + 26 + 1;
379 line->data + 1, line->len - 1,
403 are located at line boundaries. */
556 * so we can comfortably parse the line
569 /* Try to parse the line number the hunk starts at. */
645 /* Read a line of original or modified hunk text from the specified
647 * Leading unidiff symbols ('+', '-', and ' ') are removed from the line,
717 /* Return the line as-is. Handle as a chopped leading spaces */
724 no eol marker line.
801 svn_stringbuf_t *line;
822 SVN_ERR(svn_io_file_readline(hunk->apr_file, &line, eol, eof, max_len,
828 if (*eof && !*eol && *line->data)
831 no eol marker line.
862 if (line->data[0] == '+')
863 line->data[0] = '-';
864 else if (line->data[0] == '-')
865 line->data[0] = '+';
868 *stringbuf = line;
873 /* Parse *PROP_NAME from HEADER as the part after the INDICATOR line.
907 * The header is followed by a list of mergeinfo, one path per line.
911 * Parts of the line are affected by i18n. The words 'Merged'
913 * position within the line. We can only assume that a leading
935 svn_stringbuf_t *line,
940 char *slash = strchr(line->data, '/');
941 char *colon = strrchr(line->data, ':');
952 input = svn_stringbuf_create_ensure(line->len, scratch_pool);
966 while (s < line->data + line->len)
1063 svn_stringbuf_t *line;
1118 /* Remember the current line's offset, and read the line. */
1120 SVN_ERR(svn_io_file_readline(apr_file, &line, NULL, &eof, APR_SIZE_MAX,
1123 /* Update line offset for next iteration. */
1128 if (line->data[0] == '\\')
1182 /* We're reading the first line of the hunk, so the start
1183 * of the line just read is the hunk text's byte offset. */
1189 line, patch,
1195 continue; /* Proceed to the next line in the svn:mergeinfo hunk. */
1209 /* The start of the current line marks the first byte
1230 /* We're reading the first line of the hunk, so the start
1231 * of the line just read is the hunk text's byte offset. */
1235 c = line->data[0];
1240 (! eof && line->len == 0)
1244 /* It's a "context" line in the hunk. */
1267 && (original_lines > 0 || line->data[1] != del))
1269 /* It's a "deleted" line in the hunk. */
1288 && (modified_lines > 0 || line->data[1] != add))
1290 /* It's an "added" line in the hunk. */
1317 /* The start of the current line marks the first byte
1330 if (starts_with(line->data, text_atat))
1333 in_hunk = parse_hunk_header(line->data, *hunk, text_atat,
1342 else if (starts_with(line->data, prop_atat))
1346 in_hunk = parse_hunk_header(line->data, *hunk, prop_atat,
1355 else if (starts_with(line->data, "Added: "))
1357 SVN_ERR(parse_prop_name(prop_name, line->data, "Added: ",
1363 else if (starts_with(line->data, "Deleted: "))
1365 SVN_ERR(parse_prop_name(prop_name, line->data, "Deleted: ",
1371 else if (starts_with(line->data, "Modified: "))
1373 SVN_ERR(parse_prop_name(prop_name, line->data, "Modified: ",
1378 else if (starts_with(line->data, minus)
1379 || starts_with(line->data, "diff --git "))
1384 /* Check for the line length since a file may not have a newline at the
1385 * end and we depend upon the last line to be an empty one. */
1386 while (! eof || line->len > 0);
1390 /* Rewind to the start of the line just read, so subsequent calls
1392 * up skipping the line -- it may contain a patch or hunk header. */
1436 * We sort hunks by their original line offset. */
1482 grab_filename(const char **file_name, const char *line, apr_pool_t *result_pool,
1494 line,
1505 /* Parse the '--- ' line of a regular unidiff. */
1507 diff_minus(enum parse_state *new_state, char *line, svn_patch_t *patch,
1511 * the rest of the line which we can discard. */
1512 char *tab = strchr(line, '\t');
1516 SVN_ERR(grab_filename(&patch->old_filename, line + STRLEN_LITERAL("--- "),
1524 /* Parse the '+++ ' line of a regular unidiff. */
1526 diff_plus(enum parse_state *new_state, char *line, svn_patch_t *patch,
1530 * the rest of the line which we can discard. */
1531 char *tab = strchr(line, '\t');
1535 SVN_ERR(grab_filename(&patch->new_filename, line + STRLEN_LITERAL("+++ "),
1543 /* Parse the first line of a git extended unidiff. */
1545 git_start(enum parse_state *new_state, char *line, svn_patch_t *patch,
1563 /* Our line should look like this: 'diff --git a/path b/path'.
1568 old_path_marker = strstr(line, " a/");
1596 /* By now, we know that we have a line on the form '--git diff a/.+ b/.+'
1599 * 'diff --git' line. For all other cases we fetch the filenames from
1601 old_path_start = line + STRLEN_LITERAL("diff --git a/");
1602 new_path_end = line + strlen(line);
1648 /* Parse the '--- ' line of a git extended unidiff. */
1650 git_minus(enum parse_state *new_state, char *line, svn_patch_t *patch,
1654 * the rest of the line which we can discard. */
1655 char *tab = strchr(line, '\t');
1659 if (starts_with(line, "--- /dev/null"))
1663 SVN_ERR(grab_filename(&patch->old_filename, line + STRLEN_LITERAL("--- a/"),
1670 /* Parse the '+++ ' line of a git extended unidiff. */
1672 git_plus(enum parse_state *new_state, char *line, svn_patch_t *patch,
1676 * the rest of the line which we can discard. */
1677 char *tab = strchr(line, '\t');
1681 if (starts_with(line, "+++ /dev/null"))
1685 SVN_ERR(grab_filename(&patch->new_filename, line + STRLEN_LITERAL("+++ b/"),
1754 /* Parse the 'old mode ' line of a git extended unidiff. */
1756 git_old_mode(enum parse_state *new_state, char *line, svn_patch_t *patch,
1761 line + STRLEN_LITERAL("old mode ")));
1772 /* Parse the 'new mode ' line of a git extended unidiff. */
1774 git_new_mode(enum parse_state *new_state, char *line, svn_patch_t *patch,
1779 line + STRLEN_LITERAL("new mode ")));
1793 git_index(enum parse_state *new_state, char *line, svn_patch_t *patch,
1804 line = strchr(line + STRLEN_LITERAL("index "), ' ');
1806 if (line && patch->new_executable_bit == svn_tristate_unknown
1813 line + 1));
1825 /* Parse the 'rename from ' line of a git extended unidiff. */
1827 git_move_from(enum parse_state *new_state, char *line, svn_patch_t *patch,
1831 line + STRLEN_LITERAL("rename from "),
1838 /* Parse the 'rename to ' line of a git extended unidiff. */
1840 git_move_to(enum parse_state *new_state, char *line, svn_patch_t *patch,
1844 line + STRLEN_LITERAL("rename to "),
1853 /* Parse the 'copy from ' line of a git extended unidiff. */
1855 git_copy_from(enum parse_state *new_state, char *line, svn_patch_t *patch,
1859 line + STRLEN_LITERAL("copy from "),
1866 /* Parse the 'copy to ' line of a git extended unidiff. */
1868 git_copy_to(enum parse_state *new_state, char *line, svn_patch_t *patch,
1871 SVN_ERR(grab_filename(&patch->new_filename, line + STRLEN_LITERAL("copy to "),
1880 /* Parse the 'new file ' line of a git extended unidiff. */
1882 git_new_file(enum parse_state *new_state, char *line, svn_patch_t *patch,
1887 line + STRLEN_LITERAL("new file mode ")));
1897 /* Parse the 'deleted file ' line of a git extended unidiff. */
1899 git_deleted_file(enum parse_state *new_state, char *line, svn_patch_t *patch,
1904 line + STRLEN_LITERAL("deleted file mode ")));
1916 binary_patch_start(enum parse_state *new_state, char *line, svn_patch_t *patch,
2043 svn_stringbuf_t *line;
2058 SVN_ERR(svn_io_file_readline(apr_file, &line, NULL, &eof, APR_SIZE_MAX,
2061 /* Update line offset for next iteration. */
2066 char c = line->data[0];
2070 && line->len <= 66
2071 && !strchr(line->data, ':')
2072 && !strchr(line->data, ' '))
2074 /* One more blop line */
2080 else if (svn_stringbuf_first_non_whitespace(line) < line->len
2096 else if (starts_with(line->data, "literal "))
2100 &line->data[8],
2127 /* Rewind to the start of the line just read, so subsequent calls
2128 * don't end up skipping the line. It may contain a patch or hunk header.*/
2229 svn_stringbuf_t *line;
2235 /* Remember the current line's offset, and read the line. */
2237 SVN_ERR(svn_io_file_readline(patch_file->apr_file, &line, NULL, &eof,
2242 /* Update line offset for next iteration. */
2250 if (starts_with(line->data, transitions[i].expected_input)
2253 SVN_ERR(transitions[i].fn(&state, line->data, patch,
2272 * Rewind to the start of the line just read, so subsequent calls
2273 * to this function don't end up skipping the line -- it may
2289 * Rewind to the start of the line just read - it may be a new
2362 /* Usually, hunks appear in the patch sorted by their original line