hgext/histedit.py
branchstable
changeset 20071 4778f398ec83
parent 19972 1e13a5a9c66e
child 20503 23dc77874191
child 20770 5d22cadd1938
equal deleted inserted replaced
20070:509717d0d517 20071:4778f398ec83
   157 from mercurial import repair
   157 from mercurial import repair
   158 from mercurial import scmutil
   158 from mercurial import scmutil
   159 from mercurial import util
   159 from mercurial import util
   160 from mercurial import obsolete
   160 from mercurial import obsolete
   161 from mercurial import merge as mergemod
   161 from mercurial import merge as mergemod
       
   162 from mercurial.lock import release
   162 from mercurial.i18n import _
   163 from mercurial.i18n import _
   163 
   164 
   164 cmdtable = {}
   165 cmdtable = {}
   165 command = cmdutil.command(cmdtable)
   166 command = cmdutil.command(cmdtable)
   166 
   167 
   474 
   475 
   475     Returns 0 on success, 1 if user intervention is required (not only
   476     Returns 0 on success, 1 if user intervention is required (not only
   476     for intentional "edit" command, but also for resolving unexpected
   477     for intentional "edit" command, but also for resolving unexpected
   477     conflicts).
   478     conflicts).
   478     """
   479     """
       
   480     lock = wlock = None
       
   481     try:
       
   482         wlock = repo.wlock()
       
   483         lock = repo.lock()
       
   484         _histedit(ui, repo, *freeargs, **opts)
       
   485     finally:
       
   486         release(lock, wlock)
       
   487 
       
   488 def _histedit(ui, repo, *freeargs, **opts):
   479     # TODO only abort if we try and histedit mq patches, not just
   489     # TODO only abort if we try and histedit mq patches, not just
   480     # blanket if mq patches are applied somewhere
   490     # blanket if mq patches are applied somewhere
   481     mq = getattr(repo, 'mq', None)
   491     mq = getattr(repo, 'mq', None)
   482     if mq and mq.applied:
   492     if mq and mq.applied:
   483         raise util.Abort(_('source has mq patches applied'))
   493         raise util.Abort(_('source has mq patches applied'))