hgext/gpg.py
changeset 50878 bbaac3a222bb
parent 50877 b3ac579bde41
equal deleted inserted replaced
50877:b3ac579bde41 50878:bbaac3a222bb
   346             raise error.Abort(
   346             raise error.Abort(
   347                 _(b"working copy of .hgsigs is changed "),
   347                 _(b"working copy of .hgsigs is changed "),
   348                 hint=_(b"please commit .hgsigs manually"),
   348                 hint=_(b"please commit .hgsigs manually"),
   349             )
   349             )
   350 
   350 
   351     sigsfile = repo.wvfs(b".hgsigs", b"ab")
   351     with repo.wvfs(b".hgsigs", b"ab") as sigsfile:
   352     sigsfile.write(sigmessage)
   352         sigsfile.write(sigmessage)
   353     sigsfile.close()
       
   354 
   353 
   355     if b'.hgsigs' not in repo.dirstate:
   354     if b'.hgsigs' not in repo.dirstate:
   356         with repo.dirstate.changing_files(repo):
   355         with repo.dirstate.changing_files(repo):
   357             repo[None].add([b".hgsigs"])
   356             repo[None].add([b".hgsigs"])
   358 
   357