Fossil SCM
Option to shun/unshun a whole transaction (by rcvid)
Commit
66b5647af70be55fd14370dcbeb89d6955764fc0
Parent
9f6b1964fb88477…
1 file changed
+39
-4
+39
-4
| --- src/shun.c | ||
| +++ src/shun.c | ||
| @@ -42,11 +42,14 @@ | ||
| 42 | 42 | Stmt q; |
| 43 | 43 | int cnt = 0; |
| 44 | 44 | const char *zUuid = P("uuid"); |
| 45 | 45 | const char *zShun = P("shun"); |
| 46 | 46 | const char *zAccept = P("accept"); |
| 47 | + const char *zRcvid = P("rcvid"); | |
| 48 | + int nRcvid; | |
| 47 | 49 | int nUuid; |
| 50 | + int numRows = 3; | |
| 48 | 51 | char *zCanonical = 0; |
| 49 | 52 | |
| 50 | 53 | login_check_credentials(); |
| 51 | 54 | if( !g.perm.Admin ){ |
| 52 | 55 | login_needed(); |
| @@ -147,10 +150,14 @@ | ||
| 147 | 150 | } |
| 148 | 151 | @ have been shunned. They will no longer be pushed. |
| 149 | 152 | @ They will be removed from the repository the next time the repository |
| 150 | 153 | @ is rebuilt using the <b>fossil rebuild</b> command-line</p> |
| 151 | 154 | } |
| 155 | + if( zRcvid ){ | |
| 156 | + nRcvid = atoi(zRcvid); | |
| 157 | + numRows = db_int(0, "SELECT min(count(), 10) FROM blob WHERE rcvid=%d", nRcvid); | |
| 158 | + } | |
| 152 | 159 | @ <p>A shunned artifact will not be pushed nor accepted in a pull and the |
| 153 | 160 | @ artifact content will be purged from the repository the next time the |
| 154 | 161 | @ repository is rebuilt. A list of shunned artifacts can be seen at the |
| 155 | 162 | @ bottom of this page.</p> |
| 156 | 163 | @ |
| @@ -172,13 +179,21 @@ | ||
| 172 | 179 | @ sight - set the "hidden" tag on such artifacts instead.</p> |
| 173 | 180 | @ |
| 174 | 181 | @ <blockquote> |
| 175 | 182 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 176 | 183 | login_insert_csrf_secret(); |
| 177 | - @ <textarea class="fullsize-text" cols="50" rows="3" name="uuid"> | |
| 184 | + @ <textarea class="fullsize-text" cols="50" rows="%d(numRows)" name="uuid"> | |
| 178 | 185 | if( zShun ){ |
| 179 | - @ %h(zShun) | |
| 186 | + if( strlen(zShun) ){ | |
| 187 | + @ %h(zShun) | |
| 188 | + }else if( zRcvid ){ | |
| 189 | + db_prepare(&q, "SELECT uuid FROM blob WHERE rcvid=%d", nRcvid); | |
| 190 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 191 | + @ %s(db_column_text(&q, 0)) | |
| 192 | + } | |
| 193 | + db_finalize(&q); | |
| 194 | + } | |
| 180 | 195 | } |
| 181 | 196 | @ </textarea> |
| 182 | 197 | @ <input type="submit" name="add" value="Shun" /> |
| 183 | 198 | @ </div></form> |
| 184 | 199 | @ </blockquote> |
| @@ -191,13 +206,21 @@ | ||
| 191 | 206 | @ operations.</p> |
| 192 | 207 | @ |
| 193 | 208 | @ <blockquote> |
| 194 | 209 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 195 | 210 | login_insert_csrf_secret(); |
| 196 | - @ <textarea class="fullsize-text" cols="50" rows="3" name="uuid"> | |
| 211 | + @ <textarea class="fullsize-text" cols="50" rows="%d(numRows)" name="uuid"> | |
| 197 | 212 | if( zAccept ){ |
| 198 | - @ %h(zAccept) | |
| 213 | + if( strlen(zAccept) ){ | |
| 214 | + @ %h(zAccept) | |
| 215 | + }else if( zRcvid ){ | |
| 216 | + db_prepare(&q, "SELECT uuid FROM blob WHERE rcvid=%d", nRcvid); | |
| 217 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 218 | + @ %s(db_column_text(&q, 0)) | |
| 219 | + } | |
| 220 | + db_finalize(&q); | |
| 221 | + } | |
| 199 | 222 | } |
| 200 | 223 | @ </textarea> |
| 201 | 224 | @ <input type="submit" name="sub" value="Accept" /> |
| 202 | 225 | @ </div></form> |
| 203 | 226 | @ </blockquote> |
| @@ -340,10 +363,22 @@ | ||
| 340 | 363 | login_check_credentials(); |
| 341 | 364 | if( !g.perm.Admin ){ |
| 342 | 365 | login_needed(); |
| 343 | 366 | } |
| 344 | 367 | style_header("Content Source %d", rcvid); |
| 368 | + if( db_exists( | |
| 369 | + "SELECT 1 FROM blob WHERE rcvid=%d AND" | |
| 370 | + " NOT EXISTS (SELECT 1 FROM shun WHERE shun.uuid=blob.uuid)", rcvid) | |
| 371 | + ){ | |
| 372 | + style_submenu_element("Shun All", "Shun All", "shun?shun&rcvid=%d#addshun", rcvid); | |
| 373 | + } | |
| 374 | + if( db_exists( | |
| 375 | + "SELECT 1 FROM blob WHERE rcvid=%d AND" | |
| 376 | + " EXISTS (SELECT 1 FROM shun WHERE shun.uuid=blob.uuid)", rcvid) | |
| 377 | + ){ | |
| 378 | + style_submenu_element("Unshun All", "Unshun All", "shun?accept&rcvid=%d#delshun", rcvid); | |
| 379 | + } | |
| 345 | 380 | db_prepare(&q, |
| 346 | 381 | "SELECT login, datetime(rcvfrom.mtime), rcvfrom.ipaddr" |
| 347 | 382 | " FROM rcvfrom LEFT JOIN user USING(uid)" |
| 348 | 383 | " WHERE rcvid=%d", |
| 349 | 384 | rcvid |
| 350 | 385 |
| --- src/shun.c | |
| +++ src/shun.c | |
| @@ -42,11 +42,14 @@ | |
| 42 | Stmt q; |
| 43 | int cnt = 0; |
| 44 | const char *zUuid = P("uuid"); |
| 45 | const char *zShun = P("shun"); |
| 46 | const char *zAccept = P("accept"); |
| 47 | int nUuid; |
| 48 | char *zCanonical = 0; |
| 49 | |
| 50 | login_check_credentials(); |
| 51 | if( !g.perm.Admin ){ |
| 52 | login_needed(); |
| @@ -147,10 +150,14 @@ | |
| 147 | } |
| 148 | @ have been shunned. They will no longer be pushed. |
| 149 | @ They will be removed from the repository the next time the repository |
| 150 | @ is rebuilt using the <b>fossil rebuild</b> command-line</p> |
| 151 | } |
| 152 | @ <p>A shunned artifact will not be pushed nor accepted in a pull and the |
| 153 | @ artifact content will be purged from the repository the next time the |
| 154 | @ repository is rebuilt. A list of shunned artifacts can be seen at the |
| 155 | @ bottom of this page.</p> |
| 156 | @ |
| @@ -172,13 +179,21 @@ | |
| 172 | @ sight - set the "hidden" tag on such artifacts instead.</p> |
| 173 | @ |
| 174 | @ <blockquote> |
| 175 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 176 | login_insert_csrf_secret(); |
| 177 | @ <textarea class="fullsize-text" cols="50" rows="3" name="uuid"> |
| 178 | if( zShun ){ |
| 179 | @ %h(zShun) |
| 180 | } |
| 181 | @ </textarea> |
| 182 | @ <input type="submit" name="add" value="Shun" /> |
| 183 | @ </div></form> |
| 184 | @ </blockquote> |
| @@ -191,13 +206,21 @@ | |
| 191 | @ operations.</p> |
| 192 | @ |
| 193 | @ <blockquote> |
| 194 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 195 | login_insert_csrf_secret(); |
| 196 | @ <textarea class="fullsize-text" cols="50" rows="3" name="uuid"> |
| 197 | if( zAccept ){ |
| 198 | @ %h(zAccept) |
| 199 | } |
| 200 | @ </textarea> |
| 201 | @ <input type="submit" name="sub" value="Accept" /> |
| 202 | @ </div></form> |
| 203 | @ </blockquote> |
| @@ -340,10 +363,22 @@ | |
| 340 | login_check_credentials(); |
| 341 | if( !g.perm.Admin ){ |
| 342 | login_needed(); |
| 343 | } |
| 344 | style_header("Content Source %d", rcvid); |
| 345 | db_prepare(&q, |
| 346 | "SELECT login, datetime(rcvfrom.mtime), rcvfrom.ipaddr" |
| 347 | " FROM rcvfrom LEFT JOIN user USING(uid)" |
| 348 | " WHERE rcvid=%d", |
| 349 | rcvid |
| 350 |
| --- src/shun.c | |
| +++ src/shun.c | |
| @@ -42,11 +42,14 @@ | |
| 42 | Stmt q; |
| 43 | int cnt = 0; |
| 44 | const char *zUuid = P("uuid"); |
| 45 | const char *zShun = P("shun"); |
| 46 | const char *zAccept = P("accept"); |
| 47 | const char *zRcvid = P("rcvid"); |
| 48 | int nRcvid; |
| 49 | int nUuid; |
| 50 | int numRows = 3; |
| 51 | char *zCanonical = 0; |
| 52 | |
| 53 | login_check_credentials(); |
| 54 | if( !g.perm.Admin ){ |
| 55 | login_needed(); |
| @@ -147,10 +150,14 @@ | |
| 150 | } |
| 151 | @ have been shunned. They will no longer be pushed. |
| 152 | @ They will be removed from the repository the next time the repository |
| 153 | @ is rebuilt using the <b>fossil rebuild</b> command-line</p> |
| 154 | } |
| 155 | if( zRcvid ){ |
| 156 | nRcvid = atoi(zRcvid); |
| 157 | numRows = db_int(0, "SELECT min(count(), 10) FROM blob WHERE rcvid=%d", nRcvid); |
| 158 | } |
| 159 | @ <p>A shunned artifact will not be pushed nor accepted in a pull and the |
| 160 | @ artifact content will be purged from the repository the next time the |
| 161 | @ repository is rebuilt. A list of shunned artifacts can be seen at the |
| 162 | @ bottom of this page.</p> |
| 163 | @ |
| @@ -172,13 +179,21 @@ | |
| 179 | @ sight - set the "hidden" tag on such artifacts instead.</p> |
| 180 | @ |
| 181 | @ <blockquote> |
| 182 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 183 | login_insert_csrf_secret(); |
| 184 | @ <textarea class="fullsize-text" cols="50" rows="%d(numRows)" name="uuid"> |
| 185 | if( zShun ){ |
| 186 | if( strlen(zShun) ){ |
| 187 | @ %h(zShun) |
| 188 | }else if( zRcvid ){ |
| 189 | db_prepare(&q, "SELECT uuid FROM blob WHERE rcvid=%d", nRcvid); |
| 190 | while( db_step(&q)==SQLITE_ROW ){ |
| 191 | @ %s(db_column_text(&q, 0)) |
| 192 | } |
| 193 | db_finalize(&q); |
| 194 | } |
| 195 | } |
| 196 | @ </textarea> |
| 197 | @ <input type="submit" name="add" value="Shun" /> |
| 198 | @ </div></form> |
| 199 | @ </blockquote> |
| @@ -191,13 +206,21 @@ | |
| 206 | @ operations.</p> |
| 207 | @ |
| 208 | @ <blockquote> |
| 209 | @ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div> |
| 210 | login_insert_csrf_secret(); |
| 211 | @ <textarea class="fullsize-text" cols="50" rows="%d(numRows)" name="uuid"> |
| 212 | if( zAccept ){ |
| 213 | if( strlen(zAccept) ){ |
| 214 | @ %h(zAccept) |
| 215 | }else if( zRcvid ){ |
| 216 | db_prepare(&q, "SELECT uuid FROM blob WHERE rcvid=%d", nRcvid); |
| 217 | while( db_step(&q)==SQLITE_ROW ){ |
| 218 | @ %s(db_column_text(&q, 0)) |
| 219 | } |
| 220 | db_finalize(&q); |
| 221 | } |
| 222 | } |
| 223 | @ </textarea> |
| 224 | @ <input type="submit" name="sub" value="Accept" /> |
| 225 | @ </div></form> |
| 226 | @ </blockquote> |
| @@ -340,10 +363,22 @@ | |
| 363 | login_check_credentials(); |
| 364 | if( !g.perm.Admin ){ |
| 365 | login_needed(); |
| 366 | } |
| 367 | style_header("Content Source %d", rcvid); |
| 368 | if( db_exists( |
| 369 | "SELECT 1 FROM blob WHERE rcvid=%d AND" |
| 370 | " NOT EXISTS (SELECT 1 FROM shun WHERE shun.uuid=blob.uuid)", rcvid) |
| 371 | ){ |
| 372 | style_submenu_element("Shun All", "Shun All", "shun?shun&rcvid=%d#addshun", rcvid); |
| 373 | } |
| 374 | if( db_exists( |
| 375 | "SELECT 1 FROM blob WHERE rcvid=%d AND" |
| 376 | " EXISTS (SELECT 1 FROM shun WHERE shun.uuid=blob.uuid)", rcvid) |
| 377 | ){ |
| 378 | style_submenu_element("Unshun All", "Unshun All", "shun?accept&rcvid=%d#delshun", rcvid); |
| 379 | } |
| 380 | db_prepare(&q, |
| 381 | "SELECT login, datetime(rcvfrom.mtime), rcvfrom.ipaddr" |
| 382 | " FROM rcvfrom LEFT JOIN user USING(uid)" |
| 383 | " WHERE rcvid=%d", |
| 384 | rcvid |
| 385 |