hgext/mq.py
changeset 4887 bbdcacf7cef8
parent 4852 cba10652a901
child 4915 8535c1770dd3
child 4948 6fd953d5faea
equal deleted inserted replaced
4886:2f09df302f30 4887:bbdcacf7cef8
   907         top = revlog.bin(top)
   907         top = revlog.bin(top)
   908         cparents = repo.changelog.parents(top)
   908         cparents = repo.changelog.parents(top)
   909         patchparent = self.qparents(repo, top)
   909         patchparent = self.qparents(repo, top)
   910         message, comments, user, date, patchfound = self.readheaders(patchfn)
   910         message, comments, user, date, patchfound = self.readheaders(patchfn)
   911 
   911 
   912         patchf = self.opener(patchfn, "w")
   912         patchf = self.opener(patchfn, 'r+')
       
   913 
       
   914         # if the patch was a git patch, refresh it as a git patch
       
   915         for line in patchf:
       
   916             if line.startswith('diff --git'):
       
   917                 self.diffopts().git = True
       
   918                 break
       
   919         patchf.seek(0)
       
   920         patchf.truncate()
       
   921 
   913         msg = opts.get('msg', '').rstrip()
   922         msg = opts.get('msg', '').rstrip()
   914         if msg:
   923         if msg:
   915             if comments:
   924             if comments:
   916                 # Remove existing message.
   925                 # Remove existing message.
   917                 ci = 0
   926                 ci = 0