]> projects.mako.cc - mw/blobdiff - src/mw/clicommands.py
Store current revision ID in metadir
[mw] / src / mw / clicommands.py
index 7ead096c6fe43d217b5c4eebfe1f1450333b25b3..60d98df9978e7fa33f5127d8c3e476a594484732 100644 (file)
@@ -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)

Benjamin Mako Hill || Want to submit a patch?