~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Robert Collins
  • Date: 2009-08-04 04:36:34 UTC
  • mfrom: (4583 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4593.
  • Revision ID: robertc@robertcollins.net-20090804043634-2iu9wpcgs273i97s
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
        raise NotImplementedError(self._gather_kinds)
234
234
 
235
235
    @needs_read_lock
 
236
    def has_changes(self, from_tree):
 
237
        """Quickly check that the tree contains at least one change.
 
238
 
 
239
        :return: True if a change is found. False otherwise
 
240
        """
 
241
        changes = self.iter_changes(from_tree)
 
242
        try:
 
243
            change = changes.next()
 
244
            # Exclude root (talk about black magic... --vila 20090629)
 
245
            if change[4] == (None, None):
 
246
                change = changes.next()
 
247
            return True
 
248
        except StopIteration:
 
249
            # No changes
 
250
            return False
 
251
 
 
252
    @needs_read_lock
236
253
    def last_revision(self):
237
254
        """Return the revision id of the last commit performed in this tree.
238
255
 
523
540
        for commit which is not required to handle situations that do not arise
524
541
        outside of commit.
525
542
 
 
543
        See the inventory developers documentation for the theory behind
 
544
        inventory deltas.
 
545
 
526
546
        :param new_revid: The new revision id for the trees parent.
527
547
        :param delta: An inventory delta (see apply_inventory_delta) describing
528
548
            the changes from the current left most parent revision to new_revid.