~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2006-02-12 12:57:15 UTC
  • mto: (1534.1.22 integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060212125715-75abf487b5ee1f5a
Add update command for use with checkouts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1139
1139
            return result
1140
1140
 
1141
1141
    @needs_write_lock
 
1142
    def update(self):
 
1143
        self.branch.lock_read()
 
1144
        try:
 
1145
            if self.last_revision() == self.branch.last_revision():
 
1146
                return
 
1147
            basis = self.basis_tree()
 
1148
            to_tree = self.branch.basis_tree()
 
1149
            result = merge_inner(self.branch,
 
1150
                                 to_tree,
 
1151
                                 basis,
 
1152
                                 this_tree=self)
 
1153
            self.set_last_revision(self.branch.last_revision())
 
1154
            return result
 
1155
        finally:
 
1156
            self.branch.unlock()
 
1157
 
 
1158
    @needs_write_lock
1142
1159
    def _write_inventory(self, inv):
1143
1160
        """Write inventory as the current inventory."""
1144
1161
        sio = StringIO()