hgext/mq.py
changeset 34138 0f9936d80e01
parent 34137 a8994d08e4a2
child 34181 62490b84ebf8
equal deleted inserted replaced
34137:a8994d08e4a2 34138:0f9936d80e01
   153     }
   153     }
   154 
   154 
   155 def inserthgheader(lines, header, value):
   155 def inserthgheader(lines, header, value):
   156     """Assuming lines contains a HG patch header, add a header line with value.
   156     """Assuming lines contains a HG patch header, add a header line with value.
   157     >>> try: inserthgheader([], b'# Date ', b'z')
   157     >>> try: inserthgheader([], b'# Date ', b'z')
   158     ... except ValueError, inst: print("oops")
   158     ... except ValueError as inst: print("oops")
   159     oops
   159     oops
   160     >>> inserthgheader([b'# HG changeset patch'], b'# Date ', b'z')
   160     >>> inserthgheader([b'# HG changeset patch'], b'# Date ', b'z')
   161     ['# HG changeset patch', '# Date z']
   161     ['# HG changeset patch', '# Date z']
   162     >>> inserthgheader([b'# HG changeset patch', b''], b'# Date ', b'z')
   162     >>> inserthgheader([b'# HG changeset patch', b''], b'# Date ', b'z')
   163     ['# HG changeset patch', '# Date z', '']
   163     ['# HG changeset patch', '# Date z', '']