1. nick brown
  2. aurum


ZyX_I  committed 211cde6

@aurum: Fixed error in findfiles()
Made :AuMove throw an error if no files are moved
tests: Added cmd-move,track,junk-subdir test
Fixed #13

  • Participants
  • Parent commits 91b4f7a
  • Branches default
  • Tags release-1.4.3

Comments (0)

Files changed (4)

File plugin/aurum.vim

View file
             \ 'nunsup': 'Naming is not supported for repository %s',
             \'ukntype': 'Unknown label type: %s. Supported types: %s',
             \   'ldef': 'Label %s with type %s was alredy defined',
+            \   'nomv': 'No movable files found',
             \'_mvheader': ['Source', 'Destination'],
 let s:utypes=['html', 'raw', 'annotate', 'filehist', 'bundle', 'changeset',
         let d[fsplit[-1]]=1
-    unlet d
+    unlet! d
     let patterns=map(copy(a:globs), 's:_r.globtopat('.
                 \                   'a:repo.functions.reltorepo(a:repo,v:val))')
     let tocheck=map(items(dirs), '[v:val[1], v:val[0]]')
             let moves[file]=dest
+    if empty(moves)
+        call s:_f.throw('nomv')
+    endif
     if get(a:opts, 'pretend', 0)
         call s:_r.printtable(items(moves), {'header': s:_messages._mvheader})

File test/cmd-move,track,junk-subdir.in

View file
+:command -bar CS :execute 'Run AuStatus' | bwipeout!
+:command -bar WTax :WTA template g:template showfiles showrenames showcopies
+:command -nargs=1 SR :R silent <args>
+:let g:subdir='directory/subdir'
+:let g:template="$rev\n*$changes\n@$description\n>$renames\n+$copies"
+:W{{{1 Track directory
+:R call mkdir(g:subdir)
+:R call writefile(['Dummy string'], g:subdir.'/subfile')
+:R call writefile(['Second dummy string'], g:subdir.'/subfile2')
+:SR AuTrack directory/
+:SR AuCommit message Added\ directory/subdir/subfile{,2} **
+:W{{{1 Move directory to unexistent directory
+:SR AuMove directory/ unexistentdir/
+:SR AuCommit message Moved\ directory/\ to\ unexistentdir/ **
+:W{{{1 Move directory to an existing directory
+:R call mkdir(g:subdir, 'p')
+:R call writefile(['Dummy string'], g:subdir.'/subfile')
+:SR AuTrack directory/
+:SR AuCommit message Recreated\ directory/subdir/subfile **
+:SR AuMove unexistentdir directory
+:SR AuCommit message Moved\ unexistentdir to\ directory **
+:W{{{1 Junk directory
+:SR AuJunk directory
+:SR AuCommit message Removed\ directory **
+:source addmessages.vim

File test/cmd-move,track,junk-subdir.ok

View file
+{{{1 Track directory
+A directory/subdir/subfile
+A directory/subdir/subfile2
+@  27
+|  *directory/subdir/subfile, directory/subdir/subfile2
+{{{1 Move directory to unexistent directory
+A unexistentdir/file
+A unexistentdir/subdir/subfile
+A unexistentdir/subdir/subfile2
+R directory/file
+R directory/subdir/subfile
+R directory/subdir/subfile2
+@  28
+|  *directory/file, directory/subdir/subfile, directory/subdir/subfile2
+|  *unexistentdir/file, unexistentdir/subdir/subfile
+|  *unexistentdir/subdir/subfile2
+|  @Moved directory/ to unexistentdir/
+|  >directory/file to unexistentdir/file
+|  >directory/subdir/subfile2 to unexistentdir/subdir/subfile2
+{{{1 Move directory to an existing directory
+@  29
+|  *directory/subdir/subfile
+A directory/unexistentdir/file
+A directory/unexistentdir/subdir/subfile
+A directory/unexistentdir/subdir/subfile2
+R unexistentdir/file
+R unexistentdir/subdir/subfile
+R unexistentdir/subdir/subfile2
+@  30
+|  *directory/unexistentdir/file, directory/unexistentdir/subdir/subfile
+|  *directory/unexistentdir/subdir/subfile2, unexistentdir/file
+|  *unexistentdir/subdir/subfile, unexistentdir/subdir/subfile2
+|  @Moved unexistentdir
+|  >unexistentdir/file to directory/unexistentdir/file
+|  >unexistentdir/subdir/subfile to directory/unexistentdir/subdir/subfile
+{{{1 Junk directory
+R directory/subdir/subfile
+R directory/unexistentdir/file
+R directory/unexistentdir/subdir/subfile
+R directory/unexistentdir/subdir/subfile2
+@  31
+|  *directory/subdir/subfile, directory/unexistentdir/file
+|  *directory/unexistentdir/subdir/subfile
+|  *directory/unexistentdir/subdir/subfile2

File test/vimrc

View file
     let tipname=get(g:, 'tipname', 'tip')
     execute 'R AuLog limit 1 revision '.tipname.' '.a:addargs
     setlocal modifiable noreadonly
-    if !a:writecom
-        g/Commited/delete _
+    if a:writecom!=2
+        if !a:writecom
+            g/Commited/delete _
+        endif
+        normal! gg0f:"_de
-    normal! gg0f:"_de
     if !empty(a:cmd)
         execute a:cmd
 command -nargs=? -bar -bang WT  :call s:WriteTip(<bang>0, <q-args>, '')
 command -nargs=1 -bar -bang WTa :call s:WriteTip(<bang>0, '', <q-args>)
+command -nargs=1 -bar       WTA :call s:WriteTip(      2, '', <q-args>)
 function s:WriteWindows()
     let wcur=winnr()
     let wprev=winnr('#')