~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Aaron Bentley
  • Date: 2007-11-23 15:13:59 UTC
  • Revision ID: abentley@panoramicfeedback.com-20071123151359-yrjc6ta2fkbtu9ht
Remove switch (now in bzr itself)

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
        if reverse:
251
251
            args.append('-R')
252
252
        if dry_run:
253
 
            args.append('--dry-run')
254
 
            stdout = stderr = subprocess.PIPE
 
253
            if sys.platform.startswith('freebsd'):
 
254
                args.append('--check')
 
255
            else:
 
256
                args.append('--dry-run')
 
257
            stderr = subprocess.PIPE
255
258
        else:
256
 
            stdout = stderr = None
 
259
            stderr = None
257
260
 
258
261
        try:
259
262
            process = subprocess.Popen(args, stdin=subprocess.PIPE,
260
 
                                       stdout=stdout, stderr=stderr)
 
263
                                       stdout=subprocess.PIPE, stderr=stderr)
261
264
            for patch in patches:
262
265
                process.stdin.write(str(patch))
 
266
            process.stdin.close()
263
267
 
264
268
        except IOError, e:
265
269
            raise PatchInvokeError(e, process.stderr.read())
266
270
 
267
 
        process.communicate()
268
 
 
269
271
        result = process.wait()
 
272
        if not dry_run:
 
273
            sys.stdout.write(process.stdout.read())
270
274
        if result != 0:
271
275
            raise PatchFailed()
272
276