Commits

ZyX_I  committed 7b6fd68

@%aurum/drivers/mercurial, @%aurum/drivers/git, @%aurum/repo:
Added {ign} fifth optional argument to rf-status() which determines whether
information about ignored files should be added

  • Participants
  • Parent commits 4fe7438

Comments (0)

Files changed (7)

File autoload/aurum.vim

         autocmd! BufWritePost <buffer> :call s:_r.cache.del('status')
     augroup END
     return get(keys(filter(copy(s:_r.cache.get('status', repo.functions.status,
-                \                              [repo, 0, 0, [file]], {})),
+                \                              [repo, 0, 0, [file], 1, 1], {})),
                 \          'index(v:val, file)!=-1')), 0, '')
 endfunction
 let s:_functions+=['aurum#status']

File autoload/aurum/drivers/git.vim

             \    'lsf': 'Failed to list files in the changeset %s '.
             \           'of the repository %s: %s',
             \'statusf': 'Failed to obtain status of the repository %s: %s',
+            \ 'lsignf': 'Failed to list ignored files '.
+            \           'in the repository %s: %s',
             \    'rlf': 'Failed to list commits in repository %s: %s',
             \    'lbf': 'Failed to create/remove %s %s for revision %s '.
             \           'in the repository %s: %s',
 function s:git.status(repo, ...)
     let r=deepcopy(s:_r.utils.emptystatdct)
     let requiresclean=(a:0>3 && a:4)
+    let args=((a:0>2 && !empty(a:3))?(['--']+a:3):([]))
     if a:0 && (a:1 isnot 0 || (a:0>1 && a:2 isnot 0))
-        let args=((a:0>2 && !empty(a:3))?(['--']+a:3):([]))
         let rspec=[]
         let reverse=0
         if a:1 is 0
             let allfiles=a:repo.functions.getcsprop(a:repo,rspec[0],'allfiles')
         endif
     else
-        let args=((a:0>2 && !empty(a:3))?(['--']+a:3):([]))
         let kwargs={'porcelain': 1, 'z': 1}
         let s=s:_r.utils.nullnl(
                     \s:F.git(a:repo, 'status', args, kwargs, 2, 'statusf'))[:-2]
         if requiresclean
             let allfiles=a:repo.functions.getcsprop(a:repo, 'HEAD', 'allfiles')
         endif
+        if a:0>4 && a:5
+            let r.ignored=s:_r.utils.nullnl(
+                        \ s:F.git(a:repo, 'ls', args,
+                        \                 {'ignored': 1, 'z': 1}, 2,
+                        \                 'lsignf', a:repo))[:-2]
+        endif
     endif
     if exists('allfiles')
         if a:0>2 && !empty(a:3)

File autoload/aurum/drivers/mercurial.vim

     return r
 endfunction
 endif
-"▶1 hg.status :: repo[, rev1[, rev2[, files[, clean]]]] → {type : [file]}
+"▶1 hg.status :: repo[, rev1[, rev2[, files[, clean[, ign]]]]] → {type : [file]}
 " type :: "modified" | "added" | "removed" | "deleted" | "unknown" | "ignored"
 "       | "clean"
 if s:usepythondriver "▶2
 function s:hg.status(repo, ...)
-    let revargs=join(map(copy(a:000), 'v:val is 0? "None": string(v:val)'), ',')
+    let revargs=join(map(copy(a:000), 'v:val is 0? '.
+                \                           '"None":'.
+                \                     '(v:key>3 && v:val is 1)?'.
+                \                           '"True":'.
+                \                           '"vim.eval(''a:".(v:key+1)."'')"'),
+                \    ',')
     let d={}
     try
         execute s:pya.'get_status(vim.eval("a:repo.path"), '.revargs.')'
                 \'removed': 1,
                 \'deleted': 1,
                 \'unknown': 1,
-                \'ignored': 1}
-    if (a:0>3 && a:4)
-        let kwargs.clean=1
-    endif
+                \'ignored': (a:0>4 && a:5),
+                \  'clean': (a:0>3 && a:4)}
     let reverse=0
     if a:0
         if a:1 is 0

File autoload/aurum/repo.vim

 "▶1
