Fossil SCM

Fix the branch subcommand so that the branch name tags it creates begin with "sym-".

drh 2008-02-08 21:50 trunk
Commit ce08928aaa684585ccb232ab3fb9801db5b61cd3
1 file changed +6 -11
+6 -11
--- src/branch.c
+++ src/branch.c
@@ -44,11 +44,11 @@
4444
4545
verify_all_options();
4646
4747
/* fossil branch new name */
4848
if( g.argc<3 ){
49
- usage("branch new ?-bgcolor COLOR BRANCH-NAME");
49
+ usage("branch new ?-bgcolor COLOR? BRANCH-NAME");
5050
}
5151
zBranch = g.argv[3];
5252
if( zBranch==0 || zBranch[0]==0 ){
5353
fossil_panic("branch name cannot be empty");
5454
}
@@ -84,19 +84,14 @@
8484
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
8585
blob_appendf(&manifest, "P %s\n", zUuid);
8686
blob_appendf(&manifest, "R %b\n", &cksum1);
8787
8888
if( zColor!=0 ){
89
- if( strcmp("bgcolor",zBranch)>=0 ){
90
- blob_appendf(&manifest, "T *%F *\n", zBranch);
91
- blob_appendf(&manifest, "T *bgcolor * %F\n", zColor);
92
- }else{
93
- blob_appendf(&manifest, "T *bgcolor * %F\n", zColor);
94
- blob_appendf(&manifest, "T *%F *\n", zBranch);
95
- }
96
- }else{
97
- blob_appendf(&manifest, "T *%F *\n", zBranch);
89
+ blob_appendf(&manifest, "T *bgcolor * %F\n", zColor);
90
+ blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
91
+ }else{
92
+ blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
9893
}
9994
10095
/* Cancel any tags that propagate */
10196
db_prepare(&q,
10297
"SELECT tagname"
@@ -169,11 +164,11 @@
169164
** Usage: %fossil branch SUBCOMMAND ... ?-R|--repository FILE?
170165
**
171166
** Run various subcommands on the branches of the open repository or
172167
** of the repository identified by the -R or --repository option.
173168
**
174
-** %fossil branch new ?-bgcolor COLOR BRANCH-NAME
169
+** %fossil branch new ?-bgcolor COLOR? BRANCH-NAME
175170
**
176171
** Create a new branch BRANCH-NAME. You can optionally give
177172
** a commit message and branch color.
178173
**
179174
** %fossil branch list
180175
--- src/branch.c
+++ src/branch.c
@@ -44,11 +44,11 @@
44
45 verify_all_options();
46
47 /* fossil branch new name */
48 if( g.argc<3 ){
49 usage("branch new ?-bgcolor COLOR BRANCH-NAME");
50 }
51 zBranch = g.argv[3];
52 if( zBranch==0 || zBranch[0]==0 ){
53 fossil_panic("branch name cannot be empty");
54 }
@@ -84,19 +84,14 @@
84 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
85 blob_appendf(&manifest, "P %s\n", zUuid);
86 blob_appendf(&manifest, "R %b\n", &cksum1);
87
88 if( zColor!=0 ){
89 if( strcmp("bgcolor",zBranch)>=0 ){
90 blob_appendf(&manifest, "T *%F *\n", zBranch);
91 blob_appendf(&manifest, "T *bgcolor * %F\n", zColor);
92 }else{
93 blob_appendf(&manifest, "T *bgcolor * %F\n", zColor);
94 blob_appendf(&manifest, "T *%F *\n", zBranch);
95 }
96 }else{
97 blob_appendf(&manifest, "T *%F *\n", zBranch);
98 }
99
100 /* Cancel any tags that propagate */
101 db_prepare(&q,
102 "SELECT tagname"
@@ -169,11 +164,11 @@
169 ** Usage: %fossil branch SUBCOMMAND ... ?-R|--repository FILE?
170 **
171 ** Run various subcommands on the branches of the open repository or
172 ** of the repository identified by the -R or --repository option.
173 **
174 ** %fossil branch new ?-bgcolor COLOR BRANCH-NAME
175 **
176 ** Create a new branch BRANCH-NAME. You can optionally give
177 ** a commit message and branch color.
178 **
179 ** %fossil branch list
180
--- src/branch.c
+++ src/branch.c
@@ -44,11 +44,11 @@
44
45 verify_all_options();
46
47 /* fossil branch new name */
48 if( g.argc<3 ){
49 usage("branch new ?-bgcolor COLOR? BRANCH-NAME");
50 }
51 zBranch = g.argv[3];
52 if( zBranch==0 || zBranch[0]==0 ){
53 fossil_panic("branch name cannot be empty");
54 }
@@ -84,19 +84,14 @@
84 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
85 blob_appendf(&manifest, "P %s\n", zUuid);
86 blob_appendf(&manifest, "R %b\n", &cksum1);
87
88 if( zColor!=0 ){
89 blob_appendf(&manifest, "T *bgcolor * %F\n", zColor);
90 blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
91 }else{
92 blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
 
 
 
 
 
93 }
94
95 /* Cancel any tags that propagate */
96 db_prepare(&q,
97 "SELECT tagname"
@@ -169,11 +164,11 @@
164 ** Usage: %fossil branch SUBCOMMAND ... ?-R|--repository FILE?
165 **
166 ** Run various subcommands on the branches of the open repository or
167 ** of the repository identified by the -R or --repository option.
168 **
169 ** %fossil branch new ?-bgcolor COLOR? BRANCH-NAME
170 **
171 ** Create a new branch BRANCH-NAME. You can optionally give
172 ** a commit message and branch color.
173 **
174 ** %fossil branch list
175

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button