~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/patch.py

More conflict handling, test porting

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)