[PATCH 1/1] pwclient/get: Add suffix to created patch

Stephen Finucane stephen at that.guru
Tue Jun 19 02:41:03 AEST 2018


On Fri, 2018-06-15 at 15:52 +0200, Petr Vorel wrote:
> Signed-off-by: Petr Vorel <petr.vorel at gmail.com>

Makes sense. This is what we do for git-pw, fwiw.

Reviewed-by: Stephen Finucane <stephen at that.guru>

...and applied. Thanks for the contribution :)

Stephen

> ---
> I like automatic syntax highlight, which requires suffix.
> ---
>  patchwork/bin/pwclient | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/patchwork/bin/pwclient b/patchwork/bin/pwclient
> index 29cad89..79137b0 100755
> --- a/patchwork/bin/pwclient
> +++ b/patchwork/bin/pwclient
> @@ -305,9 +305,10 @@ def action_get(rpc, patch_id):
>          sys.exit(1)
>  
>      base_fname = fname = os.path.basename(patch['filename'])
> +    fname += '.patch'
>      i = 0
>      while os.path.exists(fname):
> -        fname = "%s.%d" % (base_fname, i)
> +        fname = "%s.%d.patch" % (base_fname, i)
>          i += 1
>  
>      with io.open(fname, 'w', encoding='utf-8') as f:



More information about the Patchwork mailing list