~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/patch.py

  • Committer: Martin Pool
  • Date: 2006-03-06 11:20:10 UTC
  • mfrom: (1593 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060306112010-17c0170dde5d1eea
[merge] large merge to sync with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import errno
1
2
import os
2
3
from subprocess import Popen, PIPE
 
4
 
 
5
from bzrlib.errors import NoDiff3
3
6
"""
4
7
Diff and patch functionality
5
8
"""
53
56
    add_label(args, "ANCESTOR")
54
57
    add_label(args, "MERGE-SOURCE")
55
58
    args.extend((mine_path, older_path, yours_path))
56
 
    output, stderr, status = write_to_cmd(args)
 
59
    try:
 
60
        output, stderr, status = write_to_cmd(args)
 
61
    except OSError, e:
 
62
        if e.errno == errno.ENOENT:
 
63
            raise NoDiff3
 
64
        else:
 
65
            raise
57
66
    if status not in (0, 1):
58
67
        raise Exception(stderr)
59
68
    file(out_file, "wb").write(output)