]> projects.mako.cc - mw/commitdiff
pull must handle deleted pages
authorJoseph Reagle <joseph.2008@reagle.org>
Tue, 8 Feb 2011 16:12:10 +0000 (11:12 -0500)
committerJoseph Reagle <joseph.2008@reagle.org>
Tue, 8 Feb 2011 16:12:10 +0000 (11:12 -0500)
src/mw/clicommands.py

index aec3f24be9edb845fe48a76f89b79d56ed96fb98..433e607839a841b1f219ba5e3d1274cff4af6923 100644 (file)
@@ -187,6 +187,11 @@ class PullCommand(CommandBase):
             for pageid in response.keys():
                 pagename = response[pageid]['title']
                 
             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']
                 # 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']

Benjamin Mako Hill || Want to submit a patch?