[PATCH] patch: add close() to abstractbackend

Jun Wu quark at fb.com
Fri Jun 30 14:26:11 EDT 2017


LGTM.

Excerpts from Martin von Zweigbergk's message of 2017-06-30 09:14:50 -0700:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1498838844 25200
> #      Fri Jun 30 09:07:24 2017 -0700
> # Node ID 7a87ec7bcd672d0aa9178d9d87a7c8433241e5d3
> # Parent  40ee74bfa11122a0a3ab74186f5056243b84af89
> patch: add close() to abstractbackend
> 
> patchbackend() seems to call it on an arbitrary backend, so it seems
> to be part of the API. Since all subclasses do something in their
> close() methods, I decided to let this one raise an exception rather
> than just pass.
> 
> diff --git a/mercurial/patch.py b/mercurial/patch.py
> --- a/mercurial/patch.py
> +++ b/mercurial/patch.py
> @@ -448,6 +448,9 @@
>      def exists(self, fname):
>          raise NotImplementedError
>  
> +    def close(self):
> +        raise NotImplementedError
> +
>  class fsbackend(abstractbackend):
>      def __init__(self, ui, basedir):
>          super(fsbackend, self).__init__(ui)


More information about the Mercurial-devel mailing list