summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 62b6f48)
raw | patch | inline | side by side (parent: 62b6f48)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 12 Jan 2007 03:28:39 +0000 (22:28 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 14 Jan 2007 07:15:12 +0000 (02:15 -0500) |
Some importers may want to create a branch long before they actually
commit to it, or in some cases they may never commit to the branch
but they still need the ref to be created in the repository after
the import is complete.
This extends the 'reset ' command to automatically create a new
branch if the supplied reference isn't already known as a branch.
While I'm at it I also modified the syntax of the reset command
to terminate with an empty line, like commit and tag operate.
This just makes the command set more consistent.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
commit to it, or in some cases they may never commit to the branch
but they still need the ref to be created in the repository after
the import is complete.
This extends the 'reset ' command to automatically create a new
branch if the supplied reference isn't already known as a branch.
While I'm at it I also modified the syntax of the reset command
to terminate with an empty line, like commit and tag operate.
This just makes the command set more consistent.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 15db4b39d136403b66ac1ca7d5d5745f24ef577d..38e24bf6a622548f4dd4eed64424a7a03a3210ff 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
tag_msg;
tag_msg ::= data;
- reset_branch ::= 'reset' sp ref_str lf;
+ reset_branch ::= 'reset' sp ref_str lf
+ ('from' sp (ref_str | hexsha1 | sha1exp_str | idnum) lf)?
+ lf;
# note: the first idnum in a stream should be 1 and subsequent
# idnums should not have gaps between values as this will cause
b->branch_tree.tree = NULL;
}
}
+ else
+ b = new_branch(sp);
if (str_uq)
free(str_uq);
+ read_next_command();
+ cmd_from(b);
}
static const char fast_import_usage[] =