comparison hgext/gpg.py @ 22682:9c89ac99690e

gpg: move test of force before status call
author Matt Mackall <mpm@selenic.com>
date Thu, 02 Oct 2014 18:47:02 -0500
parents 80b6919eb199
children f1872fdc1c3c
comparison
equal deleted inserted replaced
22681:80b6919eb199 22682:9c89ac99690e
251 # write it 251 # write it
252 if opts['local']: 252 if opts['local']:
253 repo.opener.append("localsigs", sigmessage) 253 repo.opener.append("localsigs", sigmessage)
254 return 254 return
255 255
256 msigs = match.exact(repo.root, '', ['.hgsigs']) 256 if not opts["force"]:
257 s = repo.status(match=msigs, unknown=True, ignored=True) 257 msigs = match.exact(repo.root, '', ['.hgsigs'])
258 if util.any(s) and not opts["force"]: 258 if util.any(repo.status(match=msigs, unknown=True, ignored=True)):
259 raise util.Abort(_("working copy of .hgsigs is changed " 259 raise util.Abort(_("working copy of .hgsigs is changed "
260 "(please commit .hgsigs manually " 260 "(please commit .hgsigs manually "
261 "or use --force)")) 261 "or use --force)"))
262 262
263 sigsfile = repo.wfile(".hgsigs", "ab") 263 sigsfile = repo.wfile(".hgsigs", "ab")
264 sigsfile.write(sigmessage) 264 sigsfile.write(sigmessage)
265 sigsfile.close() 265 sigsfile.close()
266 266