Commits

ZyX_I committed 80fa805

Added `:' special path

Comments (0)

Files changed (2)

 function s:F.comm.getrepo(path)
     if empty(a:path)
         let path=fnamemodify('.', ':p')
+    elseif a:path is# ':'
+        let buf=bufnr('%')
+        if has_key(s:bufvars, buf) && has_key(s:bufvars[buf], 'repo')
+            let path=s:bufvars[buf].repo.path
+        else
+            let path=expand('%:p')
+        endif
     else
-        let path=a:path
+        let path=s:_r.os.path.abspath(a:path)
     endif
     if path!~#'\v^\w+%(\+\w+)*\V://'
         let olddir=''
         endwhile
     endif
     let repotype=s:F.comm.repotype(path)
+    if repotype is 0
+        return 0
+    endif
     let repo=s:F[repotype].repo(path)
     if repo is 0
-        return repo
+        return 0
     endif
     let repo.type=repotype
     let repo.functions=s:F[repotype]
     dodiff(ui, *args, **kwargs)
 
 def get_cs_prop(path, rev, prop):
+    # XXX There is much code relying on the fact that after getcsprop property 
+    # with given name is added to changeset dictionary
     vim.eval('extend(a:cs, {"'+prop+'": '+
              nonutf_dumps(get_repo(path)[rev].__getattribute__(prop)())+'})')