# HG changeset patch # User Martin von Zweigbergk # Date 1412399563 25200 # Node ID ebef5fcf7bd0d5306af18e281b02d9c7d61d49e4 # Parent 75e7d4a0f1351febbde71319c66fa28a7afa1c88 shelve: access status fields by name rather than index diff -r 75e7d4a0f135 -r ebef5fcf7bd0 hgext/shelve.py --- 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):