mercurial/cmdutil.py
changeset 31457 707f9fd2dcad
parent 31451 53865692a354
child 31486 06d3c40fc3e7
equal deleted inserted replaced
31456:2545ee88a57e 31457:707f9fd2dcad
   969                 editform = mergeeditform(repo[None], 'import.normal')
   969                 editform = mergeeditform(repo[None], 'import.normal')
   970                 if opts.get('exact'):
   970                 if opts.get('exact'):
   971                     editor = None
   971                     editor = None
   972                 else:
   972                 else:
   973                     editor = getcommiteditor(editform=editform, **opts)
   973                     editor = getcommiteditor(editform=editform, **opts)
   974                 allowemptyback = repo.ui.backupconfig('ui', 'allowemptycommit')
       
   975                 extra = {}
   974                 extra = {}
   976                 for idfunc in extrapreimport:
   975                 for idfunc in extrapreimport:
   977                     extrapreimportmap[idfunc](repo, extractdata, extra, opts)
   976                     extrapreimportmap[idfunc](repo, extractdata, extra, opts)
   978                 try:
   977                 overrides = {}
   979                     if partial:
   978                 if partial:
   980                         repo.ui.setconfig('ui', 'allowemptycommit', True)
   979                     overrides[('ui', 'allowemptycommit')] = True
       
   980                 with repo.ui.configoverride(overrides, 'import'):
   981                     n = repo.commit(message, user,
   981                     n = repo.commit(message, user,
   982                                     date, match=m,
   982                                     date, match=m,
   983                                     editor=editor, extra=extra)
   983                                     editor=editor, extra=extra)
   984                     for idfunc in extrapostimport:
   984                     for idfunc in extrapostimport:
   985                         extrapostimportmap[idfunc](repo[n])
   985                         extrapostimportmap[idfunc](repo[n])
   986                 finally:
       
   987                     repo.ui.restoreconfig(allowemptyback)
       
   988         else:
   986         else:
   989             if opts.get('exact') or importbranch:
   987             if opts.get('exact') or importbranch:
   990                 branch = branch or 'default'
   988                 branch = branch or 'default'
   991             else:
   989             else:
   992                 branch = p1.branch()
   990                 branch = p1.branch()