[PATCH 1 of 6] transaction: ensure journal is committed to file system

Matt Mackall mpm at selenic.com
Sun Apr 26 20:52:36 CDT 2009


On Fri, Apr 24, 2009 at 11:44:33AM +0200, Henrik Stuart wrote:
> Matt Mackall wrote:
> > On Tue, 2009-04-21 at 21:14 +0200, Dirkjan Ochtman wrote:
> >> On Tue, Apr 21, 2009 at 19:33, Henrik Stuart <hg at hstuart.dk> wrote:
> >>> +    def _write(self, data):
> >>>         # add enough data to the journal to do the truncate
> >>> -        self.file.write("%s\0%d\n" % (file, offset))
> >>> +        self.file.write(data)
> >>>         self.file.flush()
> >>> +        # ensure journal is synced to file system
> >>> +        os.fsync(self.file.fileno())
> >> I believe Matt stated that he didn't want this.
> > So look at the journal as an optimization for cleanup and less as an
> > integrity tool. We can always use verify to find the last
> > self-consistent revision.
> 
> Out of curiosity, is there another way to fix the repository but to make
> a clone of the latest self-consistent revision? Something in-place?

No, and mostly on purpose. Attempting to fix things in place is a good way to
lose them permanently.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list