~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Aaron Bentley
  • Date: 2007-06-12 22:09:44 UTC
  • mfrom: (540.1.2 bzrtools-0.17)
  • Revision ID: aaron.bentley@utoronto.ca-20070612220944-5zw4hlzp1ctq6mkl
Merge fixes from 0.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import sys
3
3
import subprocess
4
4
from datetime import datetime
5
 
from errors import CommandError, PatchFailed
 
5
from errors import CommandError, PatchFailed, PatchInvokeError
6
6
from hunk_selector import ShelveHunkSelector, UnshelveHunkSelector
7
7
from patchsource import PatchSource, FilePatchSource
8
8
from bzrlib.osutils import rename
255
255
        else:
256
256
            stdout = stderr = None
257
257
 
258
 
        process = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=stdout,
259
 
                        stderr=stderr)
260
 
        for patch in patches:
261
 
            process.stdin.write(str(patch))
 
258
        try:
 
259
            process = subprocess.Popen(args, stdin=subprocess.PIPE,
 
260
                                       stdout=stdout, stderr=stderr)
 
261
            for patch in patches:
 
262
                process.stdin.write(str(patch))
 
263
 
 
264
        except IOError, e:
 
265
            raise PatchInvokeError(e, process.stderr.read())
262
266
 
263
267
        process.communicate()
264
268