Fossil SCM
Two manifest.tags changes: 1) Unconditionally add branch. 2) Change the format to explicitly state tag or branch entry.
Commit
0925f75a0c05f9cc7825cb7b9ed7d8a5fc249293
Parent
bf62b1608c62eab…
2 files changed
+5
-9
+5
-5
+5
-9
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -199,29 +199,25 @@ | ||
| 199 | 199 | ** It is unclear if the rid parameter is always the same as the current |
| 200 | 200 | ** check-out. |
| 201 | 201 | */ |
| 202 | 202 | void get_checkin_taglist(int rid, Blob *pOut){ |
| 203 | 203 | Stmt stmt; |
| 204 | + char *zCurrent; | |
| 204 | 205 | blob_reset(pOut); |
| 205 | - if( g.localOpen ){ | |
| 206 | - char *zCurrent; | |
| 207 | - int vid; | |
| 208 | - vid = db_lget_int("checkout", 0); | |
| 209 | - zCurrent = db_text(0, "SELECT value FROM tagxref" | |
| 210 | - " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH); | |
| 211 | - blob_appendf(pOut, "branch=%s\n", zCurrent); | |
| 212 | - } | |
| 206 | + zCurrent = db_text(0, "SELECT value FROM tagxref" | |
| 207 | + " WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH); | |
| 208 | + blob_appendf(pOut, "branch %s\n", zCurrent); | |
| 213 | 209 | db_prepare(&stmt, "SELECT substr(tagname, 5)" |
| 214 | 210 | " FROM tagxref, tag" |
| 215 | 211 | " WHERE tagxref.rid=%d" |
| 216 | 212 | " AND tagxref.tagtype>0" |
| 217 | 213 | " AND tag.tagid=tagxref.tagid" |
| 218 | 214 | " AND tag.tagname GLOB 'sym-*'", rid); |
| 219 | 215 | while( db_step(&stmt)==SQLITE_ROW ){ |
| 220 | 216 | const char *zName; |
| 221 | 217 | zName = db_column_text(&stmt, 0); |
| 222 | - blob_appendf(pOut, "%s\n", zName); | |
| 218 | + blob_appendf(pOut, "tag %s\n", zName); | |
| 223 | 219 | } |
| 224 | 220 | db_reset(&stmt); |
| 225 | 221 | db_finalize(&stmt); |
| 226 | 222 | } |
| 227 | 223 | |
| 228 | 224 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -199,29 +199,25 @@ | |
| 199 | ** It is unclear if the rid parameter is always the same as the current |
| 200 | ** check-out. |
| 201 | */ |
| 202 | void get_checkin_taglist(int rid, Blob *pOut){ |
| 203 | Stmt stmt; |
| 204 | blob_reset(pOut); |
| 205 | if( g.localOpen ){ |
| 206 | char *zCurrent; |
| 207 | int vid; |
| 208 | vid = db_lget_int("checkout", 0); |
| 209 | zCurrent = db_text(0, "SELECT value FROM tagxref" |
| 210 | " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH); |
| 211 | blob_appendf(pOut, "branch=%s\n", zCurrent); |
| 212 | } |
| 213 | db_prepare(&stmt, "SELECT substr(tagname, 5)" |
| 214 | " FROM tagxref, tag" |
| 215 | " WHERE tagxref.rid=%d" |
| 216 | " AND tagxref.tagtype>0" |
| 217 | " AND tag.tagid=tagxref.tagid" |
| 218 | " AND tag.tagname GLOB 'sym-*'", rid); |
| 219 | while( db_step(&stmt)==SQLITE_ROW ){ |
| 220 | const char *zName; |
| 221 | zName = db_column_text(&stmt, 0); |
| 222 | blob_appendf(pOut, "%s\n", zName); |
| 223 | } |
| 224 | db_reset(&stmt); |
| 225 | db_finalize(&stmt); |
| 226 | } |
| 227 | |
| 228 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -199,29 +199,25 @@ | |
| 199 | ** It is unclear if the rid parameter is always the same as the current |
| 200 | ** check-out. |
| 201 | */ |
| 202 | void get_checkin_taglist(int rid, Blob *pOut){ |
| 203 | Stmt stmt; |
| 204 | char *zCurrent; |
| 205 | blob_reset(pOut); |
| 206 | zCurrent = db_text(0, "SELECT value FROM tagxref" |
| 207 | " WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH); |
| 208 | blob_appendf(pOut, "branch %s\n", zCurrent); |
| 209 | db_prepare(&stmt, "SELECT substr(tagname, 5)" |
| 210 | " FROM tagxref, tag" |
| 211 | " WHERE tagxref.rid=%d" |
| 212 | " AND tagxref.tagtype>0" |
| 213 | " AND tag.tagid=tagxref.tagid" |
| 214 | " AND tag.tagname GLOB 'sym-*'", rid); |
| 215 | while( db_step(&stmt)==SQLITE_ROW ){ |
| 216 | const char *zName; |
| 217 | zName = db_column_text(&stmt, 0); |
| 218 | blob_appendf(pOut, "tag %s\n", zName); |
| 219 | } |
| 220 | db_reset(&stmt); |
| 221 | db_finalize(&stmt); |
| 222 | } |
| 223 | |
| 224 |
+5
-5
| --- test/set-manifest.test | ||
| +++ test/set-manifest.test | ||
| @@ -116,11 +116,11 @@ | ||
| 116 | 116 | test "set-manifest-5-$v-f-$f" {[file isfile $f]} |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | # Quick check for tags applied in trunk |
| 121 | -test_file_contents "set-manifest-6" "manifest.tags" "branch=trunk\ntrunk\n" | |
| 121 | +test_file_contents "set-manifest-6" "manifest.tags" "branch trunk\ntag trunk\n" | |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | ##### Test manifest.tags file content updates after commits |
| 125 | 125 | |
| 126 | 126 | # Explicitly set manifest.tags mode |
| @@ -127,29 +127,29 @@ | ||
| 127 | 127 | fossil set manifest t |
| 128 | 128 | test "set-manifest-7-1" {[file isfile manifest.tags]} |
| 129 | 129 | |
| 130 | 130 | # Add a tag and make sure it appears in manifest.tags |
| 131 | 131 | fossil tag add manifest-7-tag-1 tip |
| 132 | -test "set-manifest-7-2" {[file_contains "manifest.tags" "^manifest-7-tag-1$"]} | |
| 132 | +test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} | |
| 133 | 133 | |
| 134 | 134 | # Add a file and make sure tag has disappeared from manifest.tags |
| 135 | 135 | write_file file1 "file1 contents" |
| 136 | 136 | fossil add file1 |
| 137 | 137 | fossil commit -m "Added file1." |
| 138 | -test "set-manifest-7-3" {![file_contains "manifest.tags" "^manifest-7-tag-1$"]} | |
| 138 | +test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} | |
| 139 | 139 | |
| 140 | 140 | # Add new tag and check that it is in manifest.tags |
| 141 | 141 | fossil tag add manifest-7-tag-2 tip |
| 142 | -test "set-manifest-7-4" {[file_contains "manifest.tags" "^manifest-7-tag-2$"]} | |
| 142 | +test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]} | |
| 143 | 143 | |
| 144 | 144 | |
| 145 | 145 | ##### Tags manifest branch= updates |
| 146 | 146 | |
| 147 | 147 | # Add file, create new branch on commit and check that |
| 148 | 148 | # manifest.tags has been updated appropriately |
| 149 | 149 | write_file file3 "file3 contents" |
| 150 | 150 | fossil add file3 |
| 151 | 151 | fossil commit -m "Added file3." --branch manifest-8-branch |
| 152 | -test "set-manifest-8" {[file_contains "manifest.tags" "^branch=manifest-8-branch$"]} | |
| 152 | +test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]} | |
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | test_cleanup |
| 156 | 156 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -116,11 +116,11 @@ | |
| 116 | test "set-manifest-5-$v-f-$f" {[file isfile $f]} |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | # Quick check for tags applied in trunk |
| 121 | test_file_contents "set-manifest-6" "manifest.tags" "branch=trunk\ntrunk\n" |
| 122 | |
| 123 | |
| 124 | ##### Test manifest.tags file content updates after commits |
| 125 | |
| 126 | # Explicitly set manifest.tags mode |
| @@ -127,29 +127,29 @@ | |
| 127 | fossil set manifest t |
| 128 | test "set-manifest-7-1" {[file isfile manifest.tags]} |
| 129 | |
| 130 | # Add a tag and make sure it appears in manifest.tags |
| 131 | fossil tag add manifest-7-tag-1 tip |
| 132 | test "set-manifest-7-2" {[file_contains "manifest.tags" "^manifest-7-tag-1$"]} |
| 133 | |
| 134 | # Add a file and make sure tag has disappeared from manifest.tags |
| 135 | write_file file1 "file1 contents" |
| 136 | fossil add file1 |
| 137 | fossil commit -m "Added file1." |
| 138 | test "set-manifest-7-3" {![file_contains "manifest.tags" "^manifest-7-tag-1$"]} |
| 139 | |
| 140 | # Add new tag and check that it is in manifest.tags |
| 141 | fossil tag add manifest-7-tag-2 tip |
| 142 | test "set-manifest-7-4" {[file_contains "manifest.tags" "^manifest-7-tag-2$"]} |
| 143 | |
| 144 | |
| 145 | ##### Tags manifest branch= updates |
| 146 | |
| 147 | # Add file, create new branch on commit and check that |
| 148 | # manifest.tags has been updated appropriately |
| 149 | write_file file3 "file3 contents" |
| 150 | fossil add file3 |
| 151 | fossil commit -m "Added file3." --branch manifest-8-branch |
| 152 | test "set-manifest-8" {[file_contains "manifest.tags" "^branch=manifest-8-branch$"]} |
| 153 | |
| 154 | |
| 155 | test_cleanup |
| 156 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -116,11 +116,11 @@ | |
| 116 | test "set-manifest-5-$v-f-$f" {[file isfile $f]} |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | # Quick check for tags applied in trunk |
| 121 | test_file_contents "set-manifest-6" "manifest.tags" "branch trunk\ntag trunk\n" |
| 122 | |
| 123 | |
| 124 | ##### Test manifest.tags file content updates after commits |
| 125 | |
| 126 | # Explicitly set manifest.tags mode |
| @@ -127,29 +127,29 @@ | |
| 127 | fossil set manifest t |
| 128 | test "set-manifest-7-1" {[file isfile manifest.tags]} |
| 129 | |
| 130 | # Add a tag and make sure it appears in manifest.tags |
| 131 | fossil tag add manifest-7-tag-1 tip |
| 132 | test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 133 | |
| 134 | # Add a file and make sure tag has disappeared from manifest.tags |
| 135 | write_file file1 "file1 contents" |
| 136 | fossil add file1 |
| 137 | fossil commit -m "Added file1." |
| 138 | test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]} |
| 139 | |
| 140 | # Add new tag and check that it is in manifest.tags |
| 141 | fossil tag add manifest-7-tag-2 tip |
| 142 | test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]} |
| 143 | |
| 144 | |
| 145 | ##### Tags manifest branch= updates |
| 146 | |
| 147 | # Add file, create new branch on commit and check that |
| 148 | # manifest.tags has been updated appropriately |
| 149 | write_file file3 "file3 contents" |
| 150 | fossil add file3 |
| 151 | fossil commit -m "Added file3." --branch manifest-8-branch |
| 152 | test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]} |
| 153 | |
| 154 | |
| 155 | test_cleanup |
| 156 |