~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-11 01:58:58 UTC
  • Revision ID: mbp@sourcefrog.net-20050411015857-f781b0d325632cf5cacd2481
- more output from test.sh
- write revison-history in a way that is hardlink-safe

Show diffs side-by-side

added added

removed removed

Lines of Context:
555
555
        ## TODO: Also calculate and store the inventory SHA1
556
556
        mutter("committing patch r%d" % (self.revno() + 1))
557
557
 
558
 
        mutter("append to revision-history")
559
 
        f = self.controlfile('revision-history', 'at')
560
 
        f.write(rev_id + '\n')
561
 
        f.close()
562
558
 
 
559
        self.append_revision(rev_id)
 
560
        
563
561
        if verbose:
564
562
            note("commited r%d" % self.revno())
565
563
 
566
564
 
 
565
    def append_revision(self, revision_id):
 
566
        mutter("add {%s} to revision-history" % revision_id)
 
567
        rev_history = self.revision_history()
 
568
 
 
569
        tmprhname = self.controlfilename('revision-history.tmp')
 
570
        rhname = self.controlfilename('revision-history')
 
571
        
 
572
        f = file(tmprhname, 'wt')
 
573
        rev_history.append(revision_id)
 
574
        f.write('\n'.join(rev_history))
 
575
        f.write('\n')
 
576
        f.close()
 
577
 
 
578
        if sys.platform == 'win32':
 
579
            os.remove(rhname)
 
580
        os.rename(tmprhname, rhname)
 
581
        
 
582
 
 
583
 
567
584
    def get_revision(self, revision_id):
568
585
        """Return the Revision object for a named revision"""
569
586
        r = Revision.read_xml(self.revision_store[revision_id])