Fossil SCM

Option to shun/unshun a whole transaction (by rcvid)

baruch 2014-09-09 07:04 UTC baruch-multishun
Commit 66b5647af70be55fd14370dcbeb89d6955764fc0
1 file changed +39 -4
+39 -4
--- src/shun.c
+++ src/shun.c
@@ -42,11 +42,14 @@
4242
Stmt q;
4343
int cnt = 0;
4444
const char *zUuid = P("uuid");
4545
const char *zShun = P("shun");
4646
const char *zAccept = P("accept");
47
+ const char *zRcvid = P("rcvid");
48
+ int nRcvid;
4749
int nUuid;
50
+ int numRows = 3;
4851
char *zCanonical = 0;
4952
5053
login_check_credentials();
5154
if( !g.perm.Admin ){
5255
login_needed();
@@ -147,10 +150,14 @@
147150
}
148151
@ have been shunned. They will no longer be pushed.
149152
@ They will be removed from the repository the next time the repository
150153
@ is rebuilt using the <b>fossil rebuild</b> command-line</p>
151154
}
155
+ if( zRcvid ){
156
+ nRcvid = atoi(zRcvid);
157
+ numRows = db_int(0, "SELECT min(count(), 10) FROM blob WHERE rcvid=%d", nRcvid);
158
+ }
152159
@ <p>A shunned artifact will not be pushed nor accepted in a pull and the
153160
@ artifact content will be purged from the repository the next time the
154161
@ repository is rebuilt. A list of shunned artifacts can be seen at the
155162
@ bottom of this page.</p>
156163
@
@@ -172,13 +179,21 @@
172179
@ sight - set the "hidden" tag on such artifacts instead.</p>
173180
@
174181
@ <blockquote>
175182
@ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div>
176183
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">
178185
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
+ }
180195
}
181196
@ </textarea>
182197
@ <input type="submit" name="add" value="Shun" />
183198
@ </div></form>
184199
@ </blockquote>
@@ -191,13 +206,21 @@
191206
@ operations.</p>
192207
@
193208
@ <blockquote>
194209
@ <form method="post" action="%s(g.zTop)/%s(g.zPath)"><div>
195210
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">
197212
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
+ }
199222
}
200223
@ </textarea>
201224
@ <input type="submit" name="sub" value="Accept" />
202225
@ </div></form>
203226
@ </blockquote>
@@ -340,10 +363,22 @@
340363
login_check_credentials();
341364
if( !g.perm.Admin ){
342365
login_needed();
343366
}
344367
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
+ }
345380
db_prepare(&q,
346381
"SELECT login, datetime(rcvfrom.mtime), rcvfrom.ipaddr"
347382
" FROM rcvfrom LEFT JOIN user USING(uid)"
348383
" WHERE rcvid=%d",
349384
rcvid
350385
--- 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

Keyboard Shortcuts

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