diff hglib/client.py @ 34:f6e1d9a6e0cd

client: change return value of status() to a list of (code, file path)
author Idan Kamara <idankk86@gmail.com>
date Sun, 14 Aug 2011 00:51:15 +0300
parents d74a5891d9d1
children 1e33bbea23e5
line wrap: on
line diff
--- a/hglib/client.py	Sun Aug 14 00:49:56 2011 +0300
+++ b/hglib/client.py	Sun Aug 14 00:51:15 2011 +0300
@@ -521,7 +521,7 @@
                ignored=False, copies=False, subrepos=False, include=None,
                exclude=None):
         """
-        Return a dictionary with the following keys:
+        Return a list of (code, file path) where code can be:
 
                 M = modified
                 A = added
@@ -531,8 +531,6 @@
                 ? = untracked
                 I = ignored
                   = origin of the previous file listed as A (added)
-
-        And a list of files to match as values.
         """
         if rev and change:
             raise ValueError('cannot specify both rev and change')
@@ -544,14 +542,13 @@
         args.append('-0')
 
         out = self.rawcommand(args)
-        d = dict((c, []) for c in 'MARC!?I')
+        l = []
 
         for entry in out.split('\0'):
             if entry:
-                t, f = entry.split(' ', 1)
-                d[t].append(f)
+                l.append(tuple(entry.rsplit(' ', 1)))
 
-        return d
+        return l
 
     def tip(self):
         args = cmdbuilder('tip', template=templates.changeset)