~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Robert Collins
  • Date: 2005-12-15 03:21:11 UTC
  • mfrom: (1185.56.2 fixes)
  • Revision ID: robertc@robertcollins.net-20051215032111-e68d5e6ffbd4b574
* Raise NoSuchFile when someone tries to add a non-existant file.
  (Michael Ellerman)

* Simplify handling of DivergedBranches in cmd_pull().
  (Michael Ellerman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
 
94
94
    Returns the number of files added.
95
95
    """
96
 
    import os
 
96
    import os, errno
97
97
    from bzrlib.errors import BadFileKindError, ForbiddenFileError
98
98
    assert isinstance(recurse, bool)
99
99
 
106
106
        rf = tree.relpath(f)
107
107
        af = tree.abspath(rf)
108
108
 
109
 
        kind = bzrlib.osutils.file_kind(af)
 
109
        try:
 
110
            kind = bzrlib.osutils.file_kind(af)
 
111
        except OSError, e:
 
112
            if hasattr(e, 'errno') and e.errno == errno.ENOENT:
 
113
                raise errors.NoSuchFile(rf)
 
114
            raise
110
115
 
111
116
        if not InventoryEntry.versionable_kind(kind):
112
117
            if f in user_list: