##// END OF EJS Templates
commit: move lots of commitctx outside of the repo lock
Matt Mackall -
r8411:4d591635 default
parent child Browse files
Show More
@@ -826,29 +826,29 b' class localrepository(repo.repository):'
826 If working is set, the working directory is affected.
826 If working is set, the working directory is affected.
827 """
827 """
828
828
829 lock = self.lock()
830 tr = None
829 tr = None
831 valid = 0 # don't save the dirstate if this isn't set
830 valid = 0 # don't save the dirstate if this isn't set
832 try:
831 lock = None
833 commit = sorted(ctx.modified() + ctx.added())
832 commit = sorted(ctx.modified() + ctx.added())
834 remove = ctx.removed()
833 remove = ctx.removed()
835 extra = ctx.extra().copy()
834 extra = ctx.extra().copy()
836 branchname = extra['branch']
835 branchname = extra['branch']
837 user = ctx.user()
836 user = ctx.user()
838 text = ctx.description()
837 text = ctx.description()
839
838
840 p1, p2 = [p.node() for p in ctx.parents()]
839 p1, p2 = [p.node() for p in ctx.parents()]
841 c1 = self.changelog.read(p1)
840 c1 = self.changelog.read(p1)
842 c2 = self.changelog.read(p2)
841 c2 = self.changelog.read(p2)
843 m1 = self.manifest.read(c1[0]).copy()
842 m1 = self.manifest.read(c1[0]).copy()
844 m2 = self.manifest.read(c2[0])
843 m2 = self.manifest.read(c2[0])
845
844
846 xp1 = hex(p1)
845 xp1 = hex(p1)
847 if p2 == nullid: xp2 = ''
846 if p2 == nullid: xp2 = ''
848 else: xp2 = hex(p2)
847 else: xp2 = hex(p2)
848 self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
849
849
850 self.hook("precommit", throw=True, parent1=xp1, parent2=xp2)
850 lock = self.lock()
851
851 try:
852 tr = self.transaction()
852 tr = self.transaction()
853 trp = weakref.proxy(tr)
853 trp = weakref.proxy(tr)
854
854
General Comments 0
You need to be logged in to leave comments. Login now