changeset 22922:ebef5fcf7bd0

shelve: access status fields by name rather than index
author Martin von Zweigbergk <martinvonz@gmail.com>
date Fri, 03 Oct 2014 22:12:43 -0700
parents 75e7d4a0f135
children 9e893247a41c
files hgext/shelve.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Fri Oct 03 10:44:07 2014 -0700
+++ b/hgext/shelve.py	Fri Oct 03 22:12:43 2014 -0700
@@ -230,9 +230,9 @@
 
         if not node:
             stat = repo.status(match=scmutil.match(repo[None], pats, opts))
-            if stat[3]:
+            if stat.deleted:
                 ui.status(_("nothing changed (%d missing files, see "
-                            "'hg status')\n") % len(stat[3]))
+                            "'hg status')\n") % len(stat.deleted))
             else:
                 ui.status(_("nothing changed\n"))
             return 1
@@ -404,7 +404,7 @@
         files.extend(shelvectx.parents()[0].files())
 
         # revert will overwrite unknown files, so move them out of the way
-        for file in repo.status(unknown=True)[4]:
+        for file in repo.status(unknown=True).unknown:
             if file in files:
                 util.rename(file, file + ".orig")
         ui.pushbuffer(True)
@@ -550,8 +550,8 @@
         # to the original pctx.
 
         # Store pending changes in a commit
-        m, a, r, d = repo.status()[:4]
-        if m or a or r or d:
+        s = repo.status()
+        if s.modified or s.added or s.removed or s.deleted:
             ui.status(_("temporarily committing pending changes "
                         "(restore with 'hg unshelve --abort')\n"))
             def commitfunc(ui, repo, message, match, opts):