changeset 22914:c95db3208a33

status: update various other methods to return new class
author Martin von Zweigbergk <martinvonz@gmail.com>
date Tue, 14 Oct 2014 00:52:27 -0500
parents cb4449921a1d
children 4d680deb0d9e
files hgext/largefiles/overrides.py hgext/largefiles/reposetup.py mercurial/context.py mercurial/subrepo.py tests/test-context.py.out
diffstat 5 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Fri Oct 10 14:32:36 2014 -0700
+++ b/hgext/largefiles/overrides.py	Tue Oct 14 00:52:27 2014 -0500
@@ -1149,7 +1149,8 @@
         modified, added, removed, deleted, unknown, ignored, clean = r
         unknown = [f for f in unknown if lfdirstate[f] == '?']
         ignored = [f for f in ignored if lfdirstate[f] == '?']
-        return modified, added, removed, deleted, unknown, ignored, clean
+        return scmutil.status(modified, added, removed, deleted,
+                              unknown, ignored, clean)
     repo.status = overridestatus
     orig(ui, repo, *dirs, **opts)
     repo.status = oldstatus
--- a/hgext/largefiles/reposetup.py	Fri Oct 10 14:32:36 2014 -0700
+++ b/hgext/largefiles/reposetup.py	Tue Oct 14 00:52:27 2014 -0500
@@ -12,7 +12,7 @@
 
 from mercurial import error, manifest, match as match_, util
 from mercurial.i18n import _
-from mercurial import localrepo
+from mercurial import localrepo, scmutil
 
 import lfcommands
 import lfutil
@@ -242,7 +242,7 @@
                     wlock.release()
 
             self.lfstatus = True
-            return result
+            return scmutil.status(*result)
 
         # As part of committing, copy all of the largefiles into the
         # cache.
--- a/mercurial/context.py	Fri Oct 10 14:32:36 2014 -0700
+++ b/mercurial/context.py	Tue Oct 14 00:52:27 2014 -0500
@@ -341,7 +341,7 @@
             l.sort()
 
         # we return a tuple to signify that this list isn't changing
-        return tuple(r)
+        return scmutil.status(*r)
 
 
 def makememctx(repo, parents, text, user, date, branch, files, store,
@@ -1482,7 +1482,7 @@
         # (s[1] is 'added' and s[2] is 'removed')
         s = list(s)
         s[1], s[2] = s[2], s[1]
-        return tuple(s)
+        return scmutil.status(*s)
 
 class committablefilectx(basefilectx):
     """A committablefilectx provides common functionality for a file context
--- a/mercurial/subrepo.py	Fri Oct 10 14:32:36 2014 -0700
+++ b/mercurial/subrepo.py	Tue Oct 14 00:52:27 2014 -0500
@@ -9,7 +9,7 @@
 import xml.dom.minidom
 import stat, subprocess, tarfile
 from i18n import _
-import config, util, node, error, cmdutil, match as matchmod
+import config, util, node, error, cmdutil, scmutil, match as matchmod
 import phases
 import pathutil
 import exchange
@@ -448,7 +448,7 @@
         return 1
 
     def status(self, rev2, **opts):
-        return [], [], [], [], [], [], []
+        return scmutil.status([], [], [], [], [], [], [])
 
     def diff(self, ui, diffopts, node2, match, prefix, **opts):
         pass
@@ -650,7 +650,7 @@
         except error.RepoLookupError, inst:
             self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
                                % (inst, subrelpath(self)))
-            return [], [], [], [], [], [], []
+            return scmutil.status([], [], [], [], [], [], [])
 
     @annotatesubrepoerror
     def diff(self, ui, diffopts, node2, match, prefix, **opts):
@@ -1583,7 +1583,8 @@
                 removed.append(f)
 
         deleted = unknown = ignored = clean = []
-        return modified, added, removed, deleted, unknown, ignored, clean
+        return scmutil.status(modified, added, removed, deleted,
+                              unknown, ignored, clean)
 
     def shortid(self, revid):
         return revid[:7]
--- a/tests/test-context.py.out	Fri Oct 10 14:32:36 2014 -0700
+++ b/tests/test-context.py.out	Tue Oct 14 00:52:27 2014 -0500
@@ -2,7 +2,7 @@
 ASCII   : Gr?ezi!
 Latin-1 : Grüezi!
 UTF-8   : Grüezi!
-(['foo'], [], [], [], [], [], [])
+<status modified=['foo'], added=[], removed=[], deleted=[], unknown=[], ignored=[], clean=[]>
 diff --git a/foo b/foo
 
 --- a/foo