Overview
SHA1 Hash: | 4d39bbac10c92e41eb737bb434d64d7959607f2e |
---|---|
Date: | 2009-01-20 22:38:56 |
User: | drh |
Comment: | Require that the "branch new" command specify a basis. Do not let it use the current check-out. Otherwise it gets confusing to users. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/branch.c from [6b0cfa07af] to [a8d6e457d2].
@@ -48,12 +48,12 @@ Blob mcksum; /* Self-checksum on the manifest */ noSign = find_option("nosign","",0)!=0; zColor = find_option("bgcolor","c",1); verify_all_options(); - if( g.argc<3 ){ - usage("branch new BRANCH-NAME ?ROOT-CHECK-IN? ?-bgcolor COLOR?"); + if( g.argc<5 ){ + usage("branch new BRANCH-NAME BASE-CHECK-IN ?-bgcolor COLOR?"); } db_find_and_open_repository(1); noSign = db_get_int("omitsign", 0)|noSign; /* fossil branch new name */ @@ -69,18 +69,11 @@ fossil_fatal("branch \"%s\" already exists", zBranch); } user_select(); db_begin_transaction(); - if( g.argc<5 ){ - if( unsaved_changes() ){ - fossil_fatal("there are uncommitted changes. please commit first"); - } - rootid = db_lget_int("checkout", 0); - }else{ - rootid = name_to_rid(g.argv[4]); - } + rootid = name_to_rid(g.argv[4]); if( rootid==0 ){ fossil_fatal("unable to locate check-in off of which to branch"); } /* Create a manifest for the new branch */ @@ -184,14 +177,14 @@ ** Usage: %fossil branch SUBCOMMAND ... ?-R|--repository FILE? ** ** Run various subcommands on the branches of the open repository or ** of the repository identified by the -R or --repository option. ** -** %fossil branch new BRANCH-NAME ?ROOT-CHECK-IN? ?-bgcolor COLOR? +** %fossil branch new BRANCH-NAME BASIS ?-bgcolor COLOR? ** -** Create a new branch BRANCH-NAME. You can optionally give -** a commit message and branch color. +** Create a new branch BRANCH-NAME off of check-in BASIS. +** You can optionally give the branch a default color. ** ** %fossil branch list ** ** List all branches **
Modified src/manifest.c from [632069e321] to [b133eff8a1].
@@ -922,11 +922,10 @@ " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", m.rDate, rid, m.zUser, m.zComment, TAG_BGCOLOR, rid, - TAG_BRBGCOLOR, rid, TAG_USER, rid, TAG_COMMENT, rid ); } }
Modified src/schema.c from [8049a3c05c] to [aa74a1f6fa].
@@ -327,21 +327,20 @@ /* ** Predefined tagid values */ #if INTERFACE # define TAG_BGCOLOR 1 /* Set the background color for display */ -# define TAG_BRBGCOLOR 2 /* Background color for branches */ -# define TAG_COMMENT 3 /* The check-in comment */ -# define TAG_USER 4 /* User who made a checking */ -# define TAG_HIDDEN 5 /* Do not display or sync */ -# define TAG_PRIVATE 6 /* Display but do not sync */ -# define TAG_CLUSTER 7 /* A cluster */ -# define TAG_NEWBRANCH 8 /* First check-in of a new named branch */ -# define TAG_CLOSED 9 /* Do not display this check-in as a leaf */ +# define TAG_COMMENT 2 /* The check-in comment */ +# define TAG_USER 3 /* User who made a checking */ +# define TAG_HIDDEN 4 /* Do not display or sync */ +# define TAG_PRIVATE 5 /* Display but do not sync */ +# define TAG_CLUSTER 6 /* A cluster */ +# define TAG_NEWBRANCH 7 /* First check-in of a new named branch */ +# define TAG_CLOSED 8 /* Do not display this check-in as a leaf */ #endif #if EXPORT_INTERFACE -# define MAX_INT_TAG 9 /* The largest pre-assigned tag id */ +# define MAX_INT_TAG 8 /* The largest pre-assigned tag id */ #endif /* ** The schema for the locate FOSSIL database file found at the root ** of very check-out. This database contains the complete state of