[MERGE] get rid of os.spawnvp() usage for external diff

Aaron Bentley aaron.bentley at utoronto.ca
Sat Jun 17 01:28:12 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> Aaron Bentley wrote:
>> I don't see any handling of the case where patch is not installed.  Am I
>> missing something?
> 
> 
> I don't see where patch is needed for this.
> All it does is run the external diff, and check that it has real patch
> headers. I didn't see anywhere that it tried to apply the patch.
> Am I missing something?

Diff I meant.  Are you handling the case where diff is not installed?

>> Bonus points if you pass in -b, because that's more similar to
>> internal_diff's output.
> 
> 
> I thought '-b' would mean that it doesn't create a diff hunk for
> whitespace. 

Sorry,  --binary.

> Popen() doesn't support them, so you can't pass them as stdout for the
> spawned command.
> You could create another temporary file, and then read in the output,
> and write it to the passed in file.

It's easier than that:
p = Popen(stdout=PIPE)
to_file.writelines(p.stdout.readlines())

> But why not let other people worry about that.

Sure.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEk0yc0F+nu1YWqI0RAi97AJ4paYHPmTsyHZcpE+aC1OJkm/jLXgCfaC0K
LEVc4AE5OTy/x4fhCVwasos=
=CJ2G
-----END PGP SIGNATURE-----




More information about the bazaar mailing list