diff --git a/hgext/gpg.py b/hgext/gpg.py --- a/hgext/gpg.py +++ b/hgext/gpg.py @@ -339,8 +339,9 @@ def _dosign(ui, repo, *revs, **opts): repo.vfs.append(b"localsigs", sigmessage) return + msigs = match.exact([b'.hgsigs']) + if not opts[b"force"]: - msigs = match.exact([b'.hgsigs']) if any(repo.status(match=msigs, unknown=True, ignored=True)): raise error.Abort( _(b"working copy of .hgsigs is changed "), diff --git a/tests/test-gpg.t b/tests/test-gpg.t --- a/tests/test-gpg.t +++ b/tests/test-gpg.t @@ -54,4 +54,21 @@ and migrate secret keys e63c23eaa88a is signed by: hgtest +The signature is different each time, so avoid signing the previous signature so +that the cset hashes are unchanging. + $ hg up -q '.^' + + $ HGEDITOR=cat hg sign -f -e . + gpg: error retrieving key fingerprint from card: Invalid name (?) + signing 0:e63c23eaa88a + Added signature for changeset e63c23eaa88a + + + HG: Enter commit message. Lines beginning with 'HG:' are removed. + HG: Leave message empty to abort commit. + HG: -- + HG: user: test + HG: branch 'default' + HG: added .hgsigs + $ cd ..