diff mbox series

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

Message ID 20180615135241.13307-1-petr.vorel@gmail.com
State Accepted
Headers show
Series [1/1] pwclient/get: Add suffix to created patch | expand

Commit Message

Petr Vorel June 15, 2018, 1:52 p.m. UTC
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
I like automatic syntax highlight, which requires suffix.
---
 patchwork/bin/pwclient | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stephen Finucane June 18, 2018, 4:41 p.m. UTC | #1
On Fri, 2018-06-15 at 15:52 +0200, Petr Vorel wrote:
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

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

Reviewed-by: Stephen Finucane <stephen@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:
diff mbox series

Patch

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: