~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

Raise NoDiff if 'diff' not present.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
                   '--label', old_filename,
119
119
                   old_abspath,
120
120
                   '--label', new_filename,
121
 
                   new_abspath]
 
121
                   new_abspath,
 
122
                   '--binary',
 
123
                  ]
122
124
 
123
125
        # diff only allows one style to be specified; they don't override.
124
126
        # note that some of these take optargs, and the optargs can be
144
146
        if diff_opts:
145
147
            diffcmd.extend(diff_opts)
146
148
 
147
 
        pipe = subprocess.Popen(diffcmd,
148
 
                                stdin=subprocess.PIPE,
149
 
                                stdout=to_file)
 
149
        try:
 
150
            pipe = subprocess.Popen(diffcmd,
 
151
                                    stdin=subprocess.PIPE,
 
152
                                    stdout=to_file)
 
153
        except OSError, e:
 
154
            if e.errno == errno.ENOENT:
 
155
                raise errors.NoDiff(str(e))
 
156
            raise
150
157
        pipe.stdin.close()
151
158
        rc = pipe.wait()
152
159