Commits

ZyX_I committed 26325d0

@aurum/drivers/*, @aurum/repo, @aurum/drivers/common/utils:
Added @/python dependency (as in new frawor it is no longer using ignoredeps)
@aurum/cache: Removed twoload

  • Participants
  • Parent commits 1289ad6

Comments (0)

Files changed (8)

File autoload/aurum/drivers/bazaar.vim

             \                                   '@%aurum/repo': '5.0',
             \                   '@%aurum/drivers/common/utils': '1.2',
             \                                           '@/os': '0.1',
-            \                                      '@/options': '0.0',})
+            \                                      '@/options': '0.0',
+            \                                       '@/python': '1.0',})
 let s:_messages={
             \   'revnof': 'Failed to get working directory revision '.
             \             'from the repository %s: %s',

File autoload/aurum/drivers/common/utils.vim

 "▶1
 scriptencoding utf-8
 execute frawor#Setup('1.2', {'@/resources': '0.0',
-            \                       '@/os': '0.2'})
+            \                       '@/os': '0.2',
+            \                   '@/python': '1.0',})
 let s:utils={}
 "▶1 _unload
 function s:._unload()

File autoload/aurum/drivers/git.vim

             \                                   '@%aurum/repo': '5.0',
             \                   '@%aurum/drivers/common/utils': '1.2',
             \                                           '@/os': '0.1',
-            \                                      '@/options': '0.0',})
+            \                                      '@/options': '0.0',
+            \                                       '@/python': '1.0',})
 let s:_messages={
             \   'hexf': 'Failed to obtain hex string for revision %s '.
             \           'in the repository %s: %s',

File autoload/aurum/drivers/mercurial.vim

 execute frawor#Setup('0.2', {'@%aurum/drivers/common/hypsites': '0.0',
             \                                   '@%aurum/repo': '5.0',
             \                   '@%aurum/drivers/common/utils': '1.0',
-            \                                       '@/python': '0.0',
+            \                                       '@/python': '1.0',
             \                                           '@/os': '0.0',
             \                                      '@/options': '0.0',})
 let s:hg={}

File autoload/aurum/drivers/subversion.vim

             \                                   '@%aurum/repo': '5.0',
             \                   '@%aurum/drivers/common/utils': '1.1',
             \                     '@%aurum/drivers/common/xml': '0.0',
-            \                                           '@/os': '0.0',})
+            \                                           '@/os': '0.0',
+            \                                       '@/python': '1.0',})
 let s:_messages={
             \  'rnimp': 'Reversing diff between working directory and '.
             \           'any revision is not implemented',

File autoload/aurum/repo.vim

 execute frawor#Setup('5.5', { '@/resources': '0.0',
             \                        '@/os': '0.0',
             \                   '@/options': '0.0',
+            \                    '@/python': '1.0',
             \           '@%aurum/lineutils': '0.0',
             \             '@%aurum/bufvars': '0.0',
             \                      '@aurum': '1.0',

File plugin/aurum/cache.vim

 "▶1
 scriptencoding utf-8
-if !exists('s:_pluginloaded')
-    execute frawor#Setup('2.3', {'@/resources': '0.0',
-                \                  '@/options': '0.0',}, 0)
-    finish
-elseif s:_pluginloaded
-    finish
-elseif !exists('s:_loading')
-    call FraworLoad(s:_frawor.id)
-    finish
-endif
+execute frawor#Setup('2.3', {'@/resources': '0.0',
+            \                  '@/options': '0.0',})
 let s:_options={
             \'branchcachetime': {'default': 2, 'checker': 'range 0 inf'},
             \'cscachetime':     {'default': 3, 'checker': 'range 0 inf'},

File python/aurum/aubazaar.py

         'bookmarks' : [],
 }
 
-def set_rev_dict(cs, cs_vim, revid_revno_map, reverse_tag_dict):
+def set_rev_dict(cs, cs_vim, reverse_tag_dict):
     cs_vim['hex']         = cs.revision_id
-    cs_vim['rev']         = revid_revno_map[cs.revision_id]
     cs_vim['time']        = int(cs.timestamp)
     cs_vim['description'] = cs.message.encode('utf-8')
 
     cs_vim.update(cs_vim_defaults)
     return cs_vim
 
+def g_revno(repo, revid):
+    return repo.branch.revision_id_to_revno(revid)
+
+@outermethod
+@autoexportmethod()
+@bzrmethod
+def get_updates(repo, oldtip=None):
+    revno = repo.branch.revno()
+    tiprev = g_cs(repo, revno)
+    if oldtip is not None:
+        try:
+            oldtiprev = g_cs(repo, oldtip)
+        except Exception:
+            return get_updates_unchanged(repo)
+
+        if tiprev.revision_id == oldtiprev.revision_id:
+            return {'startrev': g_revno(startrev),
+                        'tags': dict(((str(key), value)
+                                    for key, value
+                                    in repo.branch.tags.get_tag_dict().iteritems())),
+                   }
+        else:
+            startrev = g_revno(oldtiprev)
+            known_revisions = set(vim.eval('keys(a:repo.changesets)'))
+            css = []
+            for revid, merge_depth, revno, end_of_merge \
+                    in repo.branch.iter_merge_sorted_revisions(
+                            start_revision_id =    tiprev.revision_id,
+                            stop_revision_id  = oldtiprev.revision_id):
+                css.append(set_rev_dict(repo.branch.repository.get_revision(revid),
+                                        {'rev': '.'.join(revno)},
+                                        repo.branch.tags.get_reverse_tag_dict()))
+    else:
+        pass
+
 # vim: ft=python ts=4 sw=4 sts=4 et tw=100