~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Michael Ellerman
  • Date: 2006-03-12 13:57:03 UTC
  • mto: (325.1.2 bzrtools) (0.3.1 shelf-dev)
  • mto: This revision was merged to the branch mainline in revision 334.
  • Revision ID: michael@ellerman.id.au-20060312135703-ebe82bc8d395e47f
Discard errors from patch if we're dry-running. It lies anyway.

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
            args.append('-R')
212
212
        if dry_run:
213
213
            args.append('--dry-run')
 
214
            stdout = stderr = subprocess.PIPE
 
215
        else:
 
216
            stdout = stderr = None
214
217
 
215
 
        process = subprocess.Popen(args, stdin=subprocess.PIPE)
 
218
        process = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=stdout,
 
219
                        stderr=stderr)
216
220
        for patch in patches:
217
221
            process.stdin.write(str(patch))
218
 
        process.stdin.close()
 
222
 
 
223
        process.communicate()
219
224
 
220
225
        result = process.wait()
221
226
        if result != 0: