diff mercurial/repair.py @ 8363:c8e81f557da7

transaction: add atomic groups to transaction logic When performing a strip operation on a repository, it is vital that all the truncations are performed, or that none of them are. This is done by adding support for writing a number of entries in a single operation. Co-contributor: Sune Foldager <cryo@cyanite.org>
author Henrik Stuart <hg@hstuart.dk>
date Mon, 11 May 2009 21:12:40 +0200
parents b87a50b7125c
children e7e4e41b3bbc
line wrap: on
line diff
--- a/mercurial/repair.py	Tue May 12 11:15:54 2009 +0200
+++ b/mercurial/repair.py	Mon May 11 21:12:40 2009 +0200
@@ -125,10 +125,12 @@
     tr = repo.transaction()
     offset = len(tr.entries)
 
+    tr.startgroup()
     cl.strip(striprev, tr)
     mfst.strip(striprev, tr)
     for f in fs:
         f.strip(striprev, tr)
+    tr.endgroup()
 
     try:
         for i in xrange(offset, len(tr.entries)):