Fossil SCM
Improve consistency of "fossil branch" command. I don't think this deserves more attention but others may decide to make it do more.
Commit
761a39c02564cb22cb4a286a247a4c8eecad0d4193cefb10b18dbedd97a8e019
Parent
e7a7b5c1b0e6db4…
1 file changed
+2
-6
+2
-6
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -105,16 +105,12 @@ | ||
| 105 | 105 | /* fossil branch new name */ |
| 106 | 106 | zBranch = g.argv[3]; |
| 107 | 107 | if( zBranch==0 || zBranch[0]==0 ){ |
| 108 | 108 | fossil_fatal("branch name cannot be empty"); |
| 109 | 109 | } |
| 110 | - if( db_exists( | |
| 111 | - "SELECT 1 FROM tagxref" | |
| 112 | - " WHERE tagtype>0" | |
| 113 | - " AND tagid=(SELECT tagid FROM tag WHERE tagname='sym-%q')", | |
| 114 | - zBranch)!=0 ){ | |
| 115 | - fossil_fatal("branch \"%s\" already exists", zBranch); | |
| 110 | + if( branch_is_open(zBranch) ){ | |
| 111 | + fossil_fatal("an open branch named \"%s\" already exists", zBranch); | |
| 116 | 112 | } |
| 117 | 113 | |
| 118 | 114 | user_select(); |
| 119 | 115 | db_begin_transaction(); |
| 120 | 116 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 121 | 117 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -105,16 +105,12 @@ | |
| 105 | /* fossil branch new name */ |
| 106 | zBranch = g.argv[3]; |
| 107 | if( zBranch==0 || zBranch[0]==0 ){ |
| 108 | fossil_fatal("branch name cannot be empty"); |
| 109 | } |
| 110 | if( db_exists( |
| 111 | "SELECT 1 FROM tagxref" |
| 112 | " WHERE tagtype>0" |
| 113 | " AND tagid=(SELECT tagid FROM tag WHERE tagname='sym-%q')", |
| 114 | zBranch)!=0 ){ |
| 115 | fossil_fatal("branch \"%s\" already exists", zBranch); |
| 116 | } |
| 117 | |
| 118 | user_select(); |
| 119 | db_begin_transaction(); |
| 120 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 121 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -105,16 +105,12 @@ | |
| 105 | /* fossil branch new name */ |
| 106 | zBranch = g.argv[3]; |
| 107 | if( zBranch==0 || zBranch[0]==0 ){ |
| 108 | fossil_fatal("branch name cannot be empty"); |
| 109 | } |
| 110 | if( branch_is_open(zBranch) ){ |
| 111 | fossil_fatal("an open branch named \"%s\" already exists", zBranch); |
| 112 | } |
| 113 | |
| 114 | user_select(); |
| 115 | db_begin_transaction(); |
| 116 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 117 |