[PATCH] hg: move DirCleanup class so it's not nested

Matt Mackall mpm at selenic.com
Fri Oct 5 22:30:04 CDT 2012


On Fri, 2012-10-05 at 18:17 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <raf at durin42.com>
> # Date 1349478656 18000
> # Node ID 6f4b1adf77051c8a999831d6468f76d5a953f43f
> # Parent  fa714f3ed2989aff64c267c9935251d9fc4f31ee
> hg: move DirCleanup class so it's not nested
> 
> There wasn't any need for the class to be nested, and this makes the code
> just a little easier to read.

This is a legacy from the time when we used to rely on destructors for
cleanup. We should instead just use a finally clause rather than a
class-used-solely-for-its-destructor-guarantees-that-don't-actually-exist.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list