~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-01-02 20:46:44 UTC
  • mfrom: (3145.1.2 no-inventory4)
  • Revision ID: pqm@pqm.ubuntu.com-20080102204644-m6dav0cszl5e471x
Handle missing tools gracefully in diff --using (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
773
773
        return [t % my_map for t in self.command_template]
774
774
 
775
775
    def _execute(self, old_path, new_path):
776
 
        proc = subprocess.Popen(self._get_command(old_path, new_path),
777
 
                                stdout=subprocess.PIPE, cwd=self._root)
 
776
        command = self._get_command(old_path, new_path)
 
777
        try:
 
778
            proc = subprocess.Popen(command, stdout=subprocess.PIPE,
 
779
                                    cwd=self._root)
 
780
        except OSError, e:
 
781
            if e.errno == errno.ENOENT:
 
782
                raise errors.ExecutableMissing(command[0])
 
783
            else:
 
784
                raise
778
785
        self.to_file.write(proc.stdout.read())
779
786
        return proc.wait()
780
787