mercurial/localrepo.py
changeset 41364 0132221c25cd
parent 41363 b87a009d1b3b
child 41365 876494fd967d
equal deleted inserted replaced
41363:b87a009d1b3b 41364:0132221c25cd
  2500         modified/added/removed files. On merge, it may be wider than the
  2500         modified/added/removed files. On merge, it may be wider than the
  2501         ctx.files() to be committed, since any file nodes derived directly
  2501         ctx.files() to be committed, since any file nodes derived directly
  2502         from p1 or p2 are excluded from the committed ctx.files().
  2502         from p1 or p2 are excluded from the committed ctx.files().
  2503         """
  2503         """
  2504 
  2504 
  2505         tr = None
       
  2506         p1, p2 = ctx.p1(), ctx.p2()
  2505         p1, p2 = ctx.p1(), ctx.p2()
  2507         user = ctx.user()
  2506         user = ctx.user()
  2508 
  2507 
  2509         lock = self.lock()
  2508         with self.lock(), self.transaction("commit") as tr:
  2510         try:
       
  2511             tr = self.transaction("commit")
       
  2512             trp = weakref.proxy(tr)
  2509             trp = weakref.proxy(tr)
  2513 
  2510 
  2514             if ctx.manifestnode():
  2511             if ctx.manifestnode():
  2515                 # reuse an existing manifest revision
  2512                 # reuse an existing manifest revision
  2516                 self.ui.debug('reusing known manifest\n')
  2513                 self.ui.debug('reusing known manifest\n')
  2603                 # if a parent have higher the resulting phase will
  2600                 # if a parent have higher the resulting phase will
  2604                 # be compliant anyway
  2601                 # be compliant anyway
  2605                 #
  2602                 #
  2606                 # if minimal phase was 0 we don't need to retract anything
  2603                 # if minimal phase was 0 we don't need to retract anything
  2607                 phases.registernew(self, tr, targetphase, [n])
  2604                 phases.registernew(self, tr, targetphase, [n])
  2608             tr.close()
       
  2609             return n
  2605             return n
  2610         finally:
       
  2611             if tr:
       
  2612                 tr.release()
       
  2613             lock.release()
       
  2614 
  2606 
  2615     @unfilteredmethod
  2607     @unfilteredmethod
  2616     def destroying(self):
  2608     def destroying(self):
  2617         '''Inform the repository that nodes are about to be destroyed.
  2609         '''Inform the repository that nodes are about to be destroyed.
  2618         Intended for use by strip and rollback, so there's a common
  2610         Intended for use by strip and rollback, so there's a common