~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-09-07 10:47:36 UTC
  • mto: (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050907104736-8e592b72108c577d
symlink support updated to work

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
    """
113
113
    if f == None:
114
114
        f = os.getcwd()
115
 
    elif hasattr(os.path, 'realpath'):
116
 
        f = os.path.realpath(f)
117
115
    else:
118
 
        f = os.path.abspath(f)
119
 
    if not os.path.exists(f):
 
116
        f = bzrlib.osutils.normalizepath(f)
 
117
    if not bzrlib.osutils.lexists(f):
120
118
        raise BzrError('%r does not exist' % f)
121
119
        
122
120
 
458
456
                    kind = file_kind(fullpath)
459
457
                except OSError:
460
458
                    # maybe something better?
461
 
                    raise BzrError('cannot add: not a regular file or directory: %s' % quotefn(f))
 
459
                    raise BzrError('cannot add: not a regular file, symlink or directory: %s' % quotefn(f))
462
460
 
463
 
                if kind != 'file' and kind != 'directory':
464
 
                    raise BzrError('cannot add: not a regular file or directory: %s' % quotefn(f))
 
461
                if kind not in ('file', 'directory', 'symlink'):
 
462
                    raise BzrError('cannot add: not a regular file, symlink or directory: %s' % quotefn(f))
465
463
 
466
464
                if file_id is None:
467
465
                    file_id = gen_file_id(f)
532
530
        finally:
533
531
            self.unlock()
534
532
 
535
 
 
536
533
    # FIXME: this doesn't need to be a branch method
537
534
    def set_inventory(self, new_inventory_list):
538
535
        from bzrlib.inventory import Inventory, InventoryEntry
544
541
            inv.add(InventoryEntry(file_id, name, kind, parent))
545
542
        self._write_inventory(inv)
546
543
 
547
 
 
548
544
    def unknowns(self):
549
545
        """Return all unknown files.
550
546