gpg: move test of force before status call
authorMatt Mackall <mpm@selenic.com>
Thu, 02 Oct 2014 18:47:02 -0500
changeset 22682 9c89ac99690e
parent 22681 80b6919eb199
child 22683 f1872fdc1c3c
gpg: move test of force before status call
hgext/gpg.py
--- a/hgext/gpg.py	Wed Sep 24 12:57:39 2014 -0700
+++ b/hgext/gpg.py	Thu Oct 02 18:47:02 2014 -0500
@@ -253,12 +253,12 @@
         repo.opener.append("localsigs", sigmessage)
         return
 
-    msigs = match.exact(repo.root, '', ['.hgsigs'])
-    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 "
-                           "or use --force)"))
+    if not opts["force"]:
+        msigs = match.exact(repo.root, '', ['.hgsigs'])
+        if util.any(repo.status(match=msigs, unknown=True, ignored=True)):
+            raise util.Abort(_("working copy of .hgsigs is changed "
+                               "(please commit .hgsigs manually "
+                               "or use --force)"))
 
     sigsfile = repo.wfile(".hgsigs", "ab")
     sigsfile.write(sigmessage)