From: Joseph Reagle Date: Tue, 8 Feb 2011 16:12:10 +0000 (-0500) Subject: pull must handle deleted pages X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/cb2e8527af434daeeb20e4c796df43b7cff2b1a9 pull must handle deleted pages --- diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index aec3f24..433e607 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -187,6 +187,11 @@ class PullCommand(CommandBase): for pageid in response.keys(): pagename = response[pageid]['title'] + # If no revisions, then error, perhaps page deleted + if 'revisions' not in response[pageid]: + print 'skipping: "%s" -- cannot find page, perhaps deleted' % (pagename) + continue + # Is the revisions list a sorted one, should I use [0] or [-1]? -- reagle if 'comment' in response[pageid]['revisions'][0]: last_wiki_rev_comment = response[pageid]['revisions'][0]['comment']