/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 breezy/mutabletree.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
            if _from_tree is None:
198
198
                _from_tree = self.basis_tree()
199
199
            changes = self.iter_changes(_from_tree)
200
 
            if self.supports_symlinks():
201
 
                # Fast path for has_changes.
202
 
                try:
 
200
            try:
 
201
                change = next(changes)
 
202
                # Exclude root (talk about black magic... --vila 20090629)
 
203
                if change[4] == (None, None):
203
204
                    change = next(changes)
204
 
                    # Exclude root (talk about black magic... --vila 20090629)
205
 
                    if change.parent_id == (None, None):
206
 
                        change = next(changes)
207
 
                    return True
208
 
                except StopIteration:
209
 
                    # No changes
210
 
                    return False
211
 
            else:
212
 
                # Slow path for has_changes.
213
 
                # Handle platforms that do not support symlinks in the
214
 
                # conditional below. This is slower than the try/except
215
 
                # approach below that but we don't have a choice as we
216
 
                # need to be sure that all symlinks are removed from the
217
 
                # entire changeset. This is because in platforms that
218
 
                # do not support symlinks, they show up as None in the
219
 
                # working copy as compared to the repository.
220
 
                # Also, exclude root as mention in the above fast path.
221
 
                changes = filter(
222
 
                    lambda c: c[6][0] != 'symlink' and c[4] != (None, None),
223
 
                    changes)
224
 
                try:
225
 
                    next(iter(changes))
226
 
                except StopIteration:
227
 
                    return False
228
205
                return True
 
206
            except StopIteration:
 
207
                # No changes
 
208
                return False
229
209
 
230
210
    def check_changed_or_out_of_date(self, strict, opt_name,
231
211
                                     more_error, more_warning):
406
386
        """
407
387
        raise NotImplementedError(self.copy_one)
408
388
 
409
 
    def get_transform(self, pb=None):
410
 
        """Return a transform object for use with this tree."""
411
 
        raise NotImplementedError(self.get_transform)
412
 
 
413
389
 
414
390
class MutableTreeHooks(hooks.Hooks):
415
391
    """A dictionary mapping a hook name to a list of callables for mutabletree