[PATCH 2 of 4 shelve-ext v3] shelve: move node-cleaning functionality to be a member of shelvedstate

Yuya Nishihara yuya at tcha.org
Wed Apr 12 10:45:53 EDT 2017


On Mon, 10 Apr 2017 16:28:34 -0700, Kostia Balytskyi wrote:
> # HG changeset patch
> # User Kostia Balytskyi <ikostia at fb.com>
> # Date 1491864494 25200
> #      Mon Apr 10 15:48:14 2017 -0700
> # Node ID 1f3af1e9d43286254237417adf26ecc97efa62e6
> # Parent  18d5dc2e81ff328facddd7c0294d7301a057504d
> shelve: move node-cleaning functionality to be a member of shelvedstate
> 
> This is just a piece of refactoring that I'd like to get in. It seems
> harmless to me and will still be valuable in future, when a better
> hiding mechanism is introduced.
> 
> diff --git a/hgext/shelve.py b/hgext/shelve.py
> --- a/hgext/shelve.py
> +++ b/hgext/shelve.py
> @@ -234,6 +234,11 @@ class shelvedstate(object):
>      def clear(cls, repo):
>          repo.vfs.unlinkpath(cls._filename, ignoremissing=True)
>  
> +    def removenodes(self, ui, repo):
> +        """Cleanup temporary nodes from the repo"""
> +        repair.strip(ui, repo, self.nodestoremove, backup=False,
> +                     topic='shelve')

This looked good at first, but the last patch makes me feel this might be
bad for storage abstraction. See the comment on the patch 4 for details.


More information about the Mercurial-devel mailing list