##// END OF EJS Templates
gpg: do not call status on the whole repository, only on '.hgsigs'
Benoit Boissinot -
r10517:13448eab stable
parent child Browse files
Show More
@@ -6,7 +6,7 b''
6 '''commands to sign and verify changesets'''
6 '''commands to sign and verify changesets'''
7
7
8 import os, tempfile, binascii
8 import os, tempfile, binascii
9 from mercurial import util, commands, match
9 from mercurial import util, commands, match, cmdutil
10 from mercurial import node as hgnode
10 from mercurial import node as hgnode
11 from mercurial.i18n import _
11 from mercurial.i18n import _
12
12
@@ -237,11 +237,12 b' def sign(ui, repo, *revs, **opts):'
237 repo.opener("localsigs", "ab").write(sigmessage)
237 repo.opener("localsigs", "ab").write(sigmessage)
238 return
238 return
239
239
240 for x in repo.status(unknown=True)[:5]:
240 msigs = cmdutil.matchfiles(repo, ['.hgsigs'])
241 if ".hgsigs" in x and not opts["force"]:
241 s = repo.status(match=msigs, unknown=True, ignored=True)[:6]
242 raise util.Abort(_("working copy of .hgsigs is changed "
242 if util.any(s) and not opts["force"]:
243 "(please commit .hgsigs manually "
243 raise util.Abort(_("working copy of .hgsigs is changed "
244 "or use --force)"))
244 "(please commit .hgsigs manually "
245 "or use --force)"))
245
246
246 repo.wfile(".hgsigs", "ab").write(sigmessage)
247 repo.wfile(".hgsigs", "ab").write(sigmessage)
247
248
@@ -258,8 +259,7 b' def sign(ui, repo, *revs, **opts):'
258 % hgnode.short(n)
259 % hgnode.short(n)
259 for n in nodes])
260 for n in nodes])
260 try:
261 try:
261 m = match.exact(repo.root, '', ['.hgsigs'])
262 repo.commit(message, opts['user'], opts['date'], match=msigs)
262 repo.commit(message, opts['user'], opts['date'], match=m)
263 except ValueError, inst:
263 except ValueError, inst:
264 raise util.Abort(str(inst))
264 raise util.Abort(str(inst))
265
265
General Comments 0
You need to be logged in to leave comments. Login now