* Make the --ns option optional. I don't know why it was required. The
bug affects any page that had its history merged.
* Reorganise the code so that dry run mode just skips the write queries,
making it more obvious what delete mode will do.
* Skip invalid titles.
Bug: T263340
Change-Id: I0dc0d72b254f43ba5ca5b8af45747f9c349c7a15
These are rows in page_table that have 'page_latest' entry with
corresponding 'rev_id' but no associated 'rev_page' entry in revision
table. Such rows create ghost pages because their 'page_latest' rev is
actually missing or moved to a different page now (which possess the -
associated 'rev_page' on revision table now).
https://en.wikipedia.org/wiki/Module:Jct/city/Chinissai
(page_id=41871839) is an example of such pages. Its page_latest rev is
819371998. But this revision has been moved to another page now
(page_id= 56252475), rendering the former inaccessible.
fb58d39 will prevent this going forward (for scribunto content), but we
need to clear the extant pages for module namespace and others caused
by something else.
Bug: T263340
Change-Id: I51abc295e37030ab181d4380f62c30d7998f1b9e