Skip to content

Commit

Permalink
git-pw: raise an HttpError if there is a problem retrieving a patch
Browse files Browse the repository at this point in the history
Use the requests.get method to retrieve the patch so that an HttpError
exception can be raised if there is a problem. The exception is already
handled in do_apply and do_apply_patch.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
  • Loading branch information
thos authored and Damien Lespiau committed Nov 19, 2015
1 parent e1d5741 commit 1ee54fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions git-pw/git-pw
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ class GitPatchwork(object):
self.pw.setup()

def am(self, mailbox_url):
p = subprocess.Popen('curl -s -S %s | git am -3' % mailbox_url,
shell=True)
p.wait()
r = requests.get(mailbox_url)
if r.status_code is not 200:
raise HttpError(r.status_code)

p = subprocess.Popen(['git', 'am', '-3'], stdin=subprocess.PIPE)
p.communicate(r.content)
return p.returncode

def cmd_get_series_revision(self):
Expand Down

0 comments on commit 1ee54fe

Please sign in to comment.