mercurial/localrepo.py
changeset 41363 b87a009d1b3b
parent 41362 57c462db87fd
child 41364 0132221c25cd
equal deleted inserted replaced
41362:57c462db87fd 41363:b87a009d1b3b
  2407         if not force:
  2407         if not force:
  2408             vdirs = []
  2408             vdirs = []
  2409             match.explicitdir = vdirs.append
  2409             match.explicitdir = vdirs.append
  2410             match.bad = fail
  2410             match.bad = fail
  2411 
  2411 
  2412         wlock = lock = None
  2412         # lock() for recent changelog (see issue4368)
  2413         try:
  2413         with self.wlock(), self.lock():
  2414             wlock = self.wlock()
       
  2415             lock = self.lock() # for recent changelog (see issue4368)
       
  2416 
       
  2417             wctx = self[None]
  2414             wctx = self[None]
  2418             merge = len(wctx.parents()) > 1
  2415             merge = len(wctx.parents()) > 1
  2419 
  2416 
  2420             if not force and merge and not match.always():
  2417             if not force and merge and not match.always():
  2421                 raise error.Abort(_('cannot partially commit a merge '
  2418                 raise error.Abort(_('cannot partially commit a merge '
  2482             except: # re-raises
  2479             except: # re-raises
  2483                 if edited:
  2480                 if edited:
  2484                     self.ui.write(
  2481                     self.ui.write(
  2485                         _('note: commit message saved in %s\n') % msgfn)
  2482                         _('note: commit message saved in %s\n') % msgfn)
  2486                 raise
  2483                 raise
  2487 
       
  2488         finally:
       
  2489             lockmod.release(lock, wlock)
       
  2490 
  2484 
  2491         def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
  2485         def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
  2492             # hack for command that use a temporary commit (eg: histedit)
  2486             # hack for command that use a temporary commit (eg: histedit)
  2493             # temporary commit got stripped before hook release
  2487             # temporary commit got stripped before hook release
  2494             if self.changelog.hasnode(ret):
  2488             if self.changelog.hasnode(ret):