Patchwork [4,of,8] gpg: drop unnecessary slicing of status array

login
register
mail settings
Submitter Martin von Zweigbergk
Date Oct. 2, 2014, 12:01 a.m.
Message ID <e78e91806185683b1bc8.1412208116@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6074/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Oct. 2, 2014, 12:01 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@gmail.com>
# Date 1411588659 25200
#      Wed Sep 24 12:57:39 2014 -0700
# Node ID e78e91806185683b1bc8814556a71bf66abcd7a1
# Parent  e1154b545f8411371124e7c24fd7e3f67c11dcba
gpg: drop unnecessary slicing of status array

The call to repo.status() does not request status for clean files, so
there is no reason to slice it out from the result. Leaving the tuple
untouched will simplify a future change.

Patch

diff --git a/hgext/gpg.py b/hgext/gpg.py
--- a/hgext/gpg.py
+++ b/hgext/gpg.py
@@ -254,7 +254,7 @@ 
         return
 
     msigs = match.exact(repo.root, '', ['.hgsigs'])
-    s = repo.status(match=msigs, unknown=True, ignored=True)[:6]
+    s = repo.status(match=msigs, unknown=True, ignored=True)
     if util.any(s) and not opts["force"]:
         raise util.Abort(_("working copy of .hgsigs is changed "
                            "(please commit .hgsigs manually "