/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Aaron Bentley
  • Date: 2007-12-20 19:16:02 UTC
  • mto: This revision was merged to the branch mainline in revision 3235.
  • Revision ID: abentley@panoramicfeedback.com-20071220191602-q1p5o3svshujfodd
Add support for hardlinks to TreeTransform

Show diffs side-by-side

added added

removed removed

Lines of Context:
427
427
        if typefunc(mode):
428
428
            os.chmod(self._limbo_name(trans_id), mode)
429
429
 
 
430
    def create_hardlink(self, path, trans_id):
 
431
        """Schedule creation of a hard link"""
 
432
        name = self._limbo_name(trans_id)
 
433
        os.link(path, name)
 
434
        try:
 
435
            unique_add(self._new_contents, trans_id, 'file')
 
436
        except:
 
437
            # Clean up the file, it never got registered so
 
438
            # TreeTransform.finalize() won't clean it up.
 
439
            os.unlink(name)
 
440
            raise
 
441
 
430
442
    def create_directory(self, trans_id):
431
443
        """Schedule creation of a new directory.
432
444