ZyX_I avatar ZyX_I committed 4c21be7

@%aurum/drivers/bazaar: Added support for fith optional argument to rf-status()
Fixed getting ignored files when third argument is not empty
tests: Improved rf-status() test

Comments (0)

Files changed (5)

autoload/aurum/drivers/bazaar.vim

     let a:cs[a:prop]=r
     return r
 endfunction
-"▶1 bzr.status :: repo[, rev1[, rev2[, files[, clean]]]]
+"▶1 bzr.status :: repo[, rev1[, rev2[, files[, clean[, ign]]]]] → {type:[file]}
 let s:statstats={'added': 'added', 'removed': 'removed', 'modified': 'modified',
             \    'kind changed': 'modified', 'unknown': 'unknown',
             \    'missing': 'deleted'}
 function s:bzr.status(repo, ...)
-    let files=((a:0>2 && a:3 isnot 0)?(a:3):([]))
-    let statdict=s:F.getstatdict(a:repo, ['--']+files,
+    let args=['--']+((a:0>2 && a:3 isnot 0)?(a:3):([]))
+    let statdict=s:F.getstatdict(a:repo, args,
                 \                ((a:0>1 && a:1 isnot 0 && a:2 isnot 0)?
                 \                   ({'revision': a:1.'..'.a:2}):
                 \                ((a:0>0 && a:1 isnot 0)?
         let files=r.modified+r.added+r.removed+r.deleted+r.unknown
         let r.clean=filter(allfiles, 'index(files, v:val)==-1')
     endif
-    if !a:0 || (a:0==1 && a:1 is 0) || (a:0>1 && a:1 is 0 && a:2 is 0)
+    if (a:0>4 && a:5 && a:1 is 0 && a:2 is 0)
         let r.ignored=s:_r.utils.nullnl(
-                    \ s:F.bzr(a:repo, 'ls', ['--']+files,
-                    \                 {'ignored': 1, 'null': 1}, 2,
+                    \ s:F.bzr(a:repo, 'ls', args, {'ignored': 1, 'null': 1}, 2,
                     \                 'lsignoref', a:repo))[:-2]
     endif
     return r
Add a comment to this file

test/bzrtestrepo.tar.xz

Binary file modified.

test/createbzrrepo.zsh

         --author $A --commit-time='1994-01-02 00:00:01 +0040'
     touch a $'a\n'
     popd
+    pushd B
+    bzr pull
+    echo 0>removed
+    echo 1>deleted
+    echo 2>moved
+    echo 3>selfmoved
+    echo 4>modified
+    echo 5>forgotten
+    bzr add .
+    truncate --size=0 .bzrignore
+    bzr ignore ignored
+    bzr commit -m 'Added removed, deleted and moved' \
+        --author $A --commit-time='1994-01-02 00:00:02 +0040'
+    echo a>unknown
+    echo b>added
+    echo c>ignored
+    echo d>added-removed
+    echo e>modified
+    bzr add added added-removed
+    bzr remove removed added-removed
+    bzr remove --keep forgotten
+    rm deleted
+    bzr mv moved moved-new
+    mv selfmoved selfmoved-new
+    popd
 )
 tar cJf bzrtestrepo.tar.xz bzrtestrepo

Binary file modified.

test/drivers-bazaar.vim

     call FormatCS(Arepo, cs)
 endfor
 call FormatStatus(Arepo.functions.status(Arepo))
-call FormatStatus(Arepo.functions.status(Arepo, 0,   0,   0,                 1))
-call FormatStatus(Arepo.functions.status(Arepo, 0,   0,   [],                1))
-call FormatStatus(Arepo.functions.status(Arepo, '7', 0,   0,                 1))
-call FormatStatus(Arepo.functions.status(Arepo, '5', 0,   0,                 1))
-call FormatStatus(Arepo.functions.status(Arepo, 0,   '5', 0,                 1))
-call FormatStatus(Arepo.functions.status(Arepo, '5', '4', 0,                 1))
-call FormatStatus(Arepo.functions.status(Arepo, '5', 0,   ['bzrlines.lst'],  1))
+call FormatStatus(Arepo.functions.status(Arepo, 0,   0,   0,             1, 1))
+call FormatStatus(Arepo.functions.status(Arepo, 0,   0,   [],            1, 1))
+call FormatStatus(Arepo.functions.status(Arepo, '7', 0,   0,             1, 1))
+call FormatStatus(Arepo.functions.status(Arepo, '5', 0,   0,             1, 1))
+call FormatStatus(Arepo.functions.status(Arepo, 0,   '5', 0,             1, 1))
+call FormatStatus(Arepo.functions.status(Arepo, '5', '4', 0,             1, 1))
+call FormatStatus(Arepo.functions.status(Arepo, '4', 0,   ['lines.lst'], 1, 1))
+cd bzrtestrepo/B
+let Brepo=aurum#repository()
+cd -
+call FormatStatus(Brepo.functions.status(Brepo, 0, 0, 0, 1, 1))
 
 call WriteFile(r)
 source addEmessages.vim
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.