Commits

ZyX_I committed b02886e

Made :AuLog files {glob} also track copies

Comments (0)

Files changed (4)

     Possible options:
     Option      Description ~
     files       Glob. If present, only revisions where file matching glob was 
-                modified are shown. It also tracks renames of a file. May be 
-                specified more then once.
+                modified are shown. It also tracks renames and copies of 
+                a file. May be specified more then once.
                 Note: This option also affects files shown when `stat', 
                       `patch', `showfiles', `showrenames' and `showcopies' 
                       options are specified (unless `ignfiles' is also 

plugin/aurum/log.vim

             " TODO Check whether it causes a problem with more then one parent
             return
         endif
-        " TODO Also track copies
         let rename=get(cs.renames, file, 0)
         if type(rename)!=type('')
             let rename=file
         endif
+        let copy=get(cs.copies, file, 0)
+        if type(copy)==type('')
+            if index(cs.changes, file)!=-1 && index(a:csfiles[cs.hex], file)==-1
+                let a:csfiles[cs.hex]+=[copy]
+            endif
+            let tocheck+=map(copy(cs.parents),'[copy,a:repo.changesets[v:val]]')
+        endif
         if index(a:repo.functions.getcsprop(a:repo, cs, 'allfiles'), file)==-1
-            return
+            continue
         endif
         if index(cs.changes, file)!=-1 && index(a:csfiles[cs.hex], file)==-1
             let a:csfiles[cs.hex]+=[file]
     endif
     "▲2
     let cslist=bvar.repo.cslist[bvar.opts.revs[0]:bvar.opts.revs[1]]
-    "▶2 Generate cs.{kw} for `show{kw}' option (kw=renames, copies)
+    "▶2 Generate cs.{kw} for various options (`show{kw}'+`files')
     for key in ['renames', 'copies']
-        if get(bvar.opts, 'show'.key, 0)
+        if get(bvar.opts, 'show'.key, 0) || has_key(bvar.opts, 'files')
             for cs in cslist
                 call bvar.repo.functions.getcsprop(bvar.repo, cs, key)
             endfor
     if has_key(bvar.opts, 'files')
         let bvar.opts.csfiles={}
         for cs in cslist
-            let rns     = bvar.repo.functions.getcsprop(bvar.repo,cs, 'renames')
-            let cps     = bvar.repo.functions.getcsprop(bvar.repo,cs, 'copies' )
-            let changes = bvar.repo.functions.getcsprop(bvar.repo,cs, 'changes')
-            let changes = copy(changes)
-            let csfiles = []
+            let changes=bvar.repo.functions.getcsprop(bvar.repo,cs, 'changes')
+            let changes=copy(changes)
+            let csfiles=[]
             let bvar.opts.csfiles[cs.hex]=csfiles
             for pattern in bvar.opts.filepats
                 let newfiles=filter(copy(changes), 'v:val=~#pattern')
 :W{{{2 date<=>date
 :Run AuLog date 1999<=>2001
 :bw!
-:W{{{1 files
+:W{{{1 files (renames)
 :Run AuLog files crepo.zsh
 :bw!
+:W{{{1 files (copies)
+:Run AuLog files hglines2.lst
 :W{{{1 limit
 :Run AuLog limit 10
 :bw!
 |  Commited 02 Jan 1999 05:20 by A <a@example.com>
 |  @ Added «createrepo.zsh»
 |  
-{{{1 files
+{{{1 files (renames)
 o  Changeset 3:ccf3e1d041800ad99d46dcdec6e12c8a770456f9 (branch default)
 |  Commited 01 Feb 2000 14:00 by B <b@example.org>
 |  @ Renamed «crepo.zsh» to «chgrepo.zsh»
 |  Commited 02 Jan 1999 05:20 by A <a@example.com>
 |  @ Added «createrepo.zsh»
 |  
+{{{1 files (copies)
+o  Changeset 18:5b7ed139504a773cacfda7307e92cfba9a602d7f (branch default)
+|  Commited 10 Feb 2002 05:00 by A <a@example.com>
+|  @ Copied “hglines.lst” to “hglines2.lst”
+|  
+|\ 
+|\ \ 
+| | |\ 
+| | |\ \ 
+| | | | |/ 
+| +-----+ 
+| +-----+ 
+|\ \ \ \ 
+| |/ / / 
+| +---+ 
+|  / / 
+| |/ 
+|/ 
+o  Changeset 4:aa37b7dd6c397b16a77b1f405d49828aa6434bb2 (branch default)
+|  Commited 10 May 2000 04:23 by A <a@example.com>
+|  @ Added «hglines.lst» and «datelines.lst»
+|  
 {{{1 limit
 @  Changeset 22:54d2db605eec15091bb4b194499d6db40e2af027 (branch default)
 |  Commited 11 Feb 2002 05:43 by A <a@example.com>