-execute frawor#Setup('5.2', {'@/resources': '0.0',
+execute frawor#Setup('5.3', {'@/resources': '0.0',
             \                       '@/os': '0.0',
             \                  '@/options': '0.0',
             \          '@%aurum/lineutils': '0.0',

File autoload/aurum/status.vim

     endfor
     let bvar={}
     let requiresclean=0
+    let requiresignored=0
     if has_key(opts, 'show')
         if index(opts.show, 'all')==-1
             let show=s:F.parseshow(opts.show)
             let requiresclean=(index(show, 'clean')!=-1)
+            let requiresignored=(index(show, 'ignored')!=-1)
         else
             let show=s:allshow
             let requiresclean=1
+            let requiresignored=1
         endif
     else
         let show=s:defshow
     endif
     let status=a:repo.functions.status(a:repo, get(opts, 'rev',   0),
                 \                              get(opts, 'wdrev', 0),
-                \                              0, requiresclean)
+                \                              0, requiresclean,
+                \                              requiresignored)
     let bvar.status=status
     let bvar.types=[]
     let bvar.chars=[]

File doc/aurum.txt

     pulling properties that are not obtained by |aurum-rf-getcs| by default: 
     “files”, “changes”, “renames”, “copies”, “allfiles”, “chidlren”.
                                                              *aurum-rf-status*
-  status :: [hex[, hex[, [ file ][, requiresclean]]]] -> {status : [ file ]}
+  status :: [hex[, hex[, [ file ][, clean[, ign]]]]] -> {status : [ file ]}
     Returns dictionary where values are lists of files and keys are 
     "modified", "added" (new tracked files), "removed" (made untracked, not 
     necessary deleted from filesystem), "deleted" (just deleted from 
     files), "ignored" and "clean" (unmodified).
     Specifying 0 instead of any optional argument acts like not specifying 
     this argument.
-    Note: “clean” may be empty unless {requiresclean} argument is present and 
-          true.
+    Note: “clean” may be empty unless {clean} argument is present and true. 
+          Same for “ignored” and {ign}. {ign} argument is likely to be ignored 
+          itself unless two first optional arguments are absent or zero.
   dirty :: file -> Bool                                       *aurum-rf-dirty*
     Check whether file is “dirty” (meaning that it has changes that can be 
     committed).
          |aurum-repo.mutable|.
     4.1: Added csnum key to value returned by |aurum-repo.iterfuncs|.func().
     5.0: Removed _r.repo.update, .diffoptslst and .diffoptsstr.
-    5.1: Added repo.hasphases
-    5.2: Added repo.revreg
+    5.1: Added repo.hasphases.
+    5.2: Added repo.revreg.
+    5.3: Added {ign} argument to |aurum-rf-status|.
 @aurum:
     0.1: Added |:AuBranch| and |:AuName|.
     0.2: Added |:AuOther|.
 @%aurum/edit:
     1.0: Removed setlines function (moved it to @aurum/repo).
     1.1: Added “requiresbvar” _f.newcommand option.
-    1.2: Added “mgroup” _f.newcommand option and mrun resource
-    1.3: Added prevbuf function
+    1.2: Added “mgroup” _f.newcommand option and mrun resource.
+    1.3: Added prevbuf function.
 @%aurum/vimdiff:
     0.1: Added full, untracked, onlymodified and files options to |:AuVimDiff|
     0.2: Added _r.vimdiff.full.

File python/aurum/aumercurial.py

     vim_extend(var='a:cs', val={prop : r}, utf=False)
 
 @outermethod
-def get_status(repo, rev1=None, rev2=None, files=None, clean=None):
+def get_status(repo, rev1=None, rev2=None, files=None, clean=None, ignored=None):
     if rev1 is None and rev2 is None:
         rev1='.'
     if hasattr(repo, 'status'):
             m=None
         else:
             m=match.match(None, None, files, exact=True)
-        status=repo.status(rev1, rev2, ignored=True, clean=clean,
-                           unknown=True, match=m)
+        status=repo.status(rev1, rev2, match=m, clean=clean, ignored=ignored,
+                           unknown=True)
         vim_extend(val={'modified': status[0],
                            'added': status[1],
                          'removed': status[2],