Source

aurum / python / aurum / rcdriverfuncs.py

Diff from to

python/aurum/rcdriverfuncs.py

-from aurum.utils import readlines
-from copy import deepcopy
+from aurum.utils   import readlines
+from aurum.auutils import emptystatdct
 
 hgstatchars={
     'M': 'modified',
     'I': 'ignored',
     'C': 'clean',
 }
-emptystatdct={
-    'modified': [],
-    'added'   : [],
-    'removed' : [],
-    'deleted' : [],
-    'unknown' : [],
-    'ignored' : [],
-    'clean'   : [],
-}
 
 def hg_status(path, args, reverse=False):
-    r=deepcopy(emptystatdct)
-    for line in readlines(['hg']+args, cwd=path):
+    r=emptystatdct()
+    for line in readlines(['hg', 'status']+args, cwd=path):
         r[hgstatchars[line[0]]].append(line[2:])
     if reverse:
         r['deleted'], r['unknown'] = r['unknown'], r['deleted']
     return readlines(['hg', 'branch'], cwd=path).next()
 
 def git_status(path, fname):
-    r=deepcopy(emptystatdct)
+    r=emptystatdct()
     try:
         line=readlines(['git', 'status', '--porcelain', '--', fname],
                        cwd=path).next()
     },
 ]
 def svn_status(path, fname):
-    r=deepcopy(emptystatdct)
+    r=emptystatdct()
     try:
         line=readlines(['svn', 'status', '--', fname], cwd=path).next()
         status=line[:7]
 }
 
 def bzr_status(path, fname):
-    r=deepcopy(emptystatdct)
+    r=emptystatdct()
     try:
         line=readlines(['bzr', 'status', '--', fname], cwd=path).next()
         if line[-1] != ':':