Moved from command to after data to help cvs2svn.
cvs2svn has three phases: begin_commit, middle_commit, end_commit. The ancester is computed in the middle_commit phase. So its easier to generate a stream if the from command appears after the commit message itself but before the file change commands. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
00e2b8842c
commit
02f3389d96
@ -14,11 +14,11 @@ Format of STDIN stream:
|
|||||||
file_content ::= data;
|
file_content ::= data;
|
||||||
|
|
||||||
new_commit ::= 'commit' sp ref_str lf
|
new_commit ::= 'commit' sp ref_str lf
|
||||||
('from' sp (ref_str | hexsha1 | sha1exp_str | idnum) lf)?
|
|
||||||
mark?
|
mark?
|
||||||
('author' sp name '<' email '>' ts tz lf)?
|
('author' sp name '<' email '>' ts tz lf)?
|
||||||
'committer' sp name '<' email '>' ts tz lf
|
'committer' sp name '<' email '>' ts tz lf
|
||||||
commit_msg
|
commit_msg
|
||||||
|
('from' sp (ref_str | hexsha1 | sha1exp_str | idnum) lf)?
|
||||||
file_change*
|
file_change*
|
||||||
lf;
|
lf;
|
||||||
commit_msg ::= data;
|
commit_msg ::= data;
|
||||||
@ -1385,7 +1385,6 @@ static void cmd_new_commit()
|
|||||||
free(str_uq);
|
free(str_uq);
|
||||||
|
|
||||||
read_next_command();
|
read_next_command();
|
||||||
cmd_from(b);
|
|
||||||
cmd_mark();
|
cmd_mark();
|
||||||
if (!strncmp("author ", command_buf.buf, 7)) {
|
if (!strncmp("author ", command_buf.buf, 7)) {
|
||||||
author = strdup(command_buf.buf);
|
author = strdup(command_buf.buf);
|
||||||
@ -1398,6 +1397,8 @@ static void cmd_new_commit()
|
|||||||
if (!committer)
|
if (!committer)
|
||||||
die("Expected committer but didn't get one");
|
die("Expected committer but didn't get one");
|
||||||
msg = cmd_data(&msglen);
|
msg = cmd_data(&msglen);
|
||||||
|
read_next_command();
|
||||||
|
cmd_from(b);
|
||||||
|
|
||||||
/* ensure the branch is active/loaded */
|
/* ensure the branch is active/loaded */
|
||||||
if (!b->branch_tree.tree || !max_active_branches) {
|
if (!b->branch_tree.tree || !max_active_branches) {
|
||||||
@ -1407,7 +1408,6 @@ static void cmd_new_commit()
|
|||||||
|
|
||||||
/* file_change* */
|
/* file_change* */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
read_next_command();
|
|
||||||
if (1 == command_buf.len)
|
if (1 == command_buf.len)
|
||||||
break;
|
break;
|
||||||
else if (!strncmp("M ", command_buf.buf, 2))
|
else if (!strncmp("M ", command_buf.buf, 2))
|
||||||
@ -1416,6 +1416,7 @@ static void cmd_new_commit()
|
|||||||
file_change_d(b);
|
file_change_d(b);
|
||||||
else
|
else
|
||||||
die("Unsupported file_change: %s", command_buf.buf);
|
die("Unsupported file_change: %s", command_buf.buf);
|
||||||
|
read_next_command();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* build the tree and the commit */
|
/* build the tree and the commit */
|
||||||
|
Loading…
Reference in New Issue
Block a user