X-Git-Url: https://projects.mako.cc/source/mw/blobdiff_plain/ac7e90d463ab412375247a74083fe8f7385729b5..90afbee67cd871468f755c9a9769d53adca9941c:/src/mw/clicommands.py?ds=sidebyside diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index 7ead096..60d98df 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -72,11 +72,10 @@ class InitCommand(CommandBase): self.metadir.create(self.args[0]) -class FetchCommand(CommandBase): +class PullCommand(CommandBase): def __init__(self): usage = '%prog fetch [options] PAGENAME ...' - CommandBase.__init__(self, 'fetch', 'fetch remote pages', usage) - self.shortcuts.append('ft') + CommandBase.__init__(self, 'pull', 'add remote pages to repo', usage) def _do_command(self): self._die_if_no_init() @@ -97,8 +96,9 @@ class FetchCommand(CommandBase): print '%s: %s: page does not exist, file not created' % \ (self.me, pagename) continue - revid = [x['revid'] for x in response[pageid]['revisions']] - self.metadir.pagedict_add(pagename, int(pageid)) + revids = [x['revid'] for x in response[pageid]['revisions']] + revids.sort() + self.metadir.pagedict_add(pagename, pageid, revids[-1]) self.metadir.pages_add_rv(int(pageid), response[pageid]['revisions'][0]) filename = mw.api.pagename_to_filename(pagename)