ArielGlenn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/218882
Change subject: dumps: xml stream dump may be completely empty, permit it
......................................................................
dumps: xml stream dump may be completely empty, permit it
ran into a wiki with no content pages, just user, talk etc.
and so abstracts were empty. to make the check for this work,
we generate xml header, then do the content stream in pieces,
then generate the footer.
Change-Id: I99441360baa347438d37b5b8c59441bb4e77a33d
---
M xmldumps-backup/xmlstreams.py
1 file changed, 5 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/dumps
refs/changes/82/218882/1
diff --git a/xmldumps-backup/xmlstreams.py b/xmldumps-backup/xmlstreams.py
index 5d70e5d..87be9af 100644
--- a/xmldumps-backup/xmlstreams.py
+++ b/xmldumps-backup/xmlstreams.py
@@ -44,18 +44,12 @@
if interval > max_interval:
interval = max_interval
- # run first
+ # get just the header
piece_command = [field for field in command]
- piece_command.extend(["--start", str(start)])
- piece_command.append("--skip-footer")
- if interval <= end:
- upto = interval + start
- else:
- upto = end+1
- piece_command.extend(["--end", str(upto)])
+ piece_command.extend(["--skip-footer", "--start=1", "--end=1"])
+ do_xml_piece(piece_command, outfiles, dryrun=dryrun)
- do_xml_piece(piece_command, outfiles, ends_with, dryrun)
-
+ upto = 1
while upto <= end:
piece_command = [field for field in command]
piece_command.append("--skip-header")
@@ -68,10 +62,9 @@
upto = upto + interval
do_xml_piece(piece_command, outfiles, ends_with, dryrun)
- piece_command = [field for field in command]
# get just the footer
+ piece_command = [field for field in command]
piece_command.extend(["--skip-header", "--start=1", "--end=1"])
-
do_xml_piece(piece_command, outfiles, dryrun=dryrun)
if dryrun:
--
To view, visit https://gerrit.wikimedia.org/r/218882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I99441360baa347438d37b5b8c59441bb4e77a33d
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits