~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Fixed a broken test from my 'push updates local working tree' fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
656
656
        self._transaction = new_transaction
657
657
 
658
658
    def lock_write(self):
659
 
        mutter("lock write: %s (%s)", self, self._lock_count)
 
659
        #mutter("lock write: %s (%s)", self, self._lock_count)
660
660
        # TODO: Upgrade locking to support using a Transport,
661
661
        # and potentially a remote locking protocol
662
662
        if self._lock_mode:
672
672
            self._set_transaction(transactions.PassThroughTransaction())
673
673
 
674
674
    def lock_read(self):
675
 
        mutter("lock read: %s (%s)", self, self._lock_count)
 
675
        #mutter("lock read: %s (%s)", self, self._lock_count)
676
676
        if self._lock_mode:
677
677
            assert self._lock_mode in ('r', 'w'), \
678
678
                   "invalid lock mode %r" % self._lock_mode
687
687
            self.get_transaction().set_cache_size(5000)
688
688
                        
689
689
    def unlock(self):
690
 
        mutter("unlock: %s (%s)", self, self._lock_count)
 
690
        #mutter("unlock: %s (%s)", self, self._lock_count)
691
691
        if not self._lock_mode:
692
692
            raise LockError('branch %r is not locked' % (self))
693
693
 
848
848
        old_revision = self.last_revision()
849
849
        new_revision = rev_history[-1]
850
850
        self.put_controlfile('revision-history', '\n'.join(rev_history))
851
 
        self.working_tree().set_last_revision(new_revision, old_revision)
 
851
        try:
 
852
            self.working_tree().set_last_revision(new_revision, old_revision)
 
853
        except NoWorkingTree:
 
854
            mutter('Unable to set_last_revision without a working tree.')
852
855
 
853
856
    def has_revision(self, revision_id):
854
857
        """See Branch.has_revision."""
1002
1005
            xml = self.working_tree().read_basis_inventory(revision_id)
1003
1006
            inv = bzrlib.xml5.serializer_v5.read_inventory_from_string(xml)
1004
1007
            return RevisionTree(self.weave_store, inv, revision_id)
1005
 
        except (IndexError, NoSuchFile), e:
 
1008
        except (IndexError, NoSuchFile, NoWorkingTree), e:
1006
1009
            return self.revision_tree(self.last_revision())
1007
1010
 
1008
1011
    def working_tree(self):
1023
1026
            except DivergedBranches:
1024
1027
                if not overwrite:
1025
1028
                    raise
 
1029
            if overwrite:
1026
1030
                self.set_revision_history(source.revision_history())
1027
1031
            new_count = len(self.revision_history())
1028
1032
            return new_count - old_count