Commits

ZyX_I  committed 68df872

@%aurum/drivers/bazaar: Added support for listing ignored files

  • Participants
  • Parent commits a8f8726
  • Branches bzr-support

Comments (0)

Files changed (6)

File autoload/aurum/drivers/bazaar.vim

             \      'lsf': 'Failed to list files in the changeset %s '.
             \             'from the repository %s: %s',
             \    'statf': 'Failed to get status in the repository %s: %s',
+            \'lsignoref': 'Failed to list ignored files '.
+            \             'in the repository %s: %s',
             \   'labelf': 'Failed to set %s “%s” for the changeset %s '.
             \             'in the repository %s: %s',
             \  'revertf': 'Failet to revert to the changeset %s '.
             \    'kind changed': 'modified', 'unknown': 'unknown',
             \    'missing': 'deleted'}
 function s:bzr.status(repo, ...)
-    let statdict=s:F.getstatdict(a:repo, ['--']+((a:0>2 && a:3 isnot 0)?
-                \                                   (a:3):
-                \                                   ([])),
+    let files=((a:0>2 && a:3 isnot 0)?(a:3):([]))
+    let statdict=s:F.getstatdict(a:repo, ['--']+files,
                 \                ((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)
+        let r.ignored=s:_r.utils.nullnl(
+                    \ s:F.bzr(a:repo, 'ls', ['--']+files,
+                    \                 {'ignored': 1, 'null': 1}, 2,
+                    \                 'lsignoref', a:repo))[:-2]
+    endif
     return r
 endfunction
 "▶1 bzr.commit :: repo, message[, files[, user[, date[, _]]]]

File doc/aurum.txt

     “subdir*/ignored*” will ignore all files with names starting with 
     “ignored” in a directory “subdir*”, which is probably not what you 
     initially wanted.
+
 ------------------------------------------------------------------------------
 10.4. Bazaar                                             *aurum-driver-Bazaar*
 
     unlike renames, are not supported by bazaar itself).
 |aurum-rf-status| assumes that when renaming old file name does not contain 
     string “ => ” and all file names do not contain "\n  " or "\nsmth:".
+    Ignored files are shown only when the first two optional arguments are 
+    absent or equal to null.
 |aurum-rf-branch| renames branch instead of creating a new one.
 |aurum-rf-update| uses revert+update for forced update.
 |aurum-rf-grep| uses internal grep implementation based on 

File test/bzrtestrepo.tar.xz

Binary file modified.

File test/createbzrrepo.zsh

     bzr tag -- --force
     bzr config parent_location=.
     popd
+    pushd A
+    bzr ignore 'a*'
+    bzr commit -m 'Added .bzrignore' \
+        --author $A --commit-time='1994-01-02 00:00:01 +0040'
+    touch a $'a\n'
+    popd
 )
 tar cJf bzrtestrepo.tar.xz bzrtestrepo

File test/drivers-bazaar.ok

Binary file modified.

File 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 WriteFile(r)
 source addEmessages.vim