Commits

ZyX_I committed 3d825e3 Merge

Merge

  • Participants
  • Parent commits 87ebe7c, 4fe7438
  • Branches bzr-support

Comments (0)

Files changed (5)

autoload/aurum/drivers/common/utils.vim

 "▶1
 scriptencoding utf-8
-execute frawor#Setup('0.3', {'@/resources': '0.0',
+execute frawor#Setup('0.4', {'@/resources': '0.0',
             \                       '@/os': '0.2'})
 let s:utils={}
 "▶1 utils.kwargstostr :: kwargs → str
     endfunction
     let s:utils.using_ansi_esc_echo=0
 endif
+"▶1 utils.emptystatdct
+let s:utils.emptystatdct={
+            \'modified': [],
+            \   'added': [],
+            \ 'removed': [],
+            \ 'deleted': [],
+            \ 'unknown': [],
+            \ 'ignored': [],
+            \   'clean': [],
+        \}
 "▶1 nullnl :: [String] → [String]
 " Convert between lines (NL separated strings with NULLs represented as NLs) and 
 " NULL separated strings with NLs represented by NLs.

autoload/aurum/drivers/git.vim

 scriptencoding utf-8
 execute frawor#Setup('0.1', {'@%aurum/drivers/common/hypsites': '0.0',
             \                                   '@%aurum/repo': '5.0',
-            \                   '@%aurum/drivers/common/utils': '0.3',
+            \                   '@%aurum/drivers/common/utils': '0.4',
             \                                           '@/os': '0.1',
             \                                      '@/options': '0.0',})
 let s:_messages={
             \'M': 'modified',
             \'D': 'removed',
         \}
-let s:initstatdct={
-            \'modified': [],
-            \   'added': [],
-            \ 'removed': [],
-            \ 'deleted': [],
-            \ 'unknown': [],
-            \ 'ignored': [],
-            \   'clean': [],
-        \}
 function s:git.status(repo, ...)
-    let r=deepcopy(s:initstatdct)
+    let r=deepcopy(s:_r.utils.emptystatdct)
     let requiresclean=(a:0>3 && a:4)
     if a:0 && (a:1 isnot 0 || (a:0>1 && a:2 isnot 0))
         let args=((a:0>2 && !empty(a:3))?(['--']+a:3):([]))

autoload/aurum/drivers/mercurial.vim

 scriptencoding utf-8
 execute frawor#Setup('0.2', {'@%aurum/drivers/common/hypsites': '0.0',
             \                                   '@%aurum/repo': '5.0',
-            \                   '@%aurum/drivers/common/utils': '0.1',
+            \                   '@%aurum/drivers/common/utils': '0.4',
             \                                       '@/python': '0.0',
             \                                           '@/os': '0.0',
             \                                      '@/options': '0.0',})
             \'I': 'ignored',
             \'C': 'clean',
         \}
-let s:initstatdct={}
-call map(values(s:statchars), 'extend(s:initstatdct, {v:val : []})')
 " TODO test whether zero revision may cause bugs in some commands
 function s:hg.status(repo, ...)
     let args=[]
     if !empty(filter(copy(slines), '!has_key(s:statchars, v:val[0])'))
         call s:_f.throw('statfail', a:repo.path, join(slines, "\n"))
     endif
-    let r=deepcopy(s:initstatdct)
+    let r=deepcopy(s:_r.utils.emptystatdct)
     call map(copy(slines),'add(r[s:statchars[v:val[0]]],s:F.refile(v:val[2:]))')
     if reverse
         let [r.deleted, r.unknown]=[r.unknown, r.deleted]

autoload/aurum/drivers/subversion.vim

 scriptencoding utf-8
 execute frawor#Setup('0.1', {'@%aurum/drivers/common/hypsites': '0.0',
             \                                   '@%aurum/repo': '5.0',
-            \                   '@%aurum/drivers/common/utils': '0.0',
+            \                   '@%aurum/drivers/common/utils': '0.4',
             \                     '@%aurum/drivers/common/xml': '0.0',
             \                                           '@/os': '0.0',})
 let s:_messages={
             \'C': 'modified',
             \'M': 'modified',}]
 function s:F.status(repo, files)
-    let r=deepcopy(s:initstatdct)
+    let r=deepcopy(s:_r.utils.emptystatdct)
     let args=[]
     if !empty(a:files)
         let args+=['--']+a:files
 function s:F.statfromdiff(repo, diff, ofs, fs, files)
     "▶2 Initialize variables
     let diff=copy(a:diff)
-    let r=deepcopy(s:initstatdct)
+    let r=deepcopy(s:_r.utils.emptystatdct)
     let diffre=a:repo.functions.diffre(a:repo, {})
     let revstatus={}
     let file=0
     return r
 endfunction
 "▶1 svn.status :: repo[, rev1[, rev2[, files[, clean]]]]
-let s:initstatdct={
-            \'modified': [],
-            \   'added': [],
-            \ 'removed': [],
-            \ 'deleted': [],
-            \ 'unknown': [],
-            \ 'ignored': [],
-            \   'clean': [],
-        \}
 " TODO Try using diff --summarize
 function s:svn.status(repo, ...)
     let requiresclean=(a:0>3 && a:4)
     "▶2 Not so complicated case: cs and its parent or itself
     elseif a:0>1 && !empty(a:1) && !empty(a:2) && a:1.a:2!~#'\D' &&
                 \abs(a:1-a:2)<=1
-        let r=copy(s:initstatdct)
+        let r=copy(s:_r.utils.emptystatdct)
         if requiresclean
             let allfiles=copy(a:repo.functions.getcsprop(a:repo,a:1,'allfiles'))
             if a:0>2 && !empty(a:3)
     0.1: _r.utils.getcmd() now accepts kwargs key values 0 and [...]
     0.2: Added _r.utils.using_ansi_esc_echo
     0.3: Added _r.utils.nullnl and _r.utils.kwargstostr
+    0.4: Added _r.utils.emptystatdct
 
 vim: ft=help:tw=78