mercurial/patch.py
changeset 26558 fe52cd049f01
parent 26557 23f3f1cbd53b
child 26559 dbd4392daedf
equal deleted inserted replaced
26557:23f3f1cbd53b 26558:fe52cd049f01
   151     # if we are here, we have a very plain patch
   151     # if we are here, we have a very plain patch
   152     return remainder(cur)
   152     return remainder(cur)
   153 
   153 
   154 ## Some facility for extensible patch parsing:
   154 ## Some facility for extensible patch parsing:
   155 # list of pairs ("header to match", "data key")
   155 # list of pairs ("header to match", "data key")
   156 patchheadermap = []
   156 patchheadermap = [('Date', 'date')]
   157 
   157 
   158 def extract(ui, fileobj):
   158 def extract(ui, fileobj):
   159     '''extract patch from data read from fileobj.
   159     '''extract patch from data read from fileobj.
   160 
   160 
   161     patch can be a normal patch or contained in an email message.
   161     patch can be a normal patch or contained in an email message.
   232                         subject = None
   232                         subject = None
   233                     elif hgpatchheader:
   233                     elif hgpatchheader:
   234                         if line.startswith('# User '):
   234                         if line.startswith('# User '):
   235                             data['user'] = line[7:]
   235                             data['user'] = line[7:]
   236                             ui.debug('From: %s\n' % data['user'])
   236                             ui.debug('From: %s\n' % data['user'])
   237                         elif line.startswith("# Date "):
       
   238                             data['date'] = line[7:]
       
   239                         elif line.startswith("# Branch "):
   237                         elif line.startswith("# Branch "):
   240                             data['branch'] = line[9:]
   238                             data['branch'] = line[9:]
   241                         elif line.startswith("# Node ID "):
   239                         elif line.startswith("# Node ID "):
   242                             data['nodeid'] = line[10:]
   240                             data['nodeid'] = line[10:]
   243                         elif line.startswith("# Parent "):
   241                         elif line.startswith("# Parent "):