# HG changeset patch # User Matt Mackall # Date 1412293622 18000 # Node ID 9c89ac99690e42c2e51438eb85e9f8d4fea8cf1e # Parent 80b6919eb199b2f891aec4f80ba5474e31e97941 gpg: move test of force before status call diff -r 80b6919eb199 -r 9c89ac99690e 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)