Commits

ZyX_I  committed 08743a1

@aurum/drivers/mercurial: Fixed two problems in non-python driver:
1. Repository update was completely wrong, it
duplicated number of changesets
2. It used rev1..rev2 syntax while rev1:rev2 was
needed. Sometimes first is not supported

  • Participants
  • Parent commits cf0acdb
  • Tags release-1.4.10

Comments (0)

Files changed (3)

File README.markdown

   - Viewing working directory status ([:AuStatus](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line376-0)).
 
   - Commiting changes ([:AuCommit](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line99-0)), commit messages are remembered in case of 
-    rollback ([g:aurum_remembermsg](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line896-0)).
+    rollback ([g:aurum_remembermsg](http://vimpluginloader.sourceforge.net/doc/aurum.txt.html#line903-0)).
 
   - Obtaining various URL’s out of remote repository URL (like URL of the HTML 
     version of the current file with URL fragment pointing to the current line 

File plugin/aurum/drivers/mercurial.vim

 function s:F.getcslist(repo, start, end)
     let kwargs={'style': s:stylefile}
     let lines=s:F.hg(a:repo, 'log', [],
-                \    extend({'rev': a:start.'..'.a:end}, kwargs), 0, 'log')[:-2]
+                \    extend({'rev': a:start.':'.a:end}, kwargs), 0, 'log')[:-2]
     let css=[]
     if has_key(a:repo.changesets, s:nullrev)
         let cs0=a:repo.changesets[s:nullrev]
     let prevrev=-1
     while line<llines
         let [cs, line]=s:F.parsecs(lines, line)
-        if cs.rev-prevrev!=1
+        if cs.rev-prevrev!=1 && prevrev!=-1
             let css+=map(range(prevrev+1, cs.rev-1),
                         \'s:F.parsecs(s:F.hg(a:repo, "log", [], '.
                         \            'extend({"rev": "".v:val}, kwargs), 0, '.
         let css+=[cs]
         let prevrev=cs.rev
     endwhile
-    let cs0.rev=len(css)
     let css+=[cs0]
     return css
 endfunction
 endif
 "▶1 getcs :: repo, rev → cs
 if s:usepythondriver "▶2
-function s:F.getcs(repo, rev)
-    let cs={}
-    try
-        execute s:_r.py.cmd 'aurum.get_cs(vim.eval("a:repo.path"), '.
-                    \                    'vim.eval("a:rev"))'
-    endtry
-    return cs
-endfunction
+    function s:F.getcs(repo, rev)
+        let cs={}
+        try
+            execute s:_r.py.cmd 'aurum.get_cs(vim.eval("a:repo.path"), '.
+                        \                    'vim.eval("a:rev"))'
+        endtry
+        return cs
+    endfunction
 else "▶2
-function s:F.getcs(repo, rev)
-    let csdata=s:F.hg(a:repo, 'log', [], {'rev': a:rev, 'style': s:stylefile},0,
-                \     'cs', a:rev)
-    let cs=s:F.parsecs(csdata, 0)[0]
-    call map(cs.parents,
-                \'type(v:val)=='.type(0).'? '.
-                \   'a:repo.functions.getrevhex(a:repo, v:val): '.
-                \   'v:val')
-    return cs
-endfunction
+    function s:F.getcs(repo, rev)
+        let csdata=s:F.hg(a:repo, 'log', [], {'rev': a:rev, 'style': s:stylefile},0,
+                    \     'cs', a:rev)
+        let cs=s:F.parsecs(csdata, 0)[0]
+        call map(cs.parents,
+                    \'type(v:val)=='.type(0).'? '.
+                    \   'a:repo.functions.getrevhex(a:repo, v:val): '.
+                    \   'v:val')
+        return cs
+    endfunction
 endif
 "▶1 hg.getcs :: repo, rev → cs
 function s:hg.getcs(repo, rev)
         endtry
         return d
     endfunction
-"▶2 no python
+    "▶2 no python
 else
     function s:F.getupdates(repo, start)
         let r={}
 function s:hg.grep(repo, pattern, files, revisions, ignore_case, wdfiles)
     let args=map(copy(a:revisions),
             \                '((type(v:val)=='.type([]).')?'.
-            \                   '("--rev=".join(v:val, "..")):'.
+            \                   '("--rev=".join(v:val, ":")):'.
             \                   '("--rev=".v:val))')+
             \['--', a:pattern]+a:files
     let kwargs={'line-number': 1}

File python/aurum.py

         ui=CaptureUI()
         args=[ui, repo, pattern]
         args.extend(files)
-        revisions=["..".join(rev) if type(rev) is list else rev
-                                                    for rev in revisions]
+        revisions=[":".join(rev) if type(rev) is list else rev
+                                 for rev in revisions]
         if not revisions:
             revisions=None
         kwargs={'rev': revisions, 'ignore_case': bool(ignore_case),