ZyX_I avatar ZyX_I committed d42b7ca

@%aurum/drivers/mercurial: Better handling of updates
Fixes #58

Comments (0)

Files changed (1)

autoload/aurum/drivers/mercurial.vim

             " XXX get_updates also modifies a:repo
             " execute s:py 'import cProfile as profile'
             " execute s:py 'profile.run("'.s:pp.'.get_updates(vim.eval(''a:repo.path''), '.a:start.')", "python.profile")'
-            execute s:pya.'get_updates(vim.eval("a:repo.path"), '.a:start.')'
+            execute s:pya.'get_updates(vim.eval("a:repo.path"), "'.a:start.'")'
         endtry
         return d
     endfunction
         let r={}
         let tip_hex=a:repo.functions.getrevhex(a:repo, 'tip')
         let cschange=1
-        if a:start
+        if a:start isnot 0
             try
-                let oldtip=a:repo.functions.getcs(a:repo, a:start)
-                if tip_hex is# oldtp.hex
+                " XXX It is needed to force obtaining revision information hence 
+                "     s:F.getcs(), not rf-getcs()
+                let oldtip=s:F.getcs(a:repo, a:start)
+                if tip_hex is# oldtip.hex
                     let cschange=0
                 endif
                 let startrev=oldtip.rev
         return s:F.updatetags(a:repo)
     endif
     let d={}
-    let start=len(a:repo.mutable.cslist)-2
-    if start<0
-        let start=0
-    endif
+    let start=get(a:repo.mutable.cslist, -2, {'hex': 0}).hex
     " XXX getupdates may also modify repo
     let d=s:F.getupdates(a:repo, start)
     if empty(d)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.