]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/bugs/removal_of_transient_pages.mdwn
remove: Support removing of pages in the transient underlay. (smcv)
[ikiwiki.git] / doc / bugs / removal_of_transient_pages.mdwn
index 2667a2b8318cfdecddafb4caa9d1b1efd1913737..dfa14d359a831eef1749927055628dcd177e8ffb 100644 (file)
@@ -25,3 +25,37 @@ pages, until this is fixed.  --[[Joey]]
 >>>> to affect by web edits. The `-f` check seems rather redundant,
 >>>> surely if it's in `%pagesources` ikiwiki has already verified it's
 >>>> safe. --[[Joey]] 
+
+----
+
+[[!template id=gitbranch branch=smcv/ready/transient-rm author="[[Simon McVittie|smcv]]"]]
+
+Here's a branch. It special-cases the `$transientdir`, but in such a way
+that the special case could easily be extended to other locations where
+deletion should be allowed.
+
+It also changes `IkiWiki::prune()` to optionally stop pruning empty
+parent directories at the point where you'd expect it to (for instance,
+previously it would remove the `$transientdir` itself, if it turns out
+to be empty), and updates callers.
+
+The new `prune` API looks like this:
+
+    IkiWiki::prune("$config{srcdir}/$file", $config{srcdir});
+
+with the second argument optional. I wonder whether it ought to look
+more like `writefile`:
+
+    IkiWiki::prune($config{srcdir}, $file);
+
+although that would be either an incompatible change to internal API
+(forcing all callers to update to 2-argument), or being a bit
+inconsistent between the one-and two-argument forms. Thoughts?
+
+--[[smcv]]
+
+> I've applied the branch as-is, so this bug is [[done]].
+> `prune` is not an exported API so changing it would be ok.. 
+> I think required 2-argument would be better, but have not checked
+> all the call sites to see if the `$file` is available split out
+> as that would need. --[[Joey]]