Xqt has submitted this change and it was merged.
Change subject: Adding option of not deleting the old cat, It was partially implemented
already
......................................................................
Adding option of not deleting the old cat, It was partially implemented already
Bug: 55291
Change-Id: I76b512acb692598a6a9528a162085e5ee330ffb8
---
M category.py
1 file changed, 7 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/category.py b/category.py
index e1bb0ad..b9471a1 100644
--- a/category.py
+++ b/category.py
@@ -39,6 +39,7 @@
Options for "move" action:
* -hist - Creates a nice wikitable on the talk page of target category
that contains detailed page history of the source category.
+ * -nodelete - Don't delete the old category after move
Options for several actions:
* -rebuild - reset the database
@@ -885,6 +886,7 @@
sort_by_last_name = False
restore = False
create_pages = False
+ deleteEmptySourceCat = True
for arg in pywikibot.handleArgs(*args):
if arg == 'add':
action = 'add'
@@ -898,6 +900,8 @@
action = 'tree'
elif arg == 'listify':
action = 'listify'
+ elif arg =='-nodelete':
+ deleteEmptySourceCat = False
elif arg == '-person':
sort_by_last_name = True
elif arg == '-rebuild':
@@ -971,8 +975,9 @@
newCatTitle = pywikibot.input(
u'Please enter the new name of the category:')
bot = CategoryMoveRobot(oldCatTitle, newCatTitle, batchMode,
- editSummary, inPlace, titleRegex=titleRegex,
- withHistory=withHistory)
+ editSummary, inPlace,
+ deleteEmptySourceCat=deleteEmptySourceCat,
+ titleRegex=titleRegex, withHistory=withHistory)
bot.run()
elif action == 'tidy':
catTitle = pywikibot.input(u'Which category do you want to tidy up?')
--
To view, visit
https://gerrit.wikimedia.org/r/91849
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I76b512acb692598a6a9528a162085e5ee330ffb8
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot