diff --git a/hgext/gpg.py b/hgext/gpg.py --- a/hgext/gpg.py +++ b/hgext/gpg.py @@ -240,7 +240,7 @@ def sign(ui, repo, *revs, **opts): repo.wfile(".hgsigs", "ab").write(sigmessage) - if repo.dirstate.state(".hgsigs") == '?': + if '.hgsigs' not in repo.dirstate: repo.add([".hgsigs"]) if opts["no_commit"]: