~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Neil Santos
  • Date: 2010-02-25 15:59:30 UTC
  • mfrom: (5057 +trunk)
  • mto: (5080.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5081.
  • Revision ID: neil_santos@users.sourceforge.net-20100225155930-ahki7c91v7rayurt
Merged r5057 from parent back in.
Implemented gz's suggested changes in the implementation of LocalTransport's link()

Show diffs side-by-side

added added

removed removed

Lines of Context:
515
515
        except (IOError, OSError),e:
516
516
            self._translate_error(e, path)
517
517
 
518
 
    def link(self, source, link_name):
519
 
        """See Transport.link."""
520
 
        try:
521
 
            os.link(self._abspath(source),
522
 
                    self._abspath(link_name))
523
 
            return True
524
 
        except AttributeError:
525
 
            raise errors.TransportNotPossible("Hardlinks are not supported on %s" % self)
526
 
        except (IOError, OSError), e:
527
 
            self._translate_error(e, source)
 
518
    if osutils.hardlinks_good():
 
519
        def link(self, source, link_name):
 
520
            """See Transport.link."""
 
521
            try:
 
522
                os.link(self._abspath(source),
 
523
                        self._abspath(link_name))
 
524
                return True
 
525
            except (IOError, OSError), e:
 
526
                self._translate_error(e, source)
528
527
 
529
528
    def symlink(self, source, link_name):
530
529
        """See Transport.symlink."""