From patchwork Sun Oct 12 05:44:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [11,of,17,V4] shelve: access status fields by name rather than index From: Martin von Zweigbergk X-Patchwork-Id: 6227 Message-Id: <4ced5d6b3923d2f12d8c.1413092668@handduk2.mtv.corp.google.com> To: mercurial-devel@selenic.com Date: Sat, 11 Oct 2014 22:44:28 -0700 # HG changeset patch # User Martin von Zweigbergk # Date 1412399563 25200 # Fri Oct 03 22:12:43 2014 -0700 # Node ID 4ced5d6b3923d2f12d8c2c88c9b9c126bd854dfd # Parent 3ba27b307317eb4309c81d207bebb3d63a685483 shelve: access status fields by name rather than index diff --git a/hgext/shelve.py b/hgext/shelve.py --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -227,9 +227,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 @@ -401,7 +401,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) @@ -547,8 +547,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):