[PATCH] transaction: fix backwards compatibility of atomic groups

Matt Mackall mpm at selenic.com
Mon May 11 13:46:39 CDT 2009


On Mon, May 11, 2009 at 03:30:09PM +0200, Henrik Stuart wrote:
> # HG changeset patch
> # User Henrik Stuart <hg at hstuart.dk>
> # Date 1241697157 -7200
> # Node ID 46998402ac99ea78a5ba3fd463feb5d8035f8c01
> # Parent  db52cc4f2f97e6a125d2f71363230357c0100570
> 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.

This looks great except for two things:

>          self.entries = []
>          self.map = {}
>          self.journal = journal
> +        self.queue = []

..we're evolving towards having object internals be prefixed with _,
so new members should add them.
  
>          self.file = open(self.journal, "w")
>          if createmode is not None:
> @@ -62,8 +63,25 @@
>              self.file.close()
>  
>      @active
> +    def start_atomic(self):
> +        self.queue.append([])

..otherwise we don't use underbars. Or uppercase. These method might be
less confusingly named 'startgroup/endgroup' as transactions are
already atomic in some sense.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list