hgext/phabricator.py
changeset 48873 5aafc3c5bdec
parent 48116 5ced12cfa41b
child 48875 6000f5b25c9b
equal deleted inserted replaced
48872:968b29a5a7fc 48873:5aafc3c5bdec
    60 from __future__ import absolute_import
    60 from __future__ import absolute_import
    61 
    61 
    62 import base64
    62 import base64
    63 import contextlib
    63 import contextlib
    64 import hashlib
    64 import hashlib
       
    65 import io
    65 import itertools
    66 import itertools
    66 import json
    67 import json
    67 import mimetypes
    68 import mimetypes
    68 import operator
    69 import operator
    69 import re
    70 import re
  2198 
  2199 
  2199         with repo.wlock(), repo.lock(), repo.transaction(b'phabimport'):
  2200         with repo.wlock(), repo.lock(), repo.transaction(b'phabimport'):
  2200             for drev, contents in patches:
  2201             for drev, contents in patches:
  2201                 ui.status(_(b'applying patch from D%s\n') % drev)
  2202                 ui.status(_(b'applying patch from D%s\n') % drev)
  2202 
  2203 
  2203                 with patch.extract(ui, pycompat.bytesio(contents)) as patchdata:
  2204                 with patch.extract(ui, io.BytesIO(contents)) as patchdata:
  2204                     msg, node, rej = cmdutil.tryimportone(
  2205                     msg, node, rej = cmdutil.tryimportone(
  2205                         ui,
  2206                         ui,
  2206                         repo,
  2207                         repo,
  2207                         patchdata,
  2208                         patchdata,
  2208                         parents,
  2209                         parents,