Skip to content

Commit

Permalink
pwclient/get: Add suffix to created patch
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Vorel <[email protected]>
Reviewed-by: Stephen Finucane <[email protected]>
  • Loading branch information
pevik authored and stephenfin committed Jun 18, 2018
1 parent 9c179bf commit 53561a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion patchwork/bin/pwclient
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
features:
- |
The ``pwclient get`` command will now download patches with a ``.patch``
extension.

0 comments on commit 53561a1

Please sign in to comment